Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pip==22.3.1
nox==2022.8.7
nox-poetry==1.0.2
poetry==1.1.15
poetry==1.2.2
virtualenv==20.16.7
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-python@v4.3.0
with:
python-version: "3.10"
python-version: "3.11"

- name: Upgrade pip
run: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ jobs:
fail-fast: false
matrix:
include:
- { python: "3.10", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.11", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.9", os: "ubuntu-latest", session: "safety" }
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
- { python: "3.8", os: "ubuntu-latest", session: "tests" }
- { python: "3.7", os: "ubuntu-latest", session: "tests" }
- { python: "3.10", os: "windows-latest", session: "tests" }
- { python: "3.10", os: "macos-latest", session: "tests" }
- { python: "3.11", os: "windows-latest", session: "tests" }
- { python: "3.11", os: "macos-latest", session: "tests" }

env:
NOXSESSION: ${{ matrix.session }}
Expand Down Expand Up @@ -102,7 +103,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4.3.0
with:
python-version: "3.10"
python-version: "3.11"

- name: Upgrade pip
run: |
Expand Down
16 changes: 11 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@


package = "inquirer"
python_versions = ["3.10", "3.9", "3.8", "3.7"]
python_versions = ["3.11", "3.10", "3.9", "3.8"]
nox.needs_version = ">= 2021.6.6"
nox.options.sessions = (
"pre-commit",
"safety",
"tests",
"docs-build",
)
Expand All @@ -42,7 +43,7 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None:
Args:
session: The Session object.
"""
assert session.bin is not None # noqa: S101
assert session.bin is not None # nosec

# Only patch hooks containing a reference to this session's bindir. Support
# quoting rules for Python and bash, but strip the outermost quotes so we
Expand Down Expand Up @@ -70,6 +71,11 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None:
VIRTUAL_ENV={shlex.quote(virtualenv)}
PATH={shlex.quote(session.bin)}"{os.pathsep}$PATH"
""",
# pre-commit >= 2.17.0 on Windows forces sh shebang
"/bin/sh": f"""\
VIRTUAL_ENV={shlex.quote(virtualenv)}
PATH={shlex.quote(session.bin)}"{os.pathsep}$PATH"
""",
}

hookdir = Path(".git") / "hooks"
Expand Down Expand Up @@ -109,7 +115,7 @@ def precommit(session: Session) -> None:
# "flake8-bugbear",
"flake8-docstrings",
"flake8-rst-docstrings",
# "isort",
"isort",
# "pep8-naming",
"pre-commit",
"pre-commit-hooks",
Expand All @@ -120,12 +126,12 @@ def precommit(session: Session) -> None:
activate_virtualenv_in_precommit_hooks(session)


@session(python=python_versions[0])
@session(python=python_versions[2])
def safety(session: Session) -> None:
"""Scan dependencies for insecure packages."""
requirements = session.poetry.export_requirements()
session.install("safety")
session.run("safety", "check", "--full-report", f"--file={requirements}")
session.run("safety", "check", f"--file={requirements}")


@session(python=python_versions)
Expand Down
Loading