Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

🐛 Ignore collection failures in non-tests #1

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
189fe40
CI: Modernize, MOAR Pythons, GH-Actions
stdedos Feb 24, 2023
c5af2e5
MOAR Improvements: Cross-OS testing, `.gitignore` updates, supporting…
stdedos Oct 14, 2023
6be0547
Merge pull request #1 from pylint-dev/ci/improve/use-gh-actions
stdedos Oct 14, 2023
56fa1d1
Add a release job to publish on pypi on github tag creation
Pierre-Sassoulas Oct 14, 2023
005174f
Add `.pre-commit-config.yaml`
stdedos Oct 14, 2023
85d7e42
`pre-commit run -a`
stdedos Oct 14, 2023
ff18b58
Enable https://github.com/asottile/pyupgrade + `.git-blame-ignore-revs`
stdedos Oct 14, 2023
ab07d5e
Merge pull request #5 from pylint-dev/release-job
stdedos Oct 14, 2023
5ee69ce
Merge pull request #4 from stdedos/ci/pre-commit/config
stdedos Oct 14, 2023
ae436ac
Use ruff instead of flake8 pyupgrade autoflake and isort
Pierre-Sassoulas Oct 14, 2023
a1fc41e
Merge pull request #6 from pylint-dev/pre-commit-ruff
stdedos Oct 14, 2023
1c2613b
Upgrade the changelog for 1.1.3a0 release (#10)
Pierre-Sassoulas Oct 15, 2023
ae3d8ca
Activate ruff, ignore the typing of classvar
Pierre-Sassoulas Oct 14, 2023
ec51408
[pylint] Add pylint in the continuous integration and pre-commit
Pierre-Sassoulas Oct 14, 2023
0a4331d
Move the pylint configuration to pyproject.toml
Pierre-Sassoulas Oct 14, 2023
7feeb56
Minor re-ordering of the `tool.pylint`, with some comments
stdedos Oct 15, 2023
a444a61
Carry over some `.pylintrc` configuration
stdedos Oct 17, 2023
122c799
[mypy] Fix Item "None" of "Optional[Module]" has no attribute "__file__"
Pierre-Sassoulas Oct 14, 2023
33d1313
Activate mypy in pre-commit
Pierre-Sassoulas Oct 14, 2023
b65e979
Fix mypy issues
stdedos Oct 17, 2023
b8ce4ad
Roll back `from __future__ import annotations` for Python 3.6
stdedos Oct 17, 2023
2d6d83a
Merge pull request #9 from pylint-dev/pre-commit-mypy
Pierre-Sassoulas Oct 18, 2023
163ac3a
Fix the repository badges
stdedos Oct 18, 2023
0b1bb86
Improvements for `.github/workflows/run-tests.yaml`
stdedos Oct 18, 2023
55e4218
Merge pull request #14 from stdedos/test/impr-action+coverage
stdedos Oct 18, 2023
c208abb
Fix testing + coverage
stdedos Oct 18, 2023
f8da197
Merge pull request #18 from stdedos/ci/fix-test-coverage
stdedos Oct 18, 2023
4971561
Release v1.1.3rc0 (#17)
stdedos Oct 19, 2023
85dd457
Improve packaging + Release v1.1.3rc1
stdedos Oct 19, 2023
cb653a0
Merge pull request #19 from stdedos/release/v1.1.3rc1
stdedos Oct 19, 2023
630172b
test direct import
anis-campos Dec 6, 2022
d5cd873
Fixing _is_pytest_fixture
anis-campos Dec 6, 2022
0a47a49
Release v1.1.3
stdedos Oct 23, 2023
a5c6855
Merge pull request #2 from anis-campos/fix_is_pytest_fixture
stdedos Oct 23, 2023
f6a343d
🐛 Ignore collection failures in non-tests
stdedos Oct 18, 2023
abc9f22
Improve `F6401`:`cannot-enumerate-pytest-fixtures`:
stdedos Oct 12, 2023
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
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore:
- tests/input/**/*.py
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Add `.pre-commit-config.yaml` + `pre-commit run -a`
85d7e422b36fb86e22990ede8c92f7ec95ac43ec
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Package versions
- pylint
- pylint
- pytest
- pylint-pytest

Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Checks

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
CACHE_VERSION: 1
KEY_PREFIX: base-venv
DEFAULT_PYTHON: "3.11"
PRE_COMMIT_CACHE: ~/.cache/pre-commit

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
prepare-base:
name: Prepare base dependencies
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
python-key: ${{ steps.generate-python-key.outputs.key }}
pre-commit-key: ${{ steps.generate-pre-commit-key.outputs.key }}
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
- name: Generate partial Python venv restore key
id: generate-python-key
run: >-
echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{
hashFiles('pyproject.toml', 'requirements_test.txt',
'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >>
$GITHUB_OUTPUT
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
steps.generate-python-key.outputs.key }}
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv venv
. venv/bin/activate
python -m pip install -U pip setuptools wheel
pip install .
pip install pre-commit
- name: Generate pre-commit restore key
id: generate-pre-commit-key
run: >-
echo "key=pre-commit-${{ env.CACHE_VERSION }}-${{
hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
- name: Restore pre-commit environment
id: cache-precommit
uses: actions/[email protected]
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: >-
${{ runner.os }}-${{ steps.generate-pre-commit-key.outputs.key }}
- name: Install pre-commit dependencies
if: steps.cache-precommit.outputs.cache-hit != 'true'
run: |
. venv/bin/activate
pre-commit install --install-hooks

pylint:
name: pylint
runs-on: ubuntu-latest
timeout-minutes: 10
needs: prepare-base
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
fail-on-cache-miss: true
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.prepare-base.outputs.python-key }}
- name: Restore pre-commit environment
id: cache-precommit
uses: actions/[email protected]
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }}
- name: Run pylint checks
run: |
. venv/bin/activate
pip install .
pre-commit run pylint --all-files
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
release:
types:
- published

