Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirement with extra not installed #2604

Closed
adamchainz opened this issue Dec 7, 2022 · 4 comments
Closed

requirement with extra not installed #2604

adamchainz opened this issue Dec 7, 2022 · 4 comments

Comments

@adamchainz
Copy link
Contributor

adamchainz commented Dec 7, 2022

s## Issue

Minimized from daphne, which I just tried upgrading to tox 4.

Take this project setup in 4 files:

pyproject.toml:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

setup.cfg:

[metadata]
name = example

[options]
py_modules = example
install_requires =
    twisted[tls]>=22.4

example.py:

import twisted

tox.ini:

[tox]
envlist = 311

[testenv]
commands =
    python -m example

On tox 3, this passes. On tox 4.0.0rc2+, it fails by not installing twisted:

tox
.pkg: install_requires> python -I -m pip install setuptools
.pkg: _optional_hooks> python /.../python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_sdist> python /.../python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: prepare_metadata_for_build_wheel> python /.../python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_sdist> python /.../python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
311: install_package> python -I -m pip install --force-reinstall --no-deps /Users/chainz/tmp/toxfail/.tox/.pkg/dist/example-0.0.0.tar.gz
311: commands[0]> python -m example
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/chainz/tmp/toxfail/example.py", line 1, in <module>
    import twisted
ModuleNotFoundError: No module named 'twisted'
311: exit 1 (0.01 seconds) /Users/chainz/tmp/toxfail> python -m example pid=735
.pkg: _exit> python /.../python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  311: FAIL code 1 (3.01=setup[3.00]+cmd[0.01] seconds)
  evaluation failed :( (3.03 seconds)

This succeeds on tox 4.0.0rc1.

Removing the [tls] extra from twisted in setup.cfg also makes this pass on tox 4.0.0rc2+.

I suspect it has the same cause as #2603.

@adamchainz
Copy link
Contributor Author

Bisected to #2579.

@gaborbernat
Copy link
Member

Can you try with #2605 ?

@gaborbernat
Copy link
Member

Duplicate of #2603.

@adamchainz
Copy link
Contributor Author

That’s fixed it! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants