jquast / telnetlib3

Python Telnet server and client Protocol library using asyncio
Other
147 stars 32 forks source link

Missing setuptools in requirements list #79

Closed jtilahun closed 1 year ago

jtilahun commented 1 year ago

When running a unit test that imports telnetlib3, the unit test runs fine when ran directly under Pytest (./venv/bin/pytest), but fails when ran under Pants (./pants test). Importing telnetlib3 within Pants errors outs saying that there's no module named pkg_resources. Adding the below snippet to the Pants build file:

        "telnetlib3": {
            "dependencies": [
                ":reqs#setuptools",
            ],
        },

is the only way to successfully import telnetlib3 within Pants. This seems to indicate missing dependencies in the telnetlib3 requirements list. Namely, it seems that setuptools is missing in the requirements list.

jquast commented 1 year ago

putting setuptools in the requirements is a bad idea, it can cause pip to upgrade setuptools while it is being used, and causes a mixed version of setuptools already in memory and the version installed on disk, any installation of setuptools should be done only on its own as a single step, it and can lead to inexplicable build and install errors further down the line when installed with a group of other packages.

I will just remove any use of pkg_resources entirely, it requires remembering to manually modify the version number in the python files in addition to the setup.py file. https://github.com/jquast/telnetlib3/blob/309b5d0a207e1509ebc8027f2471aa280c2d5024/telnetlib3/accessories.py#L21

jquast commented 1 year ago

Please try latest release 2.0.4, this should resolve your issue.