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

Pixi updates python without being asked #1193

Closed
2 tasks done
liquidcarbon opened this issue Apr 14, 2024 · 6 comments · Fixed by #1201
Closed
2 tasks done

Pixi updates python without being asked #1193

liquidcarbon opened this issue Apr 14, 2024 · 6 comments · Fixed by #1201
Labels
🐞 bug Something isn't working

Comments

@liquidcarbon
Copy link
Contributor

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

From empty folder with minimal pyproject.toml
Windows shown here, same on Linux.

[project]
name = "test"
description = "Minimal pyproject.toml with minimal [tool.pixi] section."

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64"]
PS C:\Users\a\py> pixi add python=3.11
✔ Added python=3.11
PS C:\Users\a\py> pixi run python -VV
Python 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:40:50) [MSC v.1937 64 bit (AMD64)]


PS C:\Users\a\py> pixi add numpy
✔ Added numpy
PS C:\Users\a\py> pixi run python -VV
Python 3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:42:31) [MSC v.1937 64 bit (AMD64)]

Final pyproject.toml becomes:

[project]
name = "test"
description = "Minimal pyproject.toml with minimal [tool.pixi] section."

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64"]

[tool.pixi.dependencies]
python = "3.11.*"
numpy = ">=1.26.4,<1.27"

Issue description

Pixi updates python to latest without being asked to do so

Expected behavior

Keep python what it was

@liquidcarbon liquidcarbon added the 🐞 bug Something isn't working label Apr 14, 2024
@tdejager
Copy link
Contributor

Yes, I can definitely reproduce, even with the following toml:

[project]
name = "test"
description = "Minimal pyproject.toml with minimal [tool.pixi] section."

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["osx-arm64"]

[tool.pixi.dependencies]
python = ">=3.11,<3.12"
numpy = ">=1.26.4,<1.27"

and just running pixi install I get a 3.12 version.

Adding a requires-python = "<3.12", seems to constrain python again. I haven't investigated but, I think it's adding a default when the requires-python is missing that overwrites the explicit dependency. @olivier-lacroix might be interesting for you as well :)

@liquidcarbon
Copy link
Contributor Author

with requires-python I had different troubles:

these
==3.11
==3.11.*
~=3.11
not sure but possibly ">=3.11,<3.12" as well

all gave me 3.11.0 instead of 3.11.8

@olivier-lacroix
Copy link
Contributor

Hum. Currently, if there is no requires_python, a conda python dependency is added to the manifest (without any version specifier). My hypothesis was that the solver would provide the version that matched all predicates: is that incorrect?

@liquidcarbon
Copy link
Contributor Author

It would probably make sense in the absence of "requires-python" to fall back to what's in tool.pixi ?

@olivier-lacroix
Copy link
Contributor

Definitely. The intent was to take both into account, letting the solver do the hard job

@wolfv
Copy link
Member

wolfv commented Apr 16, 2024

I started on some improvements in #1201 - would be happy to hear your opinions :)

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.

4 participants