Closed darrencl closed 2 weeks ago
Looks like an outdated setuptools
is being used (Python 2 compatibility via six
was removed in v47.0.0). Could you share the contents of your in- and outfiles?
Hi @chrysle ,
Thanks for getting back to this quickly!
In relation to my setuptools
it seems to use the updated version unless somehow.
(suspect312) darren@darren-Latitude-7490:~/project/mrspectroproc$ python -m pip show setuptools
Name: setuptools
Version: 70.1.1
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://github.com/pypa/setuptools
Author:
Author-email: Python Packaging Authority <distutils-sig@python.org>
License:
Location: /home/darren/anaconda3/envs/suspect312/lib/python3.12/site-packages
Requires:
Required-by: pip-tools
I had a fiddle with this after submitting this issue and this now strangely works for me. If I remember correctly, what I did was uninstalling the pip-tools in the conda base environment. I am not sure how is that related though, since the error was clearly from the "/home/darren/anaconda3/envs/suspect312/bin/pip-compile"
, not the base environment path. It might be something else I did, I couldn't remember clearly.
However, I can confirm I did update the setuptools (i.e., python -m pip install -U setuptools
) as well and still had issues. As you can see, I submitted this issue at 11.31AM (GMT+7) and my setuptools was updated at 10.31AM (coincidentally, the difference is exactly 1 hour! :smile:) .
In [11]: for dist in distributions():
...: if dist.metadata["Name"] == "setuptools":
...: print("%s %s: %s" % (dist.metadata["Name"], dist.version, time.ctime(os.path.getctime(dist._path))))
...:
setuptools 70.1.1: Thu Jun 27 10:31:33 2024
In [12]: time.ctime()
Out[12]: 'Thu Jun 27 14:55:38 2024'
My setup.py
is a standard one with install_requires
and extras_require
.
Anyway, I have always been using pip-compile
for this package, but it was a couple of years back since I updated all dependencies, including pip-tools
, and then I got this weird error despite updating setuptools
.
I think I will close this for now since I don't have this issue anymore.
Environment Versions
$ python -V
Python 3.12.4$ pip --version
24.1.1$ pip-compile --version
7.4.1Steps to replicate
My package has both
requirements.txt
andrequirements_dev.txt
. Here is what I did:setup.py
pip-compile setup.py --extra dev -o requirements_dev.txt
When I did that, below error shows up, which I think is related to click package.
This, however, will not happen if I supply a new output file (e.g.,
test_req_dev.txt
). For example, below command will run just fine.I am unsure if this is an intended behavior. If so, the error should be handled to produce clearer error message to user.
Expected result
Overwrite
requirements_dev.txt
with an updated version.Actual result
Error with
click