Skip to content

Commit

Permalink
fix: Update noxfile and dependencies
Browse files Browse the repository at this point in the history
Update dependencies, update minimal python version to 3.6.1
Fix noxfile, generate constraint file using constraint format add
`--without-hashes` option to be able to install dependencies, see:
python-poetry/poetry#3472 (comment)

Update python interpreter to test.

Remove python 3.6 support.
  • Loading branch information
boatx committed Aug 30, 2023
1 parent 08ab720 commit d701846
Show file tree
Hide file tree
Showing 5 changed files with 738 additions and 605 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
python-version: ['3.7', '3.8']
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.0.5
- run: nox
- run: pip install nox==2023.4.22
- run: pip install poetry==1.4.0
- run: nox -p ${{ matrix.python-version }}
12 changes: 7 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
import nox
from nox.sessions import Session

PYTHON_VERSIONS = ("3.8", "3.7", "3.6")
PYTHON_VERSIONS = ("3.8", "3.7")
LOCATIONS = ("noxfile.py", "tests", "sockit")

nox.options.sessions = ("lint", "mypy", "pytype", "tests")


def install_with_constraints(
session: Session, *args: str, **kwargs: Any
session: Session, *args: str, **kwargs: Any # noqa: ANN401
) -> None:
with tempfile.NamedTemporaryFile() as requirements:
session.run(
"poetry",
"export",
"--dev",
"--format=requirements.txt",
"--with",
"dev",
"--without-hashes",
"--format=constraints.txt",
f"--output={requirements.name}",
external=True,
)
Expand All @@ -28,7 +30,7 @@ def install_with_constraints(
@nox.session(python=PYTHON_VERSIONS)
def tests(session: Session) -> None:
args = session.posargs or ["--cov"]
session.run("poetry", "install", "--no-dev", external=True)
session.run("poetry", "install", "--only", "main", external=True)
install_with_constraints(session, "coverage[toml]", "pytest", "pytest-cov")
session.run("pytest", *args)

Expand Down
Loading

0 comments on commit d701846

Please sign in to comment.