Skip to content

Commit

Permalink
Merge branch 'main' into build-dependency-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Sep 2, 2024
2 parents c445010 + a328ac9 commit 421208e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Switch to using Python 3.8 by default
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install tox
Expand All @@ -28,21 +28,21 @@ jobs:
--user
tox
- name: Check out src from Git
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed by setuptools-scm
- name: Build dists
run: python -m tox
- name: Publish to test.pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
github.event_name == 'release'
uses: pypa/[email protected].6
uses: pypa/[email protected].14
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
github.event_name == 'release'
uses: pypa/[email protected].6
uses: pypa/[email protected].14
with:
password: ${{ secrets.pypi_password }}
10 changes: 5 additions & 5 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- name: Determine matrix
id: generate_matrix
uses: coactions/matrix@main
uses: coactions/matrix@v3
with:
other_names: |
lint
Expand All @@ -34,12 +34,12 @@ jobs:
matrix: ${{ fromJson(needs.pre.outputs.matrix) }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed by setuptools-scm

- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}

Expand All @@ -48,8 +48,8 @@ jobs:
python -m pip install --upgrade pip
pip install tox>=4.0
- name: tox run -e ${{ matrix.passed_name }}
run: tox run -e ${{ matrix.passed_name }}
- name: ${{ matrix.name }}
run: ${{ matrix.command }}

check: # This job does nothing and is only used for the branch protection
if: always()
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ coverage.xml
# Sphinx documentation
doc/build/
src/doc8/_version.py

# IDE caches
.idea/
.vscode/
16 changes: 6 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
---
default_language_version:
# Enforce use of py310 because pylint does not support py311 yet, causing
# failures for those happening to have that as default python.
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 # Use the ref you want to point at
rev: v4.6.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-executables-have-shebangs
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.17.0
hooks:
- id: pyupgrade
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.11.2
hooks:
- id: mypy
# empty args needed in order to match mypy cli behavior
Expand All @@ -37,7 +33,7 @@ repos:
- types-setuptools
- types-docutils
- repo: https://github.com/PyCQA/pylint
rev: v3.0.3
rev: v3.2.6
hooks:
- id: pylint
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Before contributing to *doc8* or any other PyCQA project, we suggest you read
the PyCQA meta documentation:

http://meta.pycqa.org/en/latest/
http://meta.pycqa.org/

Patches for *doc8* should be submitted to GitHub, as should bugs:

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ requires-python = ">=3.8"
dependencies = [
# Ceiled due to DeprecationWarning: The frontend.OptionParser class will be
# replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
"docutils>=0.19,<0.21",
"docutils>=0.19,<=0.21.2",
"restructuredtext-lint>=0.7",
"stevedore",
"tomli; python_version < '3.11'",
Expand Down Expand Up @@ -69,11 +69,11 @@ filterwarnings = [
]

[[tool.mypy.overrides]]
python_version = "3.8"
module = [
"doc8._version",
"restructuredtext_lint",
"stevedore",
"tomli",
]
ignore_missing_imports = true

Expand Down
6 changes: 5 additions & 1 deletion src/doc8/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from tomllib import load as toml_load # type: ignore
except ImportError:
# py3.10 or older
from tomli import load as toml_load
from tomli import load as toml_load # type: ignore[no-redef]

from stevedore import extension

Expand Down Expand Up @@ -230,6 +230,10 @@ def validate(cfg, files, result=None):
error_counts = {}
ignoreables = frozenset(cfg.get("ignore", []))
ignore_targeted = cfg.get("ignore_path_errors", {})
ignore_targeted = {
os.path.abspath(file_path): ignore_codes
for file_path, ignore_codes in ignore_targeted.items()
}
while files:
f = files.popleft()
if cfg.get("verbose"):
Expand Down

0 comments on commit 421208e

Please sign in to comment.