On Sun, 2021-04-11 at 00:59 +0000, Vincent Pelletier wrote:
Thanks for the pointer, I would love to use it. Unfortunately, this fails to install on 2.7: with install_requires=( "importlib_resources<=4.0.0;python_version<'3.0'", "importlib_resources;python_version>='3.0' and python_version<'3.7'", ),
My bad: 4.0.0 was the first version *without* py2.7 support, so this was supposed to be: install_requires=( "importlib_resources<4.0.0;python_version<'3.0'", "importlib_resources;python_version>='3.0' and python_version<'3.7'", ), Somehow this does not seem to make a difference. Maybe the last wheel for 2.7 being the last supported version was making my bogus dependency accidentally work (for as far as importlib_resources version itself is concerned, so ignoring the zipp error). On Sun, 11 Apr 2021 09:26:47 +0800, Tzu-ping Chung <uranusjr@gmail.com> wrote:
“setup.py install” is pretty ancient at this point and lacks many of the remotely modern packaging syntax.
I’d strongly advise to ignore it entirely. Use “pip install .” instead.
Indeed: $ rm -r vpy2 $ virtualenv -p /usr/bin/python2 vpy2 created virtual environment CPython2.7.18.final.0-64 in 90ms creator CPython2Posix(dest=/home/vincent/git/python-libusb1/vpy2, clear=False, no_vcs_ignore=False, global=False) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/vincent/.local/share/virtualenv) added seed packages: pip==20.3.4, pkg_resources==0.0.0, setuptools==44.1.1, wheel==0.34.2 activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator $ ./vpy2/bin/python setup.py install [...] Installed /home/vincent/git/python-libusb1/vpy2/lib/python2.7/site-packages/importlib_resources-3.3.1-py2.7.egg Searching for zipp>=0.4 Reading https://pypi.org/simple/zipp/ Downloading https://files.pythonhosted.org/packages/38/f9/4fa6df2753ded1bcc1ce2fdd8046f7... Best match: zipp 3.4.1 Processing zipp-3.4.1.tar.gz Writing /tmp/easy_install-kLJx7K/zipp-3.4.1/setup.cfg Running zipp-3.4.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-kLJx7K/zipp-3.4.1/egg-dist-tmp-10cETE DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. error: find_namespace: directive is unsupported on Python < 3.3 But (with --no-cache-dir just in case cached versions would influence version choice): $ rm -r vpy2 $ virtualenv -p /usr/bin/python2 vpy2 created virtual environment CPython2.7.18.final.0-64 in 91ms creator CPython2Posix(dest=/home/vincent/git/python-libusb1/vpy2, clear=False, no_vcs_ignore=False, global=False) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/vincent/.local/share/virtualenv) added seed packages: pip==20.3.4, pkg_resources==0.0.0, setuptools==44.1.1, wheel==0.34.2 activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator $ ./vpy2/bin/pip install --no-cache-dir . [...] Collecting zipp>=0.4; python_version < "3.8" Downloading zipp-1.2.0-py2.py3-none-any.whl (4.8 kB) [...] Successfully installed contextlib2-0.6.0.post1 importlib-resources-3.3.1 libusb1-1.9.2+4.g452c3e9.dirty pathlib2-2.3.5 scandir-1.10.0 singledispatch-3.6.1 six-1.15.0 typing-3.7.4.3 zipp-1.2.0 pip is choosing 1.2.0 while setup.py install is choosing 3.4.1 . -- Vincent Pelletier GPG fingerprint 983A E8B7 3B91 1598 7A92 3845 CAC9 3691 4257 B0C1