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

Installing ruff v0.1.9+ with mamba and conda produces ModuleNotFoundError on Linux #9401

Closed
sogoodmo opened this issue Jan 5, 2024 · 10 comments
Labels
bug Something isn't working release Related to the release process

Comments

@sogoodmo
Copy link

sogoodmo commented Jan 5, 2024

Mac - Works
Linux - Fails
Windows - Not tested

  • Importing ruff from mamba or conda on linux based machine and running python file that has import ruff produces ModuleNotFound error.
  • Importing ruff from pip on linux based machines does work
  • Testing with python file that includes only import ruff
  • Installed ruff by doing mamba install ruff==0.1.9 Note: <0.1.8 versions don't produce this error
  • Ruff version installed 0.1.9 py310h3d77a66_0 conda-forge/linux-64

Note:

  • Using ruff in terminal to check a file does work on v0.1.9+ but importing it into my python file doesn't work.
@sogoodmo sogoodmo changed the title Installing ruff v0.1.9+ on mamba produces ModuleNotFoundError on Linux Installing ruff v0.1.9+ from mamba produces ModuleNotFoundError on Linux Jan 5, 2024
@sogoodmo sogoodmo changed the title Installing ruff v0.1.9+ from mamba produces ModuleNotFoundError on Linux Installing ruff v0.1.9+ with mamba and conda produces ModuleNotFoundError on Linux Jan 5, 2024
@charliermarsh
Copy link
Member

Interesting, need to see what changed here... The only thing I can see that possibly touched the release between v0.1.8 and v0.1.9 is #9031, but I don't see how it would've led to this error. Could something have changed in the conda-forge setup?

@charliermarsh
Copy link
Member

Hmm, no, nothing changed between those releases in https://github.com/conda-forge/ruff-feedstock.

@charliermarsh
Copy link
Member

Does python -m ruff work? I assume not.

@charliermarsh charliermarsh added release Related to the release process bug Something isn't working labels Jan 5, 2024
@sogoodmo
Copy link
Author

sogoodmo commented Jan 5, 2024

Does python -m ruff work? I assume not.

Nope it doesn't :(.

@konstin
Copy link
Member

konstin commented Jan 5, 2024

The problem is that in the new release, the ruff folder isn't installed into the site-packages anymore, while the dist-info still is. In the env site-packages:

$ micromamba install ruff==0.1.8
$ ls
_distutils_hack  distutils-precedence.pth  pip  pip-23.3.2-py3.12.egg-info  pkg_resources  README.txt  ruff  ruff-0.1.8.dist-info  setuptools  setuptools-69.0.3-py3.12.egg-info  wheel  wheel-0.42.0.dist-info
$ micromamba install ruff==0.1.9
$ ls
_distutils_hack  distutils-precedence.pth  pip  pip-23.3.2-py3.12.egg-info  pkg_resources  README.txt  ruff-0.1.9.dist-info  setuptools  setuptools-69.0.3-py3.12.egg-info  wheel  wheel-0.42.0.dist-info

I assume this is a conda bug since there is no , but it's hard to even find out the correct build commands to verify a regression.

@sogoodmo
Copy link
Author

sogoodmo commented Jan 5, 2024

Ah so is this not a ruff issue, but rather a conda bug?

And is it just a coincidence that 0.1.9 has #9188 as a breaking change and the problem is related to ruff not being found in the site-packages?

@konstin
Copy link
Member

konstin commented Jan 5, 2024

It's either a bug in the conda feedstock or in conda itself, i'm not a conda expert though; We build the wheel as basis for the conda package and we know that the wheel version works.

@sogoodmo
Copy link
Author

Hey just updating, there is an open issue conda-forge/ruff-feedstock#153 here detailing the same problem

@sogoodmo
Copy link
Author

Update: This issue seems to be fixed with 0.1.13 version. We can close this.

ruff-9-bad
ruff-13-good

@charliermarsh
Copy link
Member

Good to hear, thanks for reporting back!

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

No branches or pull requests

3 participants