Commit Graph
31 Commits
Author SHA1 Message Date
mvdbeek 8a1b75bbb0 Disable verbose parso logging in db_shell.py 2023-07-16 09:21:22 +10:00
John Davis 6bb29939e2 Drop create_db.sh, create_db.py (see note)
For ToolShed, we have create_toolshed_db.sh.

For galaxy and toolshed install databases (gxy and tsi branches under
alembic), we use the `init` subcommand of the `db.sh` script (`./db.sh
init`), which has exactly the same functionality as these deleted
scripts.

To the best of my knowledge, these are not used anywhere else (unlike,
for example, scripts/manage_db.py, which is called from the
ansible-galaxy role).
2022-09-16 00:39:03 -04:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
mvdbeek 0091d37469 Add interactive shell for celery tasks
That's pretty useful for developing new tasks or just running one-off
tasks.
2021-11-29 10:34:01 +01:00
Nicola Soranzo 9d74bba7fb Drop support for retired Python 3.5
Upgrade syntax using `pyupgrade --py36-plus` .

Manually drop several `six` imports.

Also:
- Remove broken pr_cache in scripts/bootstrap_history.py
- Fix broken prefix removal in lib/galaxy/tool_util/deps/mulled/mulled_build.py
2020-10-07 11:52:13 +01:00
Nicola Soranzo 1fd248311f Fix traceback in `printquery()`
Fix the following traceback:

```
/usr/users/ga002/soranzon/software/galaxyproject_galaxy/scripts/db_shell.py in printquery(statement, bind)
     60         if bind is None:
     61             bind = statement.session.get_bind(
---> 62                 statement._mapper_zero_or_none())
     63         statement = statement.statement
     64     elif bind is None:

AttributeError: 'Query' object has no attribute '_mapper_zero_or_none'
```

due to the removal of `_mapper_zero_or_none()` in SQLAlchemy commit
https://github.com/sqlalchemy/sqlalchemy/commit/234a5b9723fbbb9747c0f9e3917baf8500b73370
2019-06-11 11:31:40 +01:00
John Chilton 5f3f792f6f Unification of Galaxy configuration parsing for scripts/* 2018-03-23 16:14:49 -04:00
mvdbeek 654ed86b37 Setup a dummy registry to allow some more operations, e.g. accessing metadata 2018-01-19 15:09:38 +01:00
mvdbeek 5c4c25b63d Mention how to specify the config file location
and how to do that when using ipython.
2018-01-11 10:42:44 +01:00
John Chilton d69962e7f4 Implement model abstraction for `ImplicitCollectionJobs`.
These aggregate all the jobs contributing to an implicitly created HistoryDatasetCollectionAssociation.

- Model enhancements that allow this.
- API endpoint for jobs summary of history content (somewhat uniform across HDAs and HDCAs just for consistency).
- Test cases.
- Rework history contents API a bit to eliminate more costly state summary checks by default.
2017-11-30 10:02:02 -05:00
Nicola Soranzo d1bc98dfcb Python3: fix remaining print statements
Remove some debugging prints.
Fix import order.
Consolidate exception logging in ToolShed database migrations.
2017-10-12 18:34:29 +01:00
Nicola Soranzo 21b44bf348 Fix all E201 and E202 style errors
using the following command:
```
autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E201,E202 .
```
2017-08-17 11:35:39 +01:00
Nicola Soranzo e4b3766c1b Change remaining __all__ from list to tuple
Also fix import order and Python3 compatibility.
2016-10-18 19:24:31 +01:00
Nicola Soranzo cd13423953 Python3: small fixes to previous commits 2016-06-26 02:43:57 -04:00
Junzhou Wang f68a8198da Python3: scripts/cleanup_datasets scripts/data_libraries 2016-06-25 21:49:25 -04:00
Nicola Soranzo d85db9daa6 Use __file__ when adding paths to sys.path instead of os.getcwd() .
Also insert additional paths in position 1 unless strictly necessary.
2016-02-18 15:45:15 +00:00
Nate Coraor 0469ed29e0 Remove egg cruft from scripts/ 2015-09-21 15:55:07 -04:00
Nicola Soranzo 34d9388456 Use os.pardir everywhere instead of '..' . 2015-07-14 16:20:29 +01:00
Nicola Soranzo 6569c2dcc3 Partially lint scripts/ . 2015-07-13 20:13:28 +01:00
John Chilton 63a4c36770 Add utility for debugging sqlalchemy queries in db_shell.py.
Should aid in interactively building up queries.
2014-06-10 15:01:38 -05:00
John Chilton 79c8f59341 Models: Introduce real class for app.model (ModelMapping).
Shared across Tool Shed and Galaxy to reduce code duplication. Previously this was just a bunch, making it a real class allows placing some shared logic in there.

This refactoring also eliminates some global variables galaxy.model.mapping.Session, galaxy.model.mapping.context, and same for tool shed. This may break things, but these are things that should probably be fixed anyway.

In particular small changes to db_shell.py and a unit test that depended on these global variables have been updated. The functional test frameworks likewise needed to be updated to not depend on these - these changes were more substantial.

To fix these functional tests, I essentially replace old references to global variables in Galaxy with references to global variables just defined in the test framework in test/functional/database_contexts.py (a slight improvement).
2013-12-05 00:20:54 -06:00
John Chilton b686182e13 Modles: Clean up stand-alone database scripts.
Namely create_db.py,db_shell.py, and manage_db.py.

Move duplicated code into lib/galaxy/model/orm/scripts.py - add unit tests. PEP-8 clean up of all 4 files. Add incoherent incoherent comment at top of manage_db.py.

As a result of the code de-duplication create_db.py should be usable with the tool shed now.

Will be refactoring lib/galaxy/model/orm/scripts.py to work with new tool shed install database - it will be good to have a place to test these and allow manage_db.py and clean_db.py to work immediately.
2013-12-05 00:20:54 -06:00
Dannon Baker b66c39c951 galaxy.model.orm is a more sensible location than mapping for dialect_to_egg 2013-06-20 10:58:52 -04:00
Dannon Baker be4bc4694a Consolidate dialect_to_egg to a single location. 2013-06-20 10:50:31 -04:00
Dannon Baker cd23ac7014 Make sure dependent eggs are loaded for sqlalchemy-migrate, regardless of entry point. This is a hack, and dependency management should/will eventually handle it. 2013-05-03 12:55:55 -04:00
Dannon Baker e436468f28 Require decorator egg wherever we have sqlalchemy-migrate. Should be able to resolve dependencies and do this automatically 2013-05-03 12:31:20 -04:00
Greg Von Kuster ae39ab8f2b Rename community_wsgi.ini.sample to be tool_shed_wsgi.ini.sample, run_community.sh to run_tool_shed.sh, and fix references to these files in the code. 2013-03-18 10:24:03 -04:00
Greg Von Kuster f539d3071b Change the name and path of the community webapp to be tool_shed. 2013-02-27 16:23:19 -05:00
Daniel Blankenberg 94a2f94529 Fix minor typos in db_shell.py 2012-10-11 16:43:37 -04:00
John Chilton de62173aff Actually we don't want to set that environment variable, that make
python behave like -i every execution.
2012-03-05 15:23:28 -06:00
John Chilton ecb256ef46 Adding db_shell.py that can be used to simplify writing command line
scripts against the Galaxy model/database layer or to make use of
Galaxy models in an interactive shell.
2012-03-05 12:11:53 -06:00