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

uv build --wheel doesn't seem to be installing dev-dependencies #7154

Closed
alex opened this issue Sep 7, 2024 · 10 comments · Fixed by #7169
Closed

uv build --wheel doesn't seem to be installing dev-dependencies #7154

alex opened this issue Sep 7, 2024 · 10 comments · Fixed by #7169
Labels
bug Something isn't working

Comments

@alex
Copy link
Contributor

alex commented Sep 7, 2024

pyca/cryptography#11558 shows trying to take advantage of uv build, however CI doesn't seem happy: https://github.com/pyca/cryptography/actions/runs/10748158349/job/29811544879?pr=11558

Notably, when running uv build -v --wheel --require-hashes --build-constraint=$BUILD_REQUIREMENTS_PATH cryptography*.tar.gz $PY_LIMITED_API -o wheelhouse/:

DEBUG uv 0.4.7
DEBUG Searching for Python interpreter in managed installations, system path, or `py` launcher
DEBUG Searching for managed installations at `C:\Users\runneradmin\AppData\Roaming\uv\python`
DEBUG Found `cpython-3.11.9-windows-x86_64-none` at `C:\hostedtoolcache\windows\Python\3.11.9\x64\python3.exe` (search path)
DEBUG Using request timeout of 30s
Building wheel from source distribution...
DEBUG Calling `maturin.build_wheel("D:\\a\\cryptography\\cryptography\\wheelhouse\\.tmpNob9dO", {"build-args":"--features=pyo3/abi3-py39"}, None)`
Traceback (most recent call last):
  File "<string>", line 8, in <module>
ModuleNotFoundError: No module named 'maturin'
error: Build backend failed to build wheel through `build_wheel()` with exit code: 1

For whatever reason, uv doesn't seem to actually install maturin.

When running this same command locally (on macOS), I see output like the following:

(cryptography) ~/p/cryptography ❯❯❯ uv build -v --wheel --require-hashes --build-constraint=.github/requirements/build-requirements.txt dist/cryptography-44.0.0.dev1.tar.gz -o wheelhouse
DEBUG uv 0.4.6 (Homebrew 2024-09-05)
DEBUG Found workspace root: `/Users/alex_gaynor/projects/cryptography`
DEBUG Adding current workspace member: `/Users/alex_gaynor/projects/cryptography`
DEBUG Searching for Python >=3.7 in managed installations or system path
DEBUG Found `cpython-3.12.5-macos-aarch64-none` at `/Users/alex_gaynor/.virtualenvs/cryptography/bin/python3` (active virtual environment)
DEBUG Using request timeout of 30s
Building wheel from source distribution...
DEBUG Ignoring empty directory
DEBUG Solving with installed Python version: 3.12.5
DEBUG Solving with target Python version: >=3.12.5
DEBUG Adding direct dependency: maturin>=1, <2
DEBUG Adding direct dependency: maturin==1.7.1
DEBUG Adding direct dependency: cffi{platform_python_implementation != 'PyPy'}>=1.12
DEBUG Adding direct dependency: cffi{platform_python_implementation != 'PyPy'}==1.17.1
DEBUG Adding direct dependency: setuptools<74.0.0 | >74.0.0, <74.1.0 | >74.1.0, <74.1.1 | >74.1.1, <74.1.2 | >74.1.2
DEBUG Adding direct dependency: setuptools==73.0.1
[...]

Happy to test anything that'd be useful.

@charliermarsh charliermarsh added the bug Something isn't working label Sep 7, 2024
@charliermarsh
Copy link
Member

Very strange, let me think about what could be happening here...

@charliermarsh
Copy link
Member

Do you have --no-build-isolation set anywhere, like in a pyproject.toml somewhere? (You could run uv build --show-settings to verify.)

@charliermarsh
Copy link
Member

(Poking around here: https://github.com/charliermarsh/cryptography/pull/1)

@charliermarsh
Copy link
Member

(Confirmed build isolation is not disabled.)

@alex
Copy link
Contributor Author

alex commented Sep 7, 2024

Definitely not intentionally disabled! Thanks for taking a look, let me know how I can help debug this.

@charliermarsh
Copy link
Member

It looks like the builder thinks build isolation is enabled (despite --show-settings not indicating as such) so something's going wrong...

@alex
Copy link
Contributor Author

alex commented Sep 7, 2024

AHHHHH, --no-build-isolation is in the PY_LIMITED_API variable. I assume that's causing this.

@alex
Copy link
Contributor Author

alex commented Sep 7, 2024

And with that removed, it seems to be working now.

So sorry about the noise.

I think turning some of the debug logging you added into proper logging may help future people who are as dumb as I am.

Once again, very sorry.

@charliermarsh
Copy link
Member

No problem at all! Glad it's not a bug at least. Though confused why --show-settings didn't make this clear... Maybe a bug there? I'll add some more logging for this regardless (and close this issue with that PR).

@charliermarsh
Copy link
Member

Oh sorry... Dumb of me. I'm running --show-settings in the first command which doesn't have the env var attached. I will add more logging though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants