Skip to content

Commit

Permalink
test: fixed typing and added ci-job
Browse files Browse the repository at this point in the history
  • Loading branch information
15r10nk committed Apr 27, 2023
1 parent af7dd8c commit 67febea
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 7 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
pull_request:
push:
branches: [main]

jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: x64
- run: pip install nox==2019.11.9
- run: pip install poetry==1.2.2
- run: nox --session mypy

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
architecture: x64
- run: pip install nox==2022.11.21
- run: pip install poetry==1.2.2
- run: nox --sessions test-${{matrix.python-version}}
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import nox

nox.options.sessions = ["clean", "test", "report", "docs"]
nox.options.sessions = ["clean", "test", "report", "mypy"]
nox.options.reuse_existing_virtualenvs = True


Expand All @@ -17,7 +17,7 @@ def clean(session):
def mypy(session):
session.install("poetry")
session.run("poetry", "install", "--with=dev")
session.run("mypy", "src", "tests")
session.run("mypy", "pysource_minimize", "tests")


@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"])
Expand Down
102 changes: 98 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pytest-subtests = "^0.8.0"
pytest-xdist = {extras = ["psutil"], version = "^3.1.0"}
coverage-enable-subprocess = "^1.0"
coverage = "^6.5.0"
mypy = "^1.2.0"

[build-system]
requires = ["poetry-core"]
Expand Down
2 changes: 1 addition & 1 deletion pysource_minimize/_minimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ast import unparse
except ImportError:

from astunparse import unparse
from astunparse import unparse # type: ignore

TESTING = "PYTEST_CURRENT_TEST" in os.environ

Expand Down

0 comments on commit 67febea

Please sign in to comment.