Open morganw opened 3 weeks ago
Hi @morganw, please note that any easy-install
solution or python setup.py XXX
CLI commands, are deprecated and no longer receive first class support.
The recommended approach is as follows:
pyproject.toml
file with a [build-system]
table, as documented in the user guide.
[build-system] requires
field (e.g. if you use any non-stdlib library in your setup.py
script.setup.py
script then you also need to manually add the local folder to sys.path
or use build-backend = "setuptools.build_meta:__legacy__"
pip>=23
to install your package using pip install .
There is a old blog post with some extra details about the deprecation https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html.
setuptools version
setuptools==67.8.0
Python version
Python3.11
OS
macOS
Additional environment information
No response
Description
just upgrade my python package with python setup.py install. but find that still link to old version package and find that the version was not deleted from easy-install.pth
looks like setuptools==67.7.2 is ok, but from setuptools==67.8.0, there is an issue in _load_raw method of class PthDistributions:
normalized_path = normalize_path(os.path.join(self.basedir, path)
it maybe should is paths[-1]=normalized_path = normalize_path(os.path.join(self.basedir, path))
the paths is not full path, so, there will be an issue in below find_distributions:
self.paths, self.dirty = self._load() self._init_paths = self.paths[:] super().init([], None, None) for path in yield_lines(self.paths): list(map(self.add, find_distributions(path, True)))
Expected behavior
when upgrade the package, the previous version should be remove from easy-install.pth and can link to the current version
How to Reproduce
Output
Copying test_cli-1.0.28-py3.9.egg to /usr/local/lib/python3.9/site-packages Removing test-cli 1.0.27 from easy-install.pth file Adding test-cli 1.0.28 to easy-install.pth file