Skip to content

Commit

Permalink
Fixed issues with old python versions and pytest cases using type hin…
Browse files Browse the repository at this point in the history
…ts in its `_version.py` file generated by setuptools_scm
  • Loading branch information
Sylvain MARIE committed Mar 15, 2024
1 parent 561913c commit a587929
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
30 changes: 15 additions & 15 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@
(PY38, "pytest-latest"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": ""}},
# python 2.7
(PY27, "pytest3.x"): {"coverage": False, "pkg_specs": {"pip": ">10", "pytest": "<4", "pytest-asyncio": DONT_INSTALL}},
(PY27, "pytest4.x"): {"coverage": False, "pkg_specs": {"pip": ">10", "pytest": "<5", "pytest-asyncio": DONT_INSTALL}},
(PY27, "pytest4.x"): {"coverage": False, "pkg_specs": {"pip": ">10", "pytest": "<5", "pytest-cases": "<3.7", "pytest-asyncio": DONT_INSTALL}},
# python 3.5
(PY35, "pytest3.x"): {"coverage": False, "pkg_specs": {"pip": ">10", "pytest": "<4", "pytest-asyncio": DONT_INSTALL}},
(PY35, "pytest4.x"): {"coverage": False, "pkg_specs": {"pip": ">10", "pytest": "<5", "pytest-asyncio": DONT_INSTALL}},
(PY35, "pytest5.x"): {"coverage": False, "pkg_specs": {"pip": ">10", "pytest": "<6"}},
(PY35, "pytest3.x"): {"coverage": False, "pkg_specs": {"pip": ">10", "pytest": "<4", "pytest-cases": "<3.7", "pytest-asyncio": DONT_INSTALL}},
(PY35, "pytest4.x"): {"coverage": False, "pkg_specs": {"pip": ">10", "pytest": "<5", "pytest-cases": "<3.7", "pytest-asyncio": DONT_INSTALL}},
(PY35, "pytest5.x"): {"coverage": False, "pkg_specs": {"pip": ">10", "pytest": "<6", "pytest-cases": "<3.7"}},
# python 3.6
(PY36, "pytest3.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<4"}},
(PY36, "pytest4.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<5"}},
(PY36, "pytest5.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<6"}},
(PY36, "pytest6.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<7"}},
(PY36, "pytest-latest"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": ""}},
(PY36, "pytest3.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<4", "pytest-cases": "<3.7"}},
(PY36, "pytest4.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<5", "pytest-cases": "<3.7"}},
(PY36, "pytest5.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<6", "pytest-cases": "<3.7"}},
(PY36, "pytest6.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<7", "pytest-cases": "<3.7"}},
(PY36, "pytest-latest"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "", "pytest-cases": "<3.7"}},
# python 3.7
(PY37, "pytest3.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<4"}},
(PY37, "pytest4.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<5"}},
(PY37, "pytest5.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<6", "pytest-asyncio": DONT_INSTALL}},
(PY37, "pytest6.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<7"}},
(PY37, "pytest7.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<8"}},
(PY37, "pytest-latest"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": ""}},
(PY37, "pytest3.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<4", "pytest-cases": "<3.7"}},
(PY37, "pytest4.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<5", "pytest-cases": "<3.7"}},
(PY37, "pytest5.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<6", "pytest-cases": "<3.7", "pytest-asyncio": DONT_INSTALL}},
(PY37, "pytest6.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<7", "pytest-cases": "<3.7"}},
(PY37, "pytest7.x"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": "<8", "pytest-cases": "<3.7"}},
# (PY37, "pytest-latest"): {"coverage": False, "pkg_specs": {"pip": ">19", "pytest": ""}},
# IMPORTANT: this should be last so that the folder docs/reports is not deleted afterwards
(PY311, "pytest-latest"): {"coverage": True, "pkg_specs": {"pip": ">19", "pytest": ""}},
}
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ tests_require =
numpy
pandas
tabulate
pytest-cases>=2.3.0,<3.7
pytest-cases>=2.3.0
# for some reason these pytest dependencies were not declared in old versions of pytest
six;python_version<'3.6'
attr;python_version<'3.6'
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
setup(
download_url=DOWNLOAD_URL,
use_scm_version={
"version_file": "pytest_harvest/_version.py",
"write_to": "pytest_harvest/_version.py",
# Custom template to avoid type hints and annotations (python <3.8)
"version_file_template": """# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '{version}'
__version_tuple__ = version_tuple = {version_tuple}
"""
# "version_file_template": """# file generated by setuptools_scm
# # don't change, don't track in version control
# __version__ = version = '{version}'
# __version_tuple__ = version_tuple = {version_tuple}
# """
}, # we can't put `use_scm_version` in setup.cfg yet unfortunately
)

0 comments on commit a587929

Please sign in to comment.