Commit Graph
115 Commits
Author SHA1 Message Date
Nicola Soranzo 8cdca0f343 Revert some requests import changes
introduced in https://github.com/galaxyproject/galaxy/pull/18003 .
In particular, when using requests in the tests to connect to Galaxy
or the ToolShed it's not needed to use the modified headers.

Also:
- Move some imports after conditional imports.
- Fix type annotations in `lib/tool_shed/test/base/populators.py`
- Fix typo bug in `test/unit/util/test_get_url.py`
2024-05-23 15:55:56 +01:00
John Chilton 2f43c32fd9 Merge pull request #18003 from mvdbeek/add_galaxy_to_user_agent
Add galaxy to user agent
2024-05-20 12:14:13 -04:00
Nicola Soranzo 534010a8cb Enable flake8-implicit-str-concat ruff rules
See https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
2024-04-29 13:37:54 +01:00
Nicola Soranzo 0629908541 Fix new UP031 errors from ruff 0.4.2 2024-04-29 00:09:38 +01:00
mvdbeek e8a3b8c0cd Create wrapper for requests with default user agent 2024-04-16 17:54:29 +02:00
Nicola Soranzo d258e5791e Fix new E721 errors from ruff 0.0.290 2023-09-20 01:43:40 +01:00
mvdbeek 130d2b078e Update and apply ruff refactorings
ruff 0.280.0 has a bug that would turn the imports guarded by `if
TYPE_CHECKING` into their non-string variant, which would break the
runtime. So we can't merge 23.1 into dev without this.
2023-08-09 17:14:07 +02:00
Nicola Soranzo 30f60493c3 Format Python code with black 23.1.0
with manual fixes to 3 files to make them compatible with black 22.12.0 .

We need to keep black pinned at `<23` until we vendorise `packaging`, since
the new version of black depends on `packaging >=22.0` which is the version
where `LegacyVersion` (which we use for tool lineages) was removed.
2023-02-01 23:51:03 +00:00
Nicola Soranzo 14b1730eb2 Combine "as" imports with other "from" imports 2022-06-20 20:06:30 +01:00
mvdbeek d6424b5e72 Drop more mappings that don't exist anymore 2022-03-21 13:14:43 +01:00
mvdbeek d844db440e Drop repair repository script, uses endpoint that doesn't exist anymore 2022-03-21 13:14:43 +01:00
mvdbeek 3badee379d Drop workflow import script that uses API endpoint that doesn't exist anymore 2022-03-21 13:14:43 +01:00
Nicola Soranzo 0c80836c34 Upgrade syntax to Python 3.7
using `ack --type=python -f | grep -v '^tools/' | xargs pyupgrade --py37-plus`

Also more refactoring of Python files in `packages/` .
2022-03-14 14:57:43 +00:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
Nicola Soranzo 90a729e431 New pyupgrade fixes
Found by running `ack --type=python -f | grep -v '^tools/' | xargs pyupgrade --py36-plus`
2021-10-24 12:10:34 +01:00
Sergey Golitsynskiy 66d2d4b40e Fix printing non-dict output 2021-02-02 16:04:44 -05:00
Sergey Golitsynskiy 211b5d599e Fix bug: i can be str, not dict
Example cause: api/datatypes endpoint returns a list of strings
2021-01-21 22:09:30 -05:00
Nicola Soranzo d26b3d9848 Fix all E203, E741 and W504 flake8 errors 2021-01-18 10:35:41 +00:00
Nicola Soranzo 452aba9ee3 Fix remaining issues reported by bugbear; add it to flake8 reqs 2021-01-16 05:58:15 +00: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 f5cd88465e Make str.join()s more efficient
by using generator expressions and tuples instead of lists.
2020-01-23 11:06:32 +00:00
Nicola Soranzo d53112aa43 Use `yaml.safe_load() instead of load()`
See https://msg.pyyaml.org/load
2019-04-23 16:50:55 +01:00
Nicola Soranzo 0c931235af Change all remaining old-style classes to new style 2018-09-17 12:26:07 +01:00
Nicola Soranzo ad02c53154 Fix many links 2018-09-03 14:34:13 +01:00
Nicola Soranzo d66a63012a Replace unmaintained pycrypto dependency with pycryptodome
Minimum secret key length for Blowfish was increased from 4 to 5 bytes.

First argument to Blowfish.new() must be a bytestring, and the `mode`
argument is no more optional.

Remove unused `encode_id` function from `scripts/api/common.py` .

