`python_requires` not written when only `--min-py3-version` is specified
See original GitHub issueSee repro:
def test_guess_python_min_version(tmpdir):
setup_cfg = tmpdir.join('setup.cfg')
setup_cfg.write(
'[metadata]\n'
'name = pkg\n'
'version = 1.0\n',
)
assert main((str(setup_cfg), '--min-py3-version=3.8'))
$ pytest -vvv -k test_guess_python_min_version tests/setup_cfg_fmt_test.py
========================================= test session starts ==========================================
platform darwin -- Python 3.9.15, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /Users/mxr/src/mxr/unkey/venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/mxr/src/asottile/setup-cfg-fmt
collected 67 items / 66 deselected / 1 selected
tests/setup_cfg_fmt_test.py::test_guess_python_min_version FAILED [100%]
=============================================== FAILURES ===============================================
____________________________________ test_guess_python_min_version _____________________________________
tmpdir = local('/private/var/folders/mg/2_7nx7493qg0vn9jhdp951tw0000gp/T/pytest-of-mxr/pytest-10/test_guess_python_min_version0')
def test_guess_python_min_version(tmpdir):
setup_cfg = tmpdir.join('setup.cfg')
setup_cfg.write(
'[metadata]\n'
'name = pkg\n'
'version = 1.0\n',
)
> assert main((str(setup_cfg), '--min-py3-version=3.8'))
E AssertionError: assert 0
E + where 0 = main(('/private/var/folders/mg/2_7nx7493qg0vn9jhdp951tw0000gp/T/pytest-of-mxr/pytest-10/test_guess_python_min_version0/setup.cfg', '--min-py3-version=3.8'))
tests/setup_cfg_fmt_test.py:667: AssertionError
======================================= short test summary info ========================================
FAILED tests/setup_cfg_fmt_test.py::test_guess_python_min_version - AssertionError: assert 0
=================================== 1 failed, 66 deselected in 0.17s ===================================
Issue Analytics
- State:
- Created 9 months ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
setuptools could respect python_requires · Issue #1633 - GitHub
Expected: Command fails with an error explaining that the Python version isn't supported. Some packages workaround this by adding the following ...
Read more >pip ignores python_requires field in setup - Stack Overflow
[metadata] name = mathsom python_requires = '>=3.8' ... Problem is that I created an enviroment with Python 3.7 and installation had no problems ......
Read more >Packaging and distributing projects
python_requires. If your project only runs on certain Python versions, setting the python_requires argument to the appropriate PEP 440 version specifier string ...
Read more >PythonPackage — Spack 0.17.1 documentation
If Python 2.7 is the only version that works, you can use: depends_on('python@2.7:2.8', type=('build', 'run')). The documentation may not always specify ...
Read more >2. The basic structure of a Python package
You can specify version requirements, such as numpy>=1.7 , using the standard pip syntax. If you have a dependency that is not on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yeah the latter probably makes more sense
Going to try to get a PR for this out this week