Skip to content

Commit

Permalink
setup.py: update dependencies and metadata
Browse files Browse the repository at this point in the history
* Add python_requires metadata. The latest pyroma does check for its
  presence and it makes sense to add it to prevent from installing
  the package on the wrong Python version.
* Revert old upper limit for GitPython, there are no more issue with
  more recent versions.
* Set an upper limit for pylint and prospector. A change in pylint broke
  prospector, but we can't upgrade prospector because of an upstream
  bug, see:
  landscapeio/prospector#545
* Split the python auto-formatter test dependencies on their own extra
  group so that they can be installed alone in the already split virtual
  environment for the tox envs py3-style and py3-format.
  This way there are no conflicts between other test dependencies and
  black and isort.
* Add specific style tox environments for each Python version to avoid
  the CI jobs to pick Python 3.7 that has a pip backtracking issue with
  the latest versions of the dependencies. Keep the py3-{style,format}
  environments for ease of use locally and to not break compatibility
  but make the py3-style one not run automatically in CI.

Change-Id: I6ce05223df3bf17e269994ee7501ec16e35c76dd
  • Loading branch information
volans- committed Dec 2, 2022
1 parent 5e4fe74 commit b60a710
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions setup.py
Expand Up @@ -12,8 +12,7 @@
"dnspython>=1.16.0,<2.2.0", # Temporary upper limit to prevent mypy failures
"elasticsearch>=5.0.0,<7.15.0",
"elasticsearch-curator>=5.0.0",
# TODO: gitpython 3.1.15 causes issues with mypy
"gitpython<=3.1.14",
"gitpython>=3.1.14",
"kafka-python>=1.4.3",
"kubernetes==12.0.*", # frozen to the version available on debian bullseye
"pymysql>=0.9.3",
Expand All @@ -28,9 +27,7 @@
# Test dependencies
"tests": [
"bandit>=1.5.1",
"black<=21.12b0", # this is needed so that it doesn't confict with curator
"flake8>=3.6.0",
"isort",
"mypy>=0.670",
"pytest-cov>=2.6.0",
"pytest-xdist>=1.26.1",
Expand All @@ -48,8 +45,13 @@
"types-requests",
"types-setuptools",
],
"format": [
"black<=21.12b0", # this is needed so that it doesn't confict with curator
"isort",
],
"prospector": [
"prospector[with_everything]>=0.12.4",
"prospector[with_everything]>=0.12.4,<=1.7.7", # Temporary upper limit for an upstream regression
"pylint<2.15.7", # Temporary upper limit for a change that breaks prospector that can't be upgraded
"pytest>=3.10.1",
"requests-mock>=1.5.2",
],
Expand Down Expand Up @@ -91,6 +93,7 @@
package_data={"spicerack": ["py.typed"]},
packages=find_packages(exclude=["*.tests", "*.tests.*"]),
platforms=["GNU/Linux"],
python_requires=">=3.9",
setup_requires=SETUP_REQUIRES,
use_scm_version=True,
url="https://github.com/wikimedia/operations-software-spicerack",
Expand Down
13 changes: 8 additions & 5 deletions tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 3.10.0
envlist = py{39,310}-{flake8,unit,bandit,mypy,prospector,sphinx},py3-style
envlist = py{39,310}-{flake8,unit,bandit,mypy,prospector,sphinx},py{39,310}-style
skip_missing_interpreters = True


Expand All @@ -22,9 +22,10 @@ description =
py310: (Python 3.10)
envdir =
prospector: {toxworkdir}/{envname}
!py3-style: {toxworkdir}/{envname}
py3: {toxworkdir}/py3-tests
py39-!prospector: {toxworkdir}/py39-tests
py310-!prospector: {toxworkdir}/py310-tests
py39-!prospector-!style: {toxworkdir}/py39-tests
py310-!prospector-!style: {toxworkdir}/py310-tests
commands =
flake8: flake8 setup.py spicerack
style: {toxinidir}/utils/check-style.sh
Expand All @@ -45,7 +46,9 @@ commands =
sphinx: sed -i='' -e 's/^\.B/.B /' '{toxinidir}/doc/build/man/cookbook.1'
deps =
# Use install_requires and the additional extras_require[tests/prospector] from setup.py
style: .[format]
format: .[format]
prospector: .[prospector]
!prospector: .[tests]
!prospector-!style-!format: .[tests]

[testenv:py3-format]
[testenv:py3-{format,style}]

0 comments on commit b60a710

Please sign in to comment.