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.
ruff (https://github.com/charliermarsh/ruff) is a new and extremely fast
Python linter, written in Rust.
Ruff can be used to replace Flake8 (plus a variety of plugins), isort,
pydocstyle, yesqa, eradicate, pyupgrade, and autoflake.
Here ruff is added to our current linters (flake8, flake8-bugbear and isort)
while we assess its reliability.
I've not enabled the isort rules because many of the options we use are not
implemented yet. I have instead enabled the pyupgrade rules (a tool which I
run manually every few months).
Also:
- Fix new linting errors reported by ruff.
They are expressions that get uselessly evaluated.
These were reported as B018 errors by flake8-bugbear 21.11.28 , but B018 for
strings has then been disabled in 21.11.29 since these strings can also be
used as inline attribute doc strings or module variable docstrings (not our
case though).
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
By default it's a bytestring.
Also:
- don't use `shell=True`
- add a `splitlines()` forgotten in commit 670897ec5c
- raise exception instead of returning `error_info` in `docker_to_singularity()`
- use a random temp dir in `singularity_container_test()`
currently group removes empty cells at the begin and end of lines
additionally the sort command line is changed (hoping that this looks a bit
more obvious)
- replaces non 'floatable' values to a user supplied default value
- do not strip lines because this removes empty cells at the ends
- added some comments to python code
Also:
- dos2unix test/functional/tools/for_workflows/head.xml
- Single-quote text and data params in `<command/>`
- Remove deprecated `interpreter` attribute of `<command />`
strings can not be written to byte mode file handlers.
writing resulted in: TypeError: a bytes-like object is required, not 'str'
Alternative would be to make string byte.