Skip to content
Open
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
14 changes: 4 additions & 10 deletions .github/workflows/all-lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-14, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
exclude:
- os: macos-latest
python-version: 3.8
- os: macos-latest
python-version: 3.9
- os: macos-latest
python-version: 3.10
- os: macos-13
python-version: 3.11
- os: macos-13
python-version: 3.12
- os: macos-14
python-version: 3.10

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./
with:
python-root-list: "./tests/*.py ./tests/subtest/*.py"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-python-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
env:
python-test-package: python-dummy
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Python if required
if: ${{ matrix.use-external-python }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,41 @@ Basic:

```yml
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: marian-code/python-lint-annotate@v4
```

Options:

```yml
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: marian-code/python-lint-annotate@v4
with:
python-root-list: "src/ tests/*" # accepts wildcards
use-pycodestyle: false
use-mypy: false
use-vulture: true
extra-pylint-options: "--output-format="colorized"
python-version: "3.8"
python-version: "3.10"
```

### Examples
* [Only lint changed files, and ignore missing docstrings](examples/actions-only_changed_files.yml)

## Details

Uses `actions/setup-python@v5`. Only python `3.8` - `3.12` versions are tested.
Python `3.x` versions prior to `3.8` are not tested since they are EOL now.
Uses `actions/setup-python@v6`. Only python `3.10` - `3.14` versions are tested.
Python `3.x` versions prior to `3.10` are not tested since they are EOL now.
Any python `2.x` versions are unsupported! You can lint on Linux, Windows and MacOS.

The linter versions are defined in [requirements.txt](requirements.txt).

## IMPORTANT - test environment

The python version is set by `actions/setup-python@v5` using composite actions. This
The python version is set by `actions/setup-python@v6` using composite actions. This
means that the the action will change python you might have previously set with
`actions/setup-python@v5`. There are two ways to circumvent this.
`actions/setup-python@v6`. There are two ways to circumvent this.

- Keep the lintnig action separated from others
- Use it at the and of your workflow when the change in python version will not
Expand All @@ -84,12 +84,12 @@ jobs:
name: Lint Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.9
python-version: 3.10
- run: |
python --version # this will output 3.9 now
python --version # this will output 3.10 now
run tests or other things using python ...
- uses: marian-code/python-lint-annotate@v4
with:
Expand All @@ -103,9 +103,9 @@ jobs:
use-pylint: false
use-flake8: false
use-vulture: true
python-version: "3.8"
python-version: "3.10"
- run: |
python --version # this will output 3.8 now !!!
python --version # this will output 3.10 now !!!
```

## License
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ inputs:
python-version:
description: "Set desired python version with this keyword"
required: false
default: "3.8"
default: "3.10"
use-external-python:
description: "false (default): Install a new Python for this action; true: use the python installation in the previous steps"
type: boolean
Expand All @@ -86,8 +86,8 @@ runs:
using: "composite"
steps:
- name: Setup python
if: ${{ ! inputs.use-external-python }}
uses: actions/setup-python@v5
if: ${{ ! fromJSON(inputs.use-external-python) }}
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}
architecture: x64
Expand Down
8 changes: 4 additions & 4 deletions examples/actions-only_changed_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ jobs:
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0 # This is necessary to get the commits
- name: Set up Python environment
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.8"
python-version: "3.10"
- name: Get changed python files between base and head
run: >
echo "CHANGED_FILES=$(echo $(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- | grep \.py))" >> $GITHUB_ENV
- if: ${{ env.CHANGED_FILES }}
uses: marian-code/python-lint-annotate@v3
uses: marian-code/python-lint-annotate@v4
with:
python-root-list: ${{ env.CHANGED_FILES }}
extra-pylint-options: "--disable=C0114,C0116" # Missing doctrings
Expand Down
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
black==24.3.0
flake8==7.0.0
isort==5.13.2
mypy~=1.9.0
pycodestyle==2.11.1
black==26.1.0
flake8==7.3.0
isort==8.0.0
mypy~=1.19.1
pycodestyle==2.14.0
pydocstyle==6.3.0
pylint==3.1.0
vulture==2.11
pylint==4.0.5
vulture==2.14
Loading