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
60 changes: 24 additions & 36 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,56 +13,44 @@ on:
workflow_call:
workflow_dispatch:

env:
POETRY_VERSION: 1.8.1

jobs:
checks:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: 3.11 # Use latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [3.9, 3.14] # oldest supported and latest tested
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: Gr1N/setup-poetry@v8
- name: Check out repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ni/python-actions/setup-python@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
with:
poetry-version: ${{ env.POETRY_VERSION }}
# @TODO: This is a workaround for there not being a way to check the lock file
# See: https://github.com/python-poetry/poetry/issues/453
- name: Check for lock changes
run: |
poetry lock --check
- uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install the Package
run: poetry install -vvv
- name: Lint the Code
run: poetry run ni-python-styleguide lint
python-version: ${{ matrix.python-version }}
- uses: ni/python-actions/setup-poetry@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
- uses: ni/python-actions/analyze-project@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0

tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13]
python-version: [3.9, '3.10', 3.11, 3.12, 3.13, 3.14, 3.14t]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Check out repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
id: setup-python
uses: ni/python-actions/setup-python@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
with:
python-version: ${{ matrix.python-version }}

- uses: Gr1N/setup-poetry@v8
with:
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/cache@v4
- name: Set up Poetry
uses: ni/python-actions/setup-poetry@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
- name: Cache virtualenv
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
path: .venv
key: nps-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install the Package
run: poetry install
run: poetry install -v
- name: Run tests
run: poetry run pytest -v
20 changes: 3 additions & 17 deletions poetry.lock

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

2 changes: 2 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[virtualenvs]
in-project = true
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include = ["ni_python_styleguide/config.toml"]


[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
pathspec = ">=0.11.1"

# Tools we aggregate
Expand All @@ -38,10 +38,7 @@ isort = ">=5.10"
flake8-black = ">=0.2.1"
flake8-docstrings = ">=1.5.0"
flake8-import-order = ">=0.18.1,<0.19.0" # we're not compatible with 0.19.0 yet due to #226
flake8-tidy-imports = [
{version = ">=4.4.1", python = ">=3.7,<3.9"},
{version=">=4.11.0", python="^3.9"},
]
flake8-tidy-imports = ">=4.11.0"
pep8-naming = ">=0.11.1"

# Rejected flake8 plugins should be listed here (in alphabetical order)
Expand Down