Skip to content

Commit c249eb7

Browse files
committed
Merge remote-tracking branch 'origin/master' into replay/fix/nate/better-unused-argument
# By Stavros Ntentos (15) and others # Via GitHub (9) and Stavros Ntentos (1) * origin/master: Release v1.1.3 Fixing _is_pytest_fixture test direct import Improve packaging + Release v1.1.3rc1 Release v1.1.3rc0 (pylint-dev#17) Fix testing + coverage Improvements for `.github/workflows/run-tests.yaml` Fix the repository badges Roll back `from __future__ import annotations` for Python 3.6 Fix mypy issues Activate mypy in pre-commit [mypy] Fix Item "None" of "Optional[Module]" has no attribute "__file__" Carry over some `.pylintrc` configuration Minor re-ordering of the `tool.pylint`, with some comments Move the pylint configuration to pyproject.toml [pylint] Add pylint in the continuous integration and pre-commit Activate ruff, ignore the typing of classvar Upgrade the changelog for 1.1.3a0 release (pylint-dev#10) Use ruff instead of flake8 pyupgrade autoflake and isort Enable https://github.com/asottile/pyupgrade + `.git-blame-ignore-revs` `pre-commit run -a` Add `.pre-commit-config.yaml` Add a release job to publish on pypi on github tag creation MOAR Improvements: Cross-OS testing, `.gitignore` updates, supporting only `pylint<3`, coverage at Codecov, drop other CI CI: Modernize, MOAR Pythons, GH-Actions Signed-off-by: Stavros Ntentos <[email protected]> # Conflicts: # pylint_pytest/checkers/fixture.py
2 parents 360461c + a5c6855 commit c249eb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1131
-350
lines changed

.codecov.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore:
2+
- tests/input/**/*.py

.git-blame-ignore-revs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Add `.pre-commit-config.yaml` + `pre-commit run -a`
2+
85d7e422b36fb86e22990ede8c92f7ec95ac43ec

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A clear and concise description of what the bug is.
1212

1313
**To Reproduce**
1414
Package versions
15-
- pylint
15+
- pylint
1616
- pytest
1717
- pylint-pytest
1818

.github/workflows/checks.yaml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
CACHE_VERSION: 1
13+
KEY_PREFIX: base-venv
14+
DEFAULT_PYTHON: "3.11"
15+
PRE_COMMIT_CACHE: ~/.cache/pre-commit
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
prepare-base:
26+
name: Prepare base dependencies
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 10
29+
outputs:
30+
python-key: ${{ steps.generate-python-key.outputs.key }}
31+
pre-commit-key: ${{ steps.generate-pre-commit-key.outputs.key }}
32+
steps:
33+
- name: Check out code from GitHub
34+
uses: actions/[email protected]
35+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
36+
id: python
37+
uses: actions/[email protected]
38+
with:
39+
python-version: ${{ env.DEFAULT_PYTHON }}
40+
check-latest: true
41+
- name: Generate partial Python venv restore key
42+
id: generate-python-key
43+
run: >-
44+
echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{
45+
hashFiles('pyproject.toml', 'requirements_test.txt',
46+
'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >>
47+
$GITHUB_OUTPUT
48+
- name: Restore Python virtual environment
49+
id: cache-venv
50+
uses: actions/[email protected]
51+
with:
52+
path: venv
53+
key: >-
54+
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
55+
steps.generate-python-key.outputs.key }}
56+
- name: Create Python virtual environment
57+
if: steps.cache-venv.outputs.cache-hit != 'true'
58+
run: |
59+
python -m venv venv
60+
. venv/bin/activate
61+
python -m pip install -U pip setuptools wheel
62+
pip install .
63+
pip install pre-commit
64+
- name: Generate pre-commit restore key
65+
id: generate-pre-commit-key
66+
run: >-
67+
echo "key=pre-commit-${{ env.CACHE_VERSION }}-${{
68+
hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
69+
- name: Restore pre-commit environment
70+
id: cache-precommit
71+
uses: actions/[email protected]
72+
with:
73+
path: ${{ env.PRE_COMMIT_CACHE }}
74+
key: >-
75+
${{ runner.os }}-${{ steps.generate-pre-commit-key.outputs.key }}
76+
- name: Install pre-commit dependencies
77+
if: steps.cache-precommit.outputs.cache-hit != 'true'
78+
run: |
79+
. venv/bin/activate
80+
pre-commit install --install-hooks
81+
82+
pylint:
83+
name: pylint
84+
runs-on: ubuntu-latest
85+
timeout-minutes: 10
86+
needs: prepare-base
87+
steps:
88+
- name: Check out code from GitHub
89+
uses: actions/[email protected]
90+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
91+
id: python
92+
uses: actions/[email protected]
93+
with:
94+
python-version: ${{ env.DEFAULT_PYTHON }}
95+
check-latest: true
96+
- name: Restore Python virtual environment
97+
id: cache-venv
98+
uses: actions/[email protected]
99+
with:
100+
path: venv
101+
fail-on-cache-miss: true
102+
key:
103+
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
104+
needs.prepare-base.outputs.python-key }}
105+
- name: Restore pre-commit environment
106+
id: cache-precommit
107+
uses: actions/[email protected]
108+
with:
109+
path: ${{ env.PRE_COMMIT_CACHE }}
110+
fail-on-cache-miss: true
111+
key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }}
112+
- name: Run pylint checks
113+
run: |
114+
. venv/bin/activate
115+
pip install .
116+
pre-commit run pylint --all-files

