youknowone / wirerope

https://pypi.org/project/wirerope/
Other
6 stars 5 forks source link

Fix setuptools version parsing. #17

Closed jsirois closed 2 years ago

jsirois commented 2 years ago

This eliminates the need to do it by modernizing and ensuring a minimum setuptools via PEP-517 / PEP-518, but the check is kept and made robust for those who might still want to run python setup.py (instead of pip install . which will use the pyproject.toml and ensure the setuptools build dependency is up to date).

Fixes #8

jsirois commented 2 years ago

I tested this back to setuptools 1:

$ pip -qq install setuptools==1
$ python setup.py 
Traceback (most recent call last):
  File "setup.py", line 9, in <module>
    e
AssertionError: Please upgrade setuptools by `pip install -U setuptools`: (setuptools 1.0 (/home/jsirois/.venv/test/lib/python2.7/site-packages), Requirement.parse('setuptools>=39.2.0'))

$ pip -qq install "setuptools>=39.2.0"
$ python setup.py 
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

$ pip -qq install "setuptools==39.2.0"
$ python setup.py 
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

$ pip -qq install "setuptools==39.1.0"
$ python setup.py 
Traceback (most recent call last):
  File "setup.py", line 9, in <module>
    e
AssertionError: Please upgrade setuptools by `pip install -U setuptools`: (setuptools 39.1.0 (/home/jsirois/.venv/test/lib/python2.7/site-packages), Requirement.parse('setuptools>=39.2.0'))
codecov[bot] commented 2 years ago

Codecov Report

Merging #17 (605caae) into master (81c533d) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #17   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files           7        7           
  Lines         309      309           
=======================================
  Hits          304      304           
  Misses          5        5