Skip to content

Commit 0385fde

Browse files
committed
skip some tests on 3.7, add pre-commit
1 parent 6af0ae7 commit 0385fde

File tree

11 files changed

+44
-44
lines changed

11 files changed

+44
-44
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ jobs:
2121

2222
- run: pip install -r requirements/linting.txt -r requirements/pyproject.txt
2323

24-
- run: make lint
24+
- run: mypy devtools
25+
26+
- uses: pre-commit/[email protected]
27+
with:
28+
extra_args: --all-files --verbose
2529

2630
test:
2731
name: test py${{ matrix.python-version }} on ${{ matrix.os }}

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: check-toml
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
10+
- repo: local
11+
hooks:
12+
- id: ruff
13+
name: Ruff
14+
entry: ruff
15+
args: [--fix, --exit-non-zero-on-fix]
16+
types: [python]
17+
language: system
18+
files: ^devtools/|^tests/
19+
- id: black
20+
name: Black
21+
entry: black
22+
types: [python]
23+
language: system
24+
files: ^devtools/|^tests/
25+
exclude: test_expr_render.py

HISTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## v0.7.0 (2021-09-03)
1616

17-
* switch to [`executing`](https://pypi.org/project/executing/) and [`asttokens`](https://pypi.org/project/asttokens/)
17+
* switch to [`executing`](https://pypi.org/project/executing/) and [`asttokens`](https://pypi.org/project/asttokens/)
1818
for finding and printing debug arguments, #82, thanks @alexmojaki
1919
* correct changelog links, #76, thanks @Cielquan
2020
* return `debug()` arguments, #87

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ sources = devtools tests docs/plugins.py
33

44
.PHONY: install
55
install:
6-
python -m pip install -U pip
6+
python -m pip install -U pip pre-commit
77
pip install -U -r requirements/all.txt
88
pip install -e .
9+
pre-commit install
910

1011
.PHONY: refresh-lockfiles
1112
refresh-lockfiles:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ outputs:
6464
devtools can be used without `from devtools import debug` if you add `debug` into `__builtins__`
6565
in `sitecustomize.py`.
6666

67-
For instructions on adding `debug` to `__builtins__`,
67+
For instructions on adding `debug` to `__builtins__`,
6868
see the [installation docs](https://python-devtools.helpmanual.io/usage/#usage-without-import).

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Two ways to do this:
9696
### Automatic install
9797

9898
!!! warning
99-
This is experimental, please [create an issue](https://github.com/samuelcolvin/python-devtools/issues)
99+
This is experimental, please [create an issue](https://github.com/samuelcolvin/python-devtools/issues)
100100
if you encounter any problems.
101101

102102
To install `debug` into `__builtins__` automatically, run:

requirements/docs.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.7
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile --output-file=requirements/docs.txt --resolver=backtracking requirements/docs.in
@@ -11,11 +11,7 @@ click==8.1.3
1111
ghp-import==2.1.0
1212
# via mkdocs
1313
importlib-metadata==6.1.0
14-
# via
15-
# ansi2html
16-
# click
17-
# markdown
18-
# mkdocs
14+
# via mkdocs
1915
jinja2==3.1.2
2016
# via
2117
# mkdocs
@@ -65,8 +61,6 @@ pyyaml-env-tag==0.1
6561
# via mkdocs
6662
six==1.16.0
6763
# via python-dateutil
68-
typing-extensions==4.5.0
69-
# via importlib-metadata
7064
watchdog==3.0.0
7165
# via mkdocs
7266
zipp==3.15.0

requirements/linting.txt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.7
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile --output-file=requirements/linting.txt --resolver=backtracking requirements/linting.in
@@ -8,10 +8,6 @@ black==23.3.0
88
# via -r requirements/linting.in
99
click==8.1.3
1010
# via black
11-
importlib-metadata==6.1.0
12-
# via
13-
# click
14-
# sqlalchemy
1511
mypy==0.971
1612
# via -r requirements/linting.in
1713
mypy-extensions==1.0.0
@@ -32,16 +28,7 @@ tomli==2.0.1
3228
# via
3329
# black
3430
# mypy
35-
typed-ast==1.5.4
36-
# via
37-
# black
38-
# mypy
3931
typing-extensions==4.5.0
4032
# via
41-
# black
42-
# importlib-metadata
4333
# mypy
44-
# platformdirs
4534
# sqlalchemy
46-
zipp==3.15.0
47-
# via importlib-metadata

requirements/pyproject.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.7
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile --output-file=requirements/pyproject.txt --resolver=backtracking pyproject.toml

requirements/testing.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ pytest-pretty
66
# these packages are used in tests so install the latest version
77
pydantic
88
asyncpg
9-
numpy
10-
multidict
9+
numpy; python_version>='3.8'
10+
multidict; python_version>='3.8'
1111
sqlalchemy

requirements/testing.txt

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.7
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile --output-file=requirements/testing.txt --resolver=backtracking requirements/testing.in
@@ -12,20 +12,15 @@ coverage[toml]==7.2.2
1212
# via -r requirements/testing.in
1313
exceptiongroup==1.1.1
1414
# via pytest
15-
importlib-metadata==6.1.0
16-
# via
17-
# pluggy
18-
# pytest
19-
# sqlalchemy
2015
iniconfig==2.0.0
2116
# via pytest
2217
markdown-it-py==2.2.0
2318
# via rich
2419
mdurl==0.1.2
2520
# via markdown-it-py
26-
multidict==6.0.4
21+
multidict==6.0.4 ; python_version >= "3.8"
2722
# via -r requirements/testing.in
28-
numpy==1.21.6
23+
numpy==1.24.2 ; python_version >= "3.8"
2924
# via -r requirements/testing.in
3025
packaging==23.0
3126
# via pytest
@@ -56,11 +51,5 @@ tomli==2.0.1
5651
# pytest
5752
typing-extensions==4.5.0
5853
# via
59-
# asyncpg
60-
# importlib-metadata
61-
# markdown-it-py
6254
# pydantic
63-
# rich
6455
# sqlalchemy
65-
zipp==3.15.0
66-
# via importlib-metadata

0 commit comments

Comments
 (0)