forked from asciipip/greenbutton-python
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from vladistan/add-python-checks
Merging this pull request because this code has not yet broken at runtime and adding the right tooling comes first.
- Loading branch information
Showing
8 changed files
with
89 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ name: Run pre-commit hooks | |
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: python | ||
|
||
on: [push] | ||
|
||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
python-version: [ "3.9", "3.10", "3.11", "3.12" ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: pip | ||
- name: Install Nox | ||
run: pip install '.[dev]' | ||
- name: Test with Nox | ||
run: nox -s tests-${{ matrix.python-version }} | ||
types: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
cache: pip | ||
- name: Install Nox and group dependencies | ||
run: pip install '.[dev]' | ||
- name: Test with Nox | ||
run: nox -s mypy-3.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ venv/ | |
build/ | ||
dist/ | ||
*.egg-info/ | ||
.coverage* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Nox sessions.""" | ||
|
||
import nox | ||
|
||
package = "greenbutton_objects" | ||
python_versions = ["3.12", "3.11", "3.10", "3.9"] | ||
nox.needs_version = ">= 2024.4.15" | ||
nox.options.sessions = ( | ||
"safety", | ||
"mypy", | ||
"tests", | ||
) | ||
|
||
|
||
@nox.session(python=python_versions[0]) | ||
def safety(session) -> None: | ||
"""Scan dependencies for insecure packages.""" | ||
session.install(".[dev]") | ||
session.install("safety") | ||
session.run("safety", "check", "--full-report") | ||
|
||
|
||
@nox.session(python=python_versions) | ||
def mypy(session) -> None: | ||
"""Type-check using mypy.""" | ||
args = session.posargs or ["src"] | ||
session.install(".[dev]") | ||
session.run("mypy", *args) | ||
|
||
|
||
@nox.session(python=python_versions) | ||
def tests(session) -> None: | ||
"""Run the test suite.""" | ||
session.install(".[dev]") | ||
session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.