Skip to content

Commit

Permalink
build: use older version of setuptools when running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Jan 5, 2022
1 parent e4cfb38 commit 2b66602
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,16 @@ def safety(session):
@nox.session(python=["3.6", "3.7", "3.8", "3.9"], reuse_venv=True)
def tests(session):
args = session.posargs
# Installing setuptools that will work with `2to3` which is used when building
# `python-icat` < 1.0. 58.0.0 removes support of this tool during builds:
# https://setuptools.pypa.io/en/latest/history.html#v58-0-0
# Ideally this would be done within `pyproject.toml` but specifying `setuptools` as
# a dependency requires Poetry 1.2:
# https://github.com/python-poetry/poetry/issues/4511#issuecomment-922420457
# Currently, only a pre-release exists for Poetry 1.2. Testing on the pre-release
# version didn't fix the `2to3` issue when building Python ICAT, perhaps because
# Python ICAT isn't built on the downgraded version for some reason?
session.run("poetry", "run", "pip", "uninstall", "-y", "setuptools")
session.run("poetry", "run", "pip", "install", "setuptools<58.0.0")
session.run("poetry", "install", external=True)
session.run("pytest", *args)

0 comments on commit 2b66602

Please sign in to comment.