Documentation updated, then rebuilt with `make config-rebuild` .
2018-06-13 03:07:04 +01:00
John Chilton 1c6cc02415 Hierarchical upload API optimized for folders & collections.
Allows describing hierarchical data in JSON or inferring structure from archives or directories.

Datasets or archive sources can be specified via uploads, URLs, paths (if admin && allow_path_paste), library_import_dir/user_library_import_dir, and/or FTP imports. Unlike existing API endpoints, a mix of these on a per file basis is allowed and they work seemlessly between libraries and histories.

Supported "archives" include gzip, zip, bagit directories, bagit achives (with fetching and validations of downloads).

The existing upload API endpoint is quite rough to work with both in terms of adding parameters (e.g. the file type and dbkey hanlding in 4563 was difficult to implement, terribly hacky, and should seemingly have been trivial) and in terms of building requests (one needs to build a tool form - not describe sensible inputs in JSON). This API is built to be intelligable from an API standpoint instead of being constrained to the older style tool form. Additionally it built with hierarchical data in mind in a way that would not be easy at all enhancing the tool form components we don't even render.

This implements 5159 though much simpler YAML descriptions of data libraries should be possible basically as the API descriptions. We can replace the data library script in Ephemeris https://github.com/galaxyproject/ephemeris/blob/master/ephemeris/setup_data_libraries.py with one that converts a simple YAML file into an API call and allows many new options for free.

In future PRs I'll add filtering options to this and it will serve as the backend to 4733.
2018-03-08 10:33:36 -05:00
John Chilton f9969ee97a Remove API scripts for axed APIs. 2017-12-15 16:02:18 -05:00
Nicola Soranzo 48aca7dce8 Update to flake8-import-order 0.16 2017-12-01 11:09:57 +00: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 9b1832abb1 Fix import order for cron/, scripts/ and test/ 2017-09-25 23:44:39 +01:00
Nicola Soranzo a353b2e88f Fix E127 errors introduced by previous commit
using:
```
autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E127 .
```
2017-08-17 11:35:39 +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
Matt Chambers 25bd7178c1 Remove print of non-existent attribute 'content' 2017-08-16 14:44:51 -05:00
Frederic Sapet 3384e13744 correction of a typo leading to incomplete format string 2017-06-16 14:29:34 +02:00
Martin Cech 0602712a35 deduplicate obsolete API readme 2017-03-20 10:57:06 -04:00
Nicola Soranzo 3d57c22b63 Fix I201 errors from flake8-import-order
Also fix Python3 compatibility.
Remove unused method
galaxy.tools.parameters.sanitize.ToolParameterSanitizer.restore_param() .
2016-11-23 18:31:04 +00:00
Nicola Soranzo 1d17a29c79 Fixes for pycodestyle 2.2.0 2016-11-15 16:56:50 +00:00
Nicola Soranzo 9c37c6df89 Fixes for flake8-import-order 0.11
Also fix Python3 compatibility.
2016-11-11 15:09:34 +00:00
Junzhou Wang e45f8abb54 Python3:script/api/ 2016-06-25 20:49:06 -04:00
Junzhou Wang a04f6589ea Python3: test/shed_functional/ and test/unit/ 2016-06-25 20:00:42 -04:00
Nicola Soranzo 6ba6f798ec Fix more E203 flake8 errors 2016-05-17 23:53:16 +01:00
Nicola Soranzo 8a43b2b492 Python 3: use "as" instead of comma in except clause 2016-05-17 23:53:16 +01:00
Matt Chambers 384bdbfe70 Fix flaky "errors" 2016-05-13 11:38:48 -05:00
chambm 3a708a0089 Add filter_failed_datasets_from_collection.py script 2016-05-13 10:53:56 -05: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
Nicola Soranzo 196d174716 Python 3 support for 3 files. 2016-02-18 15:45:15 +00:00
Nicola Soranzo 93348e7199 Fix the remaining 1334 flake8 errors in scripts/ . Close #391. 2016-02-18 15:45:15 +00:00
Nate Coraor 4a05d5ea12 Merge branch 'dev' of https://github.com/galaxyproject/galaxy into smash_eggs 2015-10-20 18:59:06 -04:00
Eric Rasche 8a66701d4f Don't re-upload if already there 2015-10-15 16:02:05 -05:00
Eric Rasche 2cca823a78 Prepopulate memoization cache 2015-10-14 16:05:44 -05:00