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

Python version mismatch only installs non-dev dependencies #1139

Open
my1e5 opened this issue Jun 5, 2024 · 0 comments
Open

Python version mismatch only installs non-dev dependencies #1139

my1e5 opened this issue Jun 5, 2024 · 0 comments

Comments

@my1e5
Copy link
Contributor

my1e5 commented Jun 5, 2024

Usually, when working on my rye-managed projects, if I change the .python-version I always run rye sync afterwards and all is fine.

But if I don't run rye sync things are also usually fine. It will detect a Python version mismatch and re-initialise the virtualenv.

Until I came across this error. If I change the .python-version and then immediately run a command such a rye run mypy . - where mypy is one of my dev-dependencies in my pyproject.toml. It will detect the Python version mismatch but it seems to only install the non-dev dependencies.

❯ rye run mypy .
Python version mismatch (found [email protected], expected [email protected]), recreating.
Initializing new virtualenv in C:\Users\my1e5\Projects\Research\Python\.venv
Python version: [email protected]
Generating production lockfile: C:\Users\my1e5\Projects\Research\Python\requirements.lock
Generating dev lockfile: C:\Users\my1e5\Projects\Research\Python\requirements-dev.lock
Installing dependencies
   Built file:///C:/Users/my1e5/Projects/Research/Python
Built 1 editable in 1.22s
Installed 7 packages in 2.42s
 + attrs==23.2.0
 + cffi==1.16.0
 + myproject==0.2.0 (from file:///C:/Users/my1e5/Projects/Research/Python)
 + numpy==1.26.4
 + pycparser==2.22
 + scipy==1.13.1
 + soundfile==0.12.1
error: invalid or unknown script 'mypy'

It didn't install mypy. Those packages are all my normal dependencies. It didn't install any dev dependencies.

The reason I found this out is because it's causing my CI workflow to fail - eifinger/setup-rye#263

Is there a reason why dev-dependencies aren't installed in this case? Is it a bug?

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

1 participant