Used in `test/unit/util/test_get_url.py` since commit
69ebbb761a .
Pin Werkzeug in `lib/galaxy/dependencies/dev-requirements.txt`
to latest version compatible with pytest-httpserver 1.0.6 .
Fix unit test collection error on Python 3.11:
```
File "/home/runner/work/galaxy/galaxy/galaxy root/.tox/unit-coverage/lib/python3.11/site-packages/pytest_httpserver/httpserver.py", line 26, in <module>
from werkzeug.http import parse_authorization_header
ImportError: cannot import name 'parse_authorization_header' from 'werkzeug.http' (/home/runner/work/galaxy/galaxy/galaxy root/.tox/unit-coverage/lib/python3.11/site-packages/werkzeug/http.py)
```
twill 3.2 replaced `requests` with `httpx`, and `httpx` has a default
timeout of 5 s on a request, while `requests` didn't enforce a timeout by
default.
Fix errors like the following in ToolShed tests, where resetting
repository metadata takes longer than 5 s:
```
self = <tool_shed.test.functional.test_0000_basic_repository_features.TestBasicRepositoryFeatures object at 0x7f28f99197c0>
def test_0090_verify_repository_metadata(self):
"""Verify that resetting the metadata does not change it."""
repository = self._get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
> self.verify_unchanged_repository_metadata(repository)
lib/tool_shed/test/functional/test_0000_basic_repository_features.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
lib/tool_shed/test/base/twilltestcase.py:2073: in verify_unchanged_repository_metadata
self.reset_repository_metadata(repository)
lib/tool_shed/test/base/twilltestcase.py:1774: in reset_repository_metadata
self.visit_url("/repository/reset_all_metadata", params=params)
lib/tool_shed/test/base/twilltestcase.py:845: in visit_url
return self._browser.visit_url(url, allowed_codes=allowed_codes)
lib/tool_shed/test/base/twillbrowser.py:35: in visit_url
return visit_url(url, allowed_codes=allowed_codes)
lib/tool_shed/test/base/twillbrowser.py:20: in visit_url
new_url = tc.go(url)
.venv/lib/python3.8/site-packages/twill/commands.py:120: in go
browser.go(url)
.venv/lib/python3.8/site-packages/twill/browser.py:192: in go
self._journey("open", try_url)
.venv/lib/python3.8/site-packages/twill/browser.py:677: in _journey
result = self._client.get(url)
.venv/lib/python3.8/site-packages/httpx/_client.py:1041: in get
return self.request(
.venv/lib/python3.8/site-packages/httpx/_client.py:814: in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
.venv/lib/python3.8/site-packages/httpx/_client.py:901: in send
response = self._send_handling_auth(
.venv/lib/python3.8/site-packages/httpx/_client.py:929: in _send_handling_auth
response = self._send_handling_redirects(
.venv/lib/python3.8/site-packages/httpx/_client.py:966: in _send_handling_redirects
response = self._send_single_request(request)
.venv/lib/python3.8/site-packages/httpx/_client.py:1002: in _send_single_request
response = transport.handle_request(request)
.venv/lib/python3.8/site-packages/httpx/_transports/default.py:228: in handle_request
resp = self._pool.handle_request(req)
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/contextlib.py:131: in __exit__
self.gen.throw(type, value, traceback)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
@contextlib.contextmanager
def map_httpcore_exceptions() -> typing.Iterator[None]:
try:
yield
except Exception as exc:
mapped_exc = None
for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
if not isinstance(exc, from_exc):
continue
# We want to map to the most specific exception we can find.
# Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
# `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
if mapped_exc is None or issubclass(to_exc, mapped_exc):
mapped_exc = to_exc
if mapped_exc is None: # pragma: no cover
raise
message = str(exc)
> raise mapped_exc(message) from exc
E httpx.ReadTimeout: timed out
.venv/lib/python3.8/site-packages/httpx/_transports/default.py:83: ReadTimeout
```
Goals:
- Replace direct database access with pydantic typed API requests.
- Replace Twill with playwright.
- Eliminate access to the Galaxy UI in the tests - the tests should assume API access from the installing party.
pytest-playwright requires small bits of #13909.
This is a worthy project that could let us remove a bunch of deprecated stuff from the Galaxy admin controllers and a bunch of mako stuff that is unused and could be used to test PRs like #14609 (which prompted me to do this) but I'm anxious about growing emotionally attached to code I want to remove and I'm worried about losing track of which helpers are required for Planemo/Emphemeris/Galaxy and which helpers are just being used to test the tool shed.
Due to a bug in poetry ( https://github.com/python-poetry/poetry/issues/8194 ),
the 2.0.0rc2 pre-release of sphinx-rtd-theme was selected to allow
the update of docutils to 0.19, instead of sticking with the current
version for both.
This breaks the doc build with this error:
```
writing output... [ 0%] admin/apache
Theme error:
An error happened in rendering the page admin/apache.
Reason: AttributeError("'str' object has no attribute 'attributes'")
```
Fix the following warning:
Warning: In a future version of Poetry, PyPI will be disabled
automatically if at least one custom primary source is configured.
In order to avoid a breaking change and make your pyproject.toml
forward compatible, add PyPI explicitly via 'poetry source add pypi'.
By the way, this has the advantage that you can set the priority of
PyPI as with any other source.
Fixes
```
Traceback (most recent call last):
File "/storage/srv/galaxy/server/.venv/lib64/python3.9/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 35, in __init__
parsed = _parse_requirement(requirement_string)
File "/storage/srv/galaxy/server/.venv/lib64/python3.9/site-packages/pkg_resources/_vendor/packaging/_parser.py", line 64, in parse_requirement
return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
File "/storage/srv/galaxy/server/.venv/lib64/python3.9/site-packages/pkg_resources/_vendor/packaging/_parser.py", line 73, in _parse_requirement
name_token = tokenizer.expect(
File "/storage/srv/galaxy/server/.venv/lib64/python3.9/site-packages/pkg_resources/_vendor/packaging/_tokenizer.py", line 140, in expect
raise self.raise_syntax_error(f"Expected {expected}")
File "/storage/srv/galaxy/server/.venv/lib64/python3.9/site-packages/pkg_resources/_vendor/packaging/_tokenizer.py", line 165, in raise_syntax_error
raise ParserSyntaxError(
pkg_resources.extern.packaging._tokenizer.ParserSyntaxError: Expected package name at the start of dependency specifier
"git+https://github.com/jakobmerljak/pyarcrest.git@dev"
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/storage/srv/galaxy/server/lib/galaxy/dependencies/__init__.py", line 312, in optional
conditional = ConditionalDependencies(config_file)
File "/storage/srv/galaxy/server/lib/galaxy/dependencies/__init__.py", line 45, in __init__
self.get_conditional_requirements()
File "/storage/srv/galaxy/server/lib/galaxy/dependencies/__init__.py", line 176, in get_conditional_requirements
for req in pkg_resources.parse_requirements(open(crfile).readlines()):
File "/storage/srv/galaxy/server/.venv/lib64/python3.9/site-packages/pkg_resources/__init__.py", line 3174, in __init__
super(Requirement, self).__init__(requirement_string)
File "/storage/srv/galaxy/server/.venv/lib64/python3.9/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 37, in __init__
raise InvalidRequirement(str(e)) from e
pkg_resources.extern.packaging.requirements.InvalidRequirement: Expected package name at the start of dependency specifier
"git+https://github.com/jakobmerljak/pyarcrest.git@dev"
^
```
for advanced package specifiers that might be used during development.
This reverts commit 353c08cbb9 .
pysam 0.20.0 doesn't build for Python 3.11 on macOS, so we need to
temporarily add the unnecessary Cython runtime dependency that
pysam 0.21 brings in.