env:
DEFAULT_PYTHON: "3.11"

permissions:
contents: read

jobs:
release-pypi:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/project/pylint-pytest/
steps:
- name: Check out code from Github
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
- name: Install requirements
run: |
# Remove dist, build, and pylint.egg-info
# when building locally for testing!
python -m pip install twine build
- name: Build distributions
run: |
python -m build
- name: Upload to PyPI
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
env:
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload --verbose dist/*
78 changes: 78 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Testing

on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
# - '3.12' # FixMe: https://github.com/pylint-dev/pylint-pytest/issues/3
# Python 3.6 is not available in `ubuntu-latest`.
exclude:
- python-version: '3.6'
os: ubuntu-latest
include:
- python-version: '3.6'
os: ubuntu-20.04

defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || '/bin/bash --noprofile --norc -Eeuxo pipefail {0}' }}

steps:
- uses: actions/checkout@v3

- name: Slugify GITHUB_REPOSITORY
run: echo "GITHUB_REPOSITORY_SLUG=${GITHUB_REPOSITORY////_}" >> $GITHUB_ENV

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: setup.py

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox

- name: Test with tox
env:
FORCE_COLOR: 1
PYTEST_CI_ARGS: --cov-report=xml --cov-report=html --junitxml=test_artifacts/test_report.xml --color=yes
run: tox ${{ matrix.python-version == '3.6' && '--skip-missing-interpreters=true' || '' }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.os }},${{ matrix.python-version }}
fail_ci_if_error: true
files: test_artifacts/cobertura.xml

- name: Create artifacts
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: ${{ env.GITHUB_REPOSITORY_SLUG }}_test-artifacts_${{ github.event_name }}_${{ github.event.pull_request.number || github.sha }}_${{ matrix.os }}_py${{ matrix.python-version }}
path: test_artifacts/
Loading