From f489660925fc5500debe9ab37cfc2d516f8cbba1 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Wed, 30 Nov 2022 19:21:06 +0000 Subject: [PATCH] Test with minimum versions of requirements Pick 1.8.1 as the minimum version of argcomplete. This is the version in the current Debian oldstable and Ubuntu 20.04 LTS. --- .github/workflows/build.yml | 7 +++++-- pytest-minreqs.ini | 4 ++++ requirements-min.txt | 6 ++++++ requirements.txt | 2 +- tox.ini | 8 +++++--- 5 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 pytest-minreqs.ini create mode 100644 requirements-min.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 386b7d97..dd453758 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,11 +20,14 @@ jobs: strategy: matrix: python-version: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" + toxenv: [py] + include: + - python-version: "3.7" + toxenv: minreqs steps: - name: Install OS dependencies @@ -69,7 +72,7 @@ jobs: - name: Run tests run: | python -m hatchling build -t sdist --hooks-only - python -m tox -e py + python -m tox -e ${{ matrix.toxenv }} - name: Report to coveralls run: coveralls diff --git a/pytest-minreqs.ini b/pytest-minreqs.ini new file mode 100644 index 00000000..09c5d952 --- /dev/null +++ b/pytest-minreqs.ini @@ -0,0 +1,4 @@ +# This file is needed until minimum bs4 >= 4.11 +[pytest] +testpaths = tests +addopts = -ra --tb=short diff --git a/requirements-min.txt b/requirements-min.txt new file mode 100644 index 00000000..ce6b6701 --- /dev/null +++ b/requirements-min.txt @@ -0,0 +1,6 @@ +# required: +beautifulsoup4 == 4.8.1 +requests == 2.4.0 +dnspython == 2.0.0 +# optional: +argcomplete == 1.8.1 diff --git a/requirements.txt b/requirements.txt index 9774675f..b65656f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ beautifulsoup4 >= 4.8.1 requests >= 2.4 dnspython >= 2.0 # optional: -argcomplete +argcomplete >= 1.8.1 diff --git a/tox.ini b/tox.ini index 55651d31..c4a414a9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37, py38, py39, py310, py311 +envlist = py3{7,8,9,10,11}, minreqs [base] deps = @@ -15,10 +15,12 @@ deps = [testenv] usedevelop = true deps = - -rrequirements.txt + !minreqs: -rrequirements.txt + minreqs: -rrequirements-min.txt {[base]deps} commands = - pytest {posargs:--cov=linkcheck} + !minreqs: pytest {posargs:--cov=linkcheck} + minreqs: pytest {posargs:--cov=linkcheck -c pytest-minreqs.ini} setenv = LC_ALL=en_US.utf-8