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

Missing dependency pkg_resources if installed without pip #183

Open
skeapskeap opened this issue Sep 27, 2024 · 1 comment
Open

Missing dependency pkg_resources if installed without pip #183

skeapskeap opened this issue Sep 27, 2024 · 1 comment

Comments

@skeapskeap
Copy link

skeapskeap commented Sep 27, 2024

Hi.
I just noticed that punq doesn't depend on pkg_resources explicitly. The only thing that hints at this is recommended way of installation using pip.

(.venv) username:~$ python
Python 3.8.20 (default, Sep  9 2024, 22:12:42)
[Clang 18.1.8 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import punq
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/username/.venv/lib/python3.8/site-packages/punq/__init__.py", line 27, in <module>
    from pkg_resources import DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'
@bobthemighty
Copy link
Owner

I think this may have been fixed by the toolchain refresh. Can you confirm on 0.7.1.dev1?

code/play/punq-test via 🐍 v3.12.6 (punq-test) on ☁️  (eu-west-2)
❯ pip install punq==0.7.1.dev1
Collecting punq==0.7.1.dev1
  Downloading punq-0.7.1.dev1-py3-none-any.whl.metadata (5.2 kB)
Downloading punq-0.7.1.dev1-py3-none-any.whl (13 kB)
Installing collected packages: punq
Successfully installed punq-0.7.1.dev1

code/play/punq-test via 🐍 v3.12.6 (punq-test) on ☁️  (eu-west-2)
❯ python
Python 3.12.6 (main, Sep  8 2024, 13:18:56) [GCC 14.2.1 20240805] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import punq
>>> punq
<module 'punq' from '/home/bob/.pyenv/versions/punq-test/lib/python3.12/site-packages/punq/__init__.py'>
>>> c.register("foo", instance="bar")
<punq.Container object at 0x7f242c11f950>
>>> c.resolve("foo")
'bar'

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

2 participants