Skip to content

Commit 3eaf8d6

Browse files
committed
Merge branch 'main' into configurable-formatter
2 parents 1606593 + 6a8a63a commit 3eaf8d6

25 files changed

+1193
-896
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/check.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: check
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: "0 8 * * *"
7+
8+
concurrency:
9+
group: check-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test:
14+
name: test with CPython ${{ matrix.py }}
15+
runs-on: ubuntu-20.04
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
py:
20+
- "3.10"
21+
- "3.9"
22+
- "3.8"
23+
- "3.7"
24+
steps:
25+
- name: Setup python for tox
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: "3.10"
29+
- name: Install tox
30+
run: python -m pip install tox
31+
- uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 0
34+
- name: Setup python for test ${{ matrix.py }}
35+
uses: actions/setup-python@v2
36+
with:
37+
python-version: ${{ matrix.py }}
38+
- name: Pick environment to run
39+
run: |
40+
import os
41+
import sys
42+
from pathlib import Path
43+
env = "TOXENV=py{}{}\n".format(*sys.version_info[0:2])
44+
print("Picked:\n{}for{}".format(env, sys.version))
45+
with Path(os.environ["GITHUB_ENV"]).open("a") as file_handler:
46+
file_handler.write(env)
47+
shell: python
48+
- name: Setup test suite
49+
run: tox -vv --notest
50+
- name: Run test suite
51+
run: tox --skip-pkg-install
52+
env:
53+
PYTEST_ADDOPTS: "-vv --durations=20"
54+
CI_RUN: "yes"
55+
DIFF_AGAINST: HEAD
56+
- name: Rename coverage report file
57+
run:
58+
import os; import sys; os.rename(f".tox/.coverage.{os.environ['TOXENV']}",
59+
f".tox/.coverage.{os.environ['TOXENV']}-{sys.platform}")
60+
shell: python
61+
- name: Upload coverage data
62+
uses: actions/upload-artifact@v2
63+
with:
64+
name: coverage-data
65+
path: ".tox/.coverage.*"
66+
67+
coverage:
68+
name: Combine coverage
69+
runs-on: ubuntu-20.04
70+
needs: test
71+
steps:
72+
- uses: actions/checkout@v2
73+
with:
74+
fetch-depth: 0
75+
- uses: actions/setup-python@v2
76+
with:
77+
python-version: "3.10"
78+
- name: Install tox
79+
run: python -m pip install tox
80+
- name: Setup coverage tool
81+
run: tox -e coverage --notest
82+
- name: Install package builder
83+
run: python -m pip install build
84+
- name: Build package
85+
run: pyproject-build --wheel .
86+
- name: Download coverage data
87+
uses: actions/download-artifact@v2
88+
with:
89+
name: coverage-data
90+
path: .tox
91+
- name: Combine and report coverage
92+
run: tox -e coverage
93+
- name: Upload HTML report
94+
uses: actions/upload-artifact@v2
95+
with:
96+
name: html-report
97+
path: .tox/htmlcov
98+
99+
check:
100+
name: tox env ${{ matrix.tox_env }}
101+
runs-on: ubuntu-20.04
102+
strategy:
103+
fail-fast: false
104+
matrix:
105+
tox_env:
106+
- dev
107+
- readme
108+
steps:
109+
- uses: actions/checkout@v2
110+
with:
111+
fetch-depth: 0
112+
- name: Setup Python "3.10"
113+
uses: actions/setup-python@v2
114+
with:
115+
python-version: "3.10"
116+
- name: Install tox
117+
run: python -m pip install tox
118+
- name: Setup test suite
119+
run: tox -vv --notest -e ${{ matrix.tox_env }}
120+
- name: Run test suite
121+
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}
122+
123+
publish:
124+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
125+
needs: [check, coverage]
126+
runs-on: ubuntu-20.04
127+
steps:
128+
- name: Setup python to build package
129+
uses: actions/setup-python@v2
130+
with:
131+
python-version: "3.10"
132+
- name: Install build
133+
run: python -m pip install build
134+
- uses: actions/checkout@v2
135+
with:
136+
fetch-depth: 0
137+
- name: Build sdist and wheel
138+
run: python -m build -s -w . -o dist
139+
- name: Publish to PyPi
140+
uses: pypa/gh-action-pypi-publish@master
141+
with:
142+
skip_existing: true
143+
user: __token__
144+
password: ${{ secrets.pypi_password }}

.github/workflows/codeqa-test.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.gitignore

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
.project
2-
.pydevproject
3-
.idea
1+
*.egg-info
2+
build
3+
dist
4+
*.egg
5+
.eggs
6+
*.py[codz]
7+
*$py.class
48
.tox
5-
.coverage
6-
.cache
7-
.eggs/
8-
*.egg-info/
9-
*.pyc
10-
__pycache__/
11-
dist/
12-
build/
13-
.vscode/
14-
.pre-commit-config.yaml
9+
.*_cache
10+
.idea
11+
.vscode
12+
/pip-wheel-metadata
13+
/src/sphinx_autodoc_typehints/version.py
14+
venv*

.pre-commit-config.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.1.0
4+
hooks:
5+
- id: check-ast
6+
- id: check-builtin-literals
7+
- id: check-docstring-first
8+
- id: check-merge-conflict
9+
- id: check-yaml
10+
- id: check-toml
11+
- id: debug-statements
12+
- id: end-of-file-fixer
13+
- id: trailing-whitespace
14+
- repo: https://github.com/asottile/pyupgrade
15+
rev: v2.31.0
16+
hooks:
17+
- id: pyupgrade
18+
args: [ "--py37-plus" ]
19+
exclude: "^(tests/roots/test-dummy/dummy_module.py)$"
20+
- id: pyupgrade
21+
files: "^(tests/roots/test-dummy/dummy_module.py)$"
22+
args: [ "--py36-plus" ]
23+
- repo: https://github.com/PyCQA/isort
24+
rev: 5.10.1
25+
hooks:
26+
- id: isort
27+
- repo: https://github.com/psf/black
28+
rev: 21.12b0
29+
hooks:
30+
- id: black
31+
args: [ --safe ]
32+
- repo: https://github.com/asottile/blacken-docs
33+
rev: v1.12.0
34+
hooks:
35+
- id: blacken-docs
36+
additional_dependencies: [ black==21.12b0 ]
37+
- repo: https://github.com/pre-commit/pygrep-hooks
38+
rev: v1.9.0
39+
hooks:
40+
- id: rst-backticks
41+
- repo: https://github.com/tox-dev/tox-ini-fmt
42+
rev: "0.5.1"
43+
hooks:
44+
- id: tox-ini-fmt
45+
args: [ "-p", "fix" ]
46+
- repo: https://github.com/asottile/setup-cfg-fmt
47+
rev: v1.20.0
48+
hooks:
49+
- id: setup-cfg-fmt
50+
args: [ --min-py3-version, "3.7", "--max-py-version", "3.10" ]
51+
- repo: https://github.com/PyCQA/flake8
52+
rev: 4.0.1
53+
hooks:
54+
- id: flake8
55+
additional_dependencies:
56+
- flake8-bugbear==21.11.29
57+
- flake8-comprehensions==3.7
58+
- flake8-pytest-style==1.6
59+
- flake8-spellcheck==0.24
60+
- flake8-unused-arguments==0.0.9
61+
- flake8-noqa==1.2.1
62+
- pep8-naming==0.12.1

0 commit comments

Comments
 (0)