fix requires handling when using setup.cfg#1108
Conversation
|
Any comments on this? I'd love to get this merged. |
|
Wow, quite a bit of work went into the tests refactor. I can see why you went there - wanting to extract the commonality of all the tests. I'm pretty sure pytest_generate_tests has been superseded by parametrized fixtures, but that can be transformed later if needed. The main concern I have about the refactoring is what does it do for the output? Is it still possible, for example, to select just one test to run? Is it still clear which test is being performed? I'm also slightly concerned about the I do like that the code seems to be more consolidated with this change. It does still feel a little uneasy that If you're comfortable with the change being stable and addressed any concerns above to your satisfaction, would you add a CHANGELOG entry and then cut a release (release docs are in the repo)? |
This seemed to be the simplest way to parametrize those tests while still keeping the code in-class. But I agree it could become unwieldily if multiple methods are parametrized using the same mechanism. Would this be better?
Yes, that where the > python -m pytest --collect-only -qk test_requires
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_marker]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_marker_in_setup_cfg]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_extra]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_extra_in_setup_cfg]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_extra_and_marker]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_extra_and_marker_in_setup_cfg]
=========================== short test summary info ============================
SKIP [2] /home/bpierre/progs/src/setuptools/setuptools/tests/test_msvc.py:17: could not import 'distutils.msvc9compiler'
============================= 293 tests deselected =============================
2 skipped, 293 deselected in 0.65 seconds
> python -m pytest --collect-only -qk install_requires
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_marker]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_marker_in_setup_cfg]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_extra]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_extra_in_setup_cfg]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_extra_and_marker]
setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[install_requires_with_extra_and_marker_in_setup_cfg]
=========================== short test summary info ============================
SKIP [2] /home/bpierre/progs/src/setuptools/setuptools/tests/test_msvc.py:17: could not import 'distutils.msvc9compiler'
============================= 293 tests deselected =============================
2 skipped, 293 deselected in 0.64 seconds
Yeah, I could not find a way to mark a test by name. |
6b4525b to
096f328
Compare
|
OK, I went ahead with the switch to |
|
Just tested this fix in setuptools 36.2.7 and it seems to work: I can now generate a wheel for Prequ with correct environment markers (with out-of-the-box setuptools and wheel packages). Thanks a lot! 😄 |
If the wheel is generated with older setuptools it will have incorrect requirements for Python 3, since some of the requirements use environment markers and there was a problem with those in older versions of the setuptools. See pypa/setuptools#1081 and pypa/setuptools#1108 for details.
Fix #1105.