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

Remove unused dependencies #3515

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

cjwatson
Copy link
Contributor

setuptools and cffi still appear to be indirect dependencies, but there's no need to depend on them directly when they aren't used directly.

@ktbyers
Copy link
Owner

ktbyers commented Oct 24, 2024

PY3.12 and later requires setuptools to be installed:

TDAmeritrade/stumpy#950

cffi I would need to research.

@ktbyers
Copy link
Owner

ktbyers commented Oct 24, 2024

Things break without setuptools...for example:

  File "/home/runner/.cache/pypoetry/virtualenvs/netmiko-Jn__E6G5-py3.12/lib/python3.12/site-packages/pylama/lint/__init__.py", line 10, in <module>
    from pkg_resources import iter_entry_points
ModuleNotFoundError: No module named 'pkg_resources'

Yes, you could say this isn't a direct Netmiko dependency, but there isn't really a case where I don't want setuptools (it is just a pain without it).

`setuptools` and `cffi` still appear to be indirect dependencies, but
there's no need to depend on them directly when they aren't used
directly.

`setuptools` still needs to be a development dependency to work around
klen/pylama#249.
@cjwatson
Copy link
Contributor Author

That seems to be klen/pylama#249 (pylama has had no commits at all for two years, so seems to have become unmaintained). A possibility would be to move setuptools to a development dependency; I've pushed an update to try that.

I can see that if all you do is run netmiko from a poetry environment then this doesn't really make much difference. But if you're installing it from a wheel in some other way, then setuptools isn't intrinsically needed (aside from uses of pkg_resources that are deprecated nowadays, it should only be needed for the sdist → wheel step), and it's cleaner to avoid the install-time requirement if possible. We've been trying to start cleaning this sort of thing up in Debian packaging recently, although there's certainly a lot to do since historically a lot of people just slapped in install_requires=["setuptools"] without really thinking about it.

@ktbyers
Copy link
Owner

ktbyers commented Oct 25, 2024

Yes, I can get rid of pylama, but I am pretty adverse to needing to fix my CI-CD because Python decided to remove setuptools (and PY3.9 - PY3.11 would still have it installed internally i.e. it is not a rush to fix this in Netmiko).

@ktbyers
Copy link
Owner

ktbyers commented Oct 25, 2024

Also, I invariably run into issues whenever setuptools isn't there (so I basically now pip install setuptools as a first step after making a virtual environment).

But your needs and my needs are a bit at odds here...i.e. I get a lot of pain at all the breakage this causes and issues it creates (even when it is not directly Netmiko, but other dependencies).

I will think about the dev dependency option as that might be a good middle ground.

@ktbyers ktbyers merged commit 544e2f5 into ktbyers:develop Oct 31, 2024
20 checks passed
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 this pull request may close these issues.

2 participants