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

setuptools requirement #2

Open
Sean-Morrison opened this issue Apr 5, 2024 · 3 comments
Open

setuptools requirement #2

Sean-Morrison opened this issue Apr 5, 2024 · 3 comments
Assignees

Comments

@Sean-Morrison
Copy link
Collaborator

this package has a hidden dependency of setuptools <=66.1.1. With 66.2.0 "pkg_resources is deprecated as an API".

@ajwheeler
Copy link

Just noting that I hit this as well. For others, the error looks like

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/awheeler/Simons Foundation Dropbox/Adam Wheeler/science/rotating_giants/.venv/lib/python3.12/site-packages/sdss_semaphore/__init__.py", line 6, in <module>
    from pkg_resources import resource_filename
ModuleNotFoundError: No module named 'pkg_resources'

@ajwheeler
Copy link

Workaround of uv pip install 'setuptools<=66.1.1' worked.

@Sean-Morrison
Copy link
Collaborator Author

Sean-Morrison commented Oct 17, 2024

the other option seems to be to use importlib

import importlib.resources as resources

try: #python 3.9+
path = resources.files(name).joinpath(f'etc/{self.MAPPING_BASENAME}')
except: #python 3.7 and 3.8
with resources.path(name+'.etc', 'sdss5_target_2_with_groups.csv') as path:
path = str(path)

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

3 participants