.github/workflows/release.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
env:
9+
DEFAULT_PYTHON: "3.11"
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
release-pypi:
16+
name: Upload release to PyPI
17+
runs-on: ubuntu-latest
18+
environment:
19+
name: PyPI
20+
url: https://pypi.org/project/pylint-pytest/
21+
steps:
22+
- name: Check out code from Github
23+
uses: actions/[email protected]
24+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
25+
id: python
26+
uses: actions/[email protected]
27+
with:
28+
python-version: ${{ env.DEFAULT_PYTHON }}
29+
check-latest: true
30+
- name: Install requirements
31+
run: |
32+
# Remove dist, build, and pylint.egg-info
33+
# when building locally for testing!
34+
python -m pip install twine build
35+
- name: Build distributions
36+
run: |
37+
python -m build
38+
- name: Upload to PyPI
39+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
40+
env:
41+
TWINE_REPOSITORY: pypi
42+
TWINE_USERNAME: __token__
43+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
44+
run: |
45+
twine upload --verbose dist/*

.github/workflows/run-tests.yaml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os:
18+
- ubuntu-latest
19+
- windows-latest
20+
- macos-latest
21+
python-version:
22+
- '3.6'
23+
- '3.7'
24+
- '3.8'
25+
- '3.9'
26+
- '3.10'
27+
- '3.11'
28+
# - '3.12' # FixMe: https://github.com/pylint-dev/pylint-pytest/issues/3
29+
# Python 3.6 is not available in `ubuntu-latest`.
30+
exclude:
31+
- python-version: '3.6'
32+
os: ubuntu-latest
33+
include:
34+
- python-version: '3.6'
35+
os: ubuntu-20.04
36+
37+
defaults:
38+
run:
39+
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || '/bin/bash --noprofile --norc -Eeuxo pipefail {0}' }}
40+
41+
steps:
42+
- uses: actions/checkout@v3
43+
44+
- name: Slugify GITHUB_REPOSITORY
45+
run: echo "GITHUB_REPOSITORY_SLUG=${GITHUB_REPOSITORY////_}" >> $GITHUB_ENV
46+
47+
- name: Set up Python ${{ matrix.python-version }}
48+
uses: actions/setup-python@v4
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
cache: 'pip'
52+
cache-dependency-path: setup.py
53+
54+
- name: Install dependencies
55+
run: |
56+
python -m pip install --upgrade pip
57+
python -m pip install tox
58+
59+
- name: Test with tox
60+
env:
61+
FORCE_COLOR: 1
62+
PYTEST_CI_ARGS: --cov-report=xml --cov-report=html --junitxml=test_artifacts/test_report.xml --color=yes
63+
run: tox ${{ matrix.python-version == '3.6' && '--skip-missing-interpreters=true' || '' }}
64+
65+
- name: Upload coverage reports to Codecov
66+
uses: codecov/codecov-action@v3
67+
with:
68+
token: ${{ secrets.CODECOV_TOKEN }}
69+
flags: ${{ matrix.os }},${{ matrix.python-version }}
70+
fail_ci_if_error: true
71+
files: test_artifacts/cobertura.xml
72+
73+
- name: Create artifacts
74+
uses: actions/upload-artifact@v3
75+
if: ${{ !cancelled() }}
76+
with:
77+
name: ${{ env.GITHUB_REPOSITORY_SLUG }}_test-artifacts_${{ github.event_name }}_${{ github.event.pull_request.number || github.sha }}_${{ matrix.os }}_py${{ matrix.python-version }}
78+
path: test_artifacts/

0 commit comments

Comments
 (0)