Skip to content

Commit

Permalink
Fix virtualenv setuptools version bug (#549)
Browse files Browse the repository at this point in the history
* Use SETUPTOOLS_USE_DISTUTILS env var rather than pinning virtualenv

* Add explanatory comment and fix typo

* Add a further explanatory comment for traceability

* Add the SETUPTOOLS_USE_DISTUTILS env var to the nox lint session

* Add session.posargs back to the lint session
  • Loading branch information
FollowTheProcess committed Dec 28, 2021
1 parent 3d34bbd commit e42f542
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -3,6 +3,9 @@ on: [push, pull_request]
env:
FORCE_COLOR: "1"
PRE_COMMIT_COLOR: "always"
# See https://github.com/theacodes/nox/issues/545
# and https://github.com/pre-commit/pre-commit/issues/2178#issuecomment-1002163763
SETUPTOOLS_USE_DISTUTILS: "stdlib"
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
11 changes: 8 additions & 3 deletions noxfile.py
Expand Up @@ -93,11 +93,16 @@ def cover(session):
@nox.session(python="3.9")
def lint(session):
"""Run pre-commit linting."""
# Pin virtualenv for pre-commit run
session.install("pre-commit")
# See https://github.com/theacodes/nox/issues/545
session.install("virtualenv==20.10.0", "pre-commit")
# and https://github.com/pre-commit/pre-commit/issues/2178#issuecomment-1002163763
session.run(
"pre-commit", "run", "--all-files", "--show-diff-on-failure", *session.posargs
"pre-commit",
"run",
"--all-files",
"--show-diff-on-failure",
env={"SETUPTOOLS_USE_DISTUTILS": "stdlib"},
*session.posargs,
)


Expand Down

0 comments on commit e42f542

Please sign in to comment.