Skip to content

Commit

Permalink
setup.cfg: require minimum versions of dependencies
Browse files Browse the repository at this point in the history
This fixes issues where an old version of requirements are cached on a
users system, causing build to break on install. Testing by manually
loading old versions of packages in tox.

Co-authored-by: Bernát Gábor <[email protected]>
Co-authored-by: layday <[email protected]>
  • Loading branch information
3 people committed Mar 30, 2021
1 parent 2c1da83 commit bb8878c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ jobs:
- name: Run test suite via wheel
run: tox -e ${{env.BASE}}-wheel --skip-pkg-install

- name: Run minimum version test
run: tox -e ${{env.BASE}}-min

- name: Rename coverage report file
run: |
import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['BASE']), '.tox/coverage.xml')
Expand Down
7 changes: 5 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ Changelog
+++++++++


0.3.2 (XX-XX-2021)
==================
Unreleased
==========

- Validate that the supplied source directory is valid (`PR #260`_, Fixes `#259`_)
- Set and test minimum versions of build's runtime dependencies (`PR #267`_, Fixes `#263`_)

.. _PR #267: https://github.com/pypa/build/pull/260
.. _PR #260: https://github.com/pypa/build/pull/260
.. _#263: https://github.com/pypa/build/issues/259
.. _#259: https://github.com/pypa/build/issues/259


Expand Down
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ project_urls =
[options]
packages = find:
install_requires =
packaging
pep517>=0.9
toml
importlib-metadata;python_version < "3.8"
typing;python_version<"3"
packaging>=19.0
pep517>=0.9.1
toml>=0.10.0
importlib-metadata>=0.22;python_version < "3.8"
typing>=3.5.2;python_version < "3"
virtualenv>=20.0.35;python_version < "3"
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
package_dir =
Expand Down
6 changes: 6 additions & 0 deletions tests/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
importlib-metadata==0.22;python_version < "3.8"
packaging==19.0
pep517==0.9.1
toml==0.10.0
typing==3.5.2.2;python_version < "3"
virtualenv==20.0.35;python_version < "3"
9 changes: 8 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ envlist =
fix
type
docs
{py39, py38, py37, py36, py35, py27, pypy3, pypy2}{, -path, -sdist, -wheel}
{py39, py38, py37, py36, py35, py27, pypy3, pypy2}{, -path, -sdist, -wheel, -min}
isolated_build = true
skip_missing_interpreters = true
minversion = 3.14
Expand Down Expand Up @@ -55,6 +55,13 @@ commands =
mypy --python-version 3.5 src/build
mypy --python-version 2.7 src/build

[testenv:{py39, py38, py37, py36, py35, py27, pypy3, pypy2}-min]
description = check minimum versions required of all dependencies
skip_install = true
commands =
pip install .[test] -c tests/constraints.txt
pytest -rsx tests {posargs:-n auto}

[testenv:docs]
description = build documentations
basepython = python3.8
Expand Down

0 comments on commit bb8878c

Please sign in to comment.