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

Unable to install pynacl==1.4.0 #1906

Closed
srxavi opened this issue Feb 23, 2024 · 4 comments · Fixed by #1933
Closed

Unable to install pynacl==1.4.0 #1906

srxavi opened this issue Feb 23, 2024 · 4 comments · Fixed by #1933
Assignees
Labels
compatibility Compatibility with a specification or another tool

Comments

@srxavi
Copy link

srxavi commented Feb 23, 2024

When executing uv pip install pynacl==1.4.0 i get the following ouptut:

Resolved 4 packages in 2.33s
error: Failed to download distributions
  Caused by: Failed to fetch wheel: pynacl==1.4.0
  Caused by: Failed to build: pynacl==1.4.0
  Caused by: Invalid pyproject.toml
  Caused by: TOML parse error at line 3, column 12
  |
3 | requires = [
  |            ^^^^^^^^^^^^
Expected a valid marker name, found 'python_implementation'
cffi>=1.4.1; python_implementation != 'PyPy'

Platform: MacOS Sonoma 14.3.1 on M2 Pro
Version: 0.1.9

@konstin
Copy link
Member

konstin commented Feb 23, 2024

The pyproject.toml in is not spec compliant, it's platform_python_implementation not python_implementation. This is a legacy value that is supported by some python tooling outside the spec, we could consider supporting it too.

[build-system]
# Must be kept in sync with `setup_requirements` in `setup.py`
requires = [
    "setuptools>=40.8.0",
    "wheel",
    "cffi>=1.4.1; python_implementation != 'PyPy'",
]
build-backend = "setuptools.build_meta"

The error message is unfortunately misplaced, but that seems like a serde or toml bug.

@konstin konstin added the compatibility Compatibility with a specification or another tool label Feb 23, 2024
@charliermarsh
Copy link
Member

@konstin - Do you have a reference that we can include for python_implementation?

@konstin
Copy link
Member

konstin commented Feb 23, 2024

There's two compatibility layers: The more popular one, https://peps.python.org/pep-0345/#environment-markers

This one comes from pypa/packaging#72 / https://github.com/pypa/packaging/pull/73/files though, which is now just https://github.com/pypa/packaging/blob/7bcd6d8ec33f0a614f9d017d31be4b50ece1549a/src/packaging/_parser.py#L326-L330

As usual, i advocate for emitting a warning when we install such as a package, so that this can be fixed upstream.

@alex
Copy link
Contributor

alex commented Feb 23, 2024

Huh. TIL. I'll send PRs to our packages to use platform_python_implementation.

charliermarsh added a commit that referenced this issue Feb 23, 2024
## Summary

Like `platform.python_implementation`, we should support the
`python_implementation` "alias" for `platform_python_implementation`.

Closes #1906.

## Test Plan

```shell
❯ cargo run pip install "pynacl==1.4.0"
    Finished dev [unoptimized + debuginfo] target(s) in 7.02s
     Running `target/debug/uv pip install pynacl==1.4.0`
Resolved 4 packages in 9ms
   Built pynacl==1.4.0                                                                                                                                                                                                                        Downloaded 1 package in 31.51s
Installed 4 packages in 3ms
 + cffi==1.16.0
 + pycparser==2.21
 + pynacl==1.4.0
 + six==1.16.0
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants