diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index f666c46..5c04cdc 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -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 diff --git a/poetry.lock b/poetry.lock index f7bd279..5ab5cdc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "better-diff" @@ -177,20 +177,6 @@ files = [ pycodestyle = "*" setuptools = "*" -[[package]] -name = "flake8-tidy-imports" -version = "4.10.0" -description = "A flake8 plugin that helps you write tidier imports." -optional = false -python-versions = ">=3.8" -files = [ - {file = "flake8_tidy_imports-4.10.0-py3-none-any.whl", hash = "sha256:b0387fb2ea200441bd142309e716fb7b8f4b0937bdf5f8b7c0c118a5f5e2b8ed"}, - {file = "flake8_tidy_imports-4.10.0.tar.gz", hash = "sha256:bd6cf86465402d2b86903009b748d85a628e599e17b76e810c9857e3a2815173"}, -] - -[package.dependencies] -flake8 = ">=3.8.0" - [[package]] name = "flake8-tidy-imports" version = "4.11.0" @@ -494,5 +480,5 @@ files = [ [metadata] lock-version = "2.0" -python-versions = "^3.8" -content-hash = "a8aef2d773dabdd18223fcb2aabce153b8a4f45750fe636d15acf5b47143ea16" +python-versions = "^3.9" +content-hash = "446aa7a19ff8421be0be338dc39fe9926dc8f1757ec24188a99dfe63cb2809f6" diff --git a/poetry.toml b/poetry.toml new file mode 100644 index 0000000..ab1033b --- /dev/null +++ b/poetry.toml @@ -0,0 +1,2 @@ +[virtualenvs] +in-project = true diff --git a/pyproject.toml b/pyproject.toml index 043e32b..c412472 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 @@ -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)