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 required #298

Closed
iosonofabio opened this issue Jun 5, 2024 · 4 comments · Fixed by #299
Closed

setuptools required #298

iosonofabio opened this issue Jun 5, 2024 · 4 comments · Fixed by #299

Comments

@iosonofabio
Copy link
Contributor

hi there,

thank you for maintaining this awesome package!

I just installed it in a clean Python 3.12 environment and although the installation did not raise any errors, the package could not be imported afterwards because of missing pkg_resources. The solution is to include setuptools in your list of requirements/dependencies at installation time.

Would be great if you could make the small change adding setuptools to the reqs so that people can enjoy goatools smoothly.

Thanks!

@tanghaibao
Copy link
Owner

@iosonofabio

Thanks for reporting this. What was the command you used to install the package?

Technically, this build dependency was already spelled out in the pyproject.toml:

[build-system]
requires = [
"setuptools",
"setuptools_scm[toml]",
"setuptools_scm_git_archive",
"wheel",
]

@iosonofabio
Copy link
Contributor Author

Here the installation commands:

python -m venv .venv
.venv/bin/pip install goatools
.venv/bin/python -c 'import goatools'

results in:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/fabio/Desktop/tes/.venv/lib/python3.12/site-packages/goatools/__init__.py", line 2, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'

Indeed, when I run the pip install, it does not seem to install setuptools. Could it be that I have setuptools on my global python (1:69.0.3) and it's too old? No minimal version is speficied in pyproject.toml so perhaps that's what's going on?

@tanghaibao
Copy link
Owner

I think you are right. I am not sure what the minimum version should be.
Is 1:69.0.3 the setuptools version on your computer? I have:

python -c "import setuptools; print(setuptools.__version__)"
57.5.0

@iosonofabio
Copy link
Contributor Author

python -c "import setuptools; print(setuptools.__version__)"
69.0.3

... ah gotcha, see #299

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

Successfully merging a pull request may close this issue.

2 participants