mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 11:55:04 -04:00
Don't require setuptools_rust
at runtime (#13952)
This commit is contained in:
parent
15754d720f
commit
6f0c3e669d
3 changed files with 35 additions and 3 deletions
|
@ -66,6 +66,21 @@ def _is_dev_dependency(req: Requirement) -> bool:
|
|||
)
|
||||
|
||||
|
||||
def _should_ignore_runtime_requirement(req: Requirement) -> bool:
|
||||
# This is a build-time dependency. Irritatingly, `poetry build` ignores the
|
||||
# requirements listed in the [build-system] section of pyproject.toml, so in order
|
||||
# to support `poetry install --no-dev` we have to mark it as a runtime dependency.
|
||||
# See discussion on https://github.com/python-poetry/poetry/issues/6154 (it sounds
|
||||
# like the poetry authors don't consider this a bug?)
|
||||
#
|
||||
# In any case, workaround this by ignoring setuptools_rust here. (It might be
|
||||
# slightly cleaner to put `setuptools_rust` in a `build` extra or similar, but for
|
||||
# now let's do something quick and dirty.
|
||||
if req.name == "setuptools_rust":
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class Dependency(NamedTuple):
|
||||
requirement: Requirement
|
||||
must_be_installed: bool
|
||||
|
@ -77,7 +92,7 @@ def _generic_dependencies() -> Iterable[Dependency]:
|
|||
assert requirements is not None
|
||||
for raw_requirement in requirements:
|
||||
req = Requirement(raw_requirement)
|
||||
if _is_dev_dependency(req):
|
||||
if _is_dev_dependency(req) or _should_ignore_runtime_requirement(req):
|
||||
continue
|
||||
|
||||
# https://packaging.pypa.io/en/latest/markers.html#usage notes that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue