Skip to content

Commit 036d0d0

Browse files
committed
untox
1 parent b781431 commit 036d0d0

File tree

6 files changed

+86
-103
lines changed

6 files changed

+86
-103
lines changed

.github/workflows/main.yml

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,21 @@ jobs:
1414
tests:
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 10
17+
env:
18+
PYTHONPATH: "."
1719
strategy:
1820
matrix:
19-
python-version: [3.8, 3.9, "3.10", 3.11-dev]
20-
21+
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
22+
python-version: [3.8, 3.9, "3.10", 3.11.0-beta.5]
23+
django-version:
24+
- "Django>=3.2,<4.0"
25+
- "Django>=4.0,<4.1"
26+
- "Django>=4.1,<4.2"
27+
- "https://github.com/django/django/archive/main.tar.gz"
28+
include:
29+
- drf: djangorestframework
30+
python-version: "3.10"
31+
django-version: "Django<4.2,>=4.1" # must be different from django-version
2132
steps:
2233
- uses: actions/checkout@v3
2334
- uses: actions/setup-python@v4
@@ -30,14 +41,33 @@ jobs:
3041
if: endsWith(matrix.python-version, '-dev')
3142
with:
3243
python-version: ${{ matrix.python-version }}
33-
- name: Install Tox
34-
run: python -m pip install tox tox-gh-actions
35-
- name: Run Tox
36-
run: python -m tox
44+
- name: Install deps
45+
run: |
46+
python -m pip install -e .[test]
47+
python -m pip install "${{ matrix.django-version }}" ${{ matrix.drf }}
48+
- run: pytest
49+
50+
lint:
51+
runs-on: ubuntu-latest
52+
timeout-minutes: 10
53+
env:
54+
PYTHONPATH: "."
55+
steps:
56+
- uses: actions/checkout@v3
57+
- uses: actions/setup-python@v4
58+
with:
59+
python-version: "3.10"
60+
cache: 'pip'
61+
cache-dependency-path: 'setup.cfg'
62+
- uses: actions/cache@v3
63+
with:
64+
path: ~/.cache/pre-commit
65+
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
66+
- run: python -m pip install -e .[dev]
67+
- run: pre-commit run --show-diff-on-failure --color=always --all-files
3768

3869
package:
3970
runs-on: ubuntu-latest
40-
needs: tests
4171
timeout-minutes: 5
4272
steps:
4373
- uses: actions/checkout@v3
@@ -62,7 +92,7 @@ jobs:
6292

6393
publish:
6494
runs-on: ubuntu-latest
65-
needs: [tests, package]
95+
needs: [package, tests, lint]
6696
if: startsWith(github.ref, 'refs/tags/v')
6797
timeout-minutes: 5
6898
steps:
@@ -113,4 +143,4 @@ jobs:
113143
release_name: Release ${{ steps.release_output.outputs.VERSION }}
114144
body: ${{ steps.release_output.outputs.BODY }}
115145
draft: false
116-
prerelease: false
146+
prerelease: ${{ contains(steps.release_output.outputs.VERSION, 'rc') || contains(steps.release_output.outputs.VERSION, 'b') || contains(steps.release_output.outputs.VERSION, 'b') }}

.pre-commit-config.yaml

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,56 @@ repos:
44
hooks:
55
- id: seed-isort-config
66

7-
- repo: https://github.com/pre-commit/mirrors-isort
8-
rev: v5.10.1
9-
hooks:
10-
- id: isort
7+
- repo: https://github.com/pre-commit/mirrors-isort
8+
rev: v5.10.1
9+
hooks:
10+
- id: isort
1111

1212
- repo: https://github.com/asottile/pyupgrade
1313
rev: v2.37.3
1414
hooks:
1515
- id: pyupgrade
1616
args: ["--py36-plus"]
1717

18-
- repo: https://github.com/psf/black
19-
rev: 22.6.0
20-
hooks:
21-
- id: black
22-
types: [python]
18+
- repo: https://github.com/psf/black
19+
rev: 22.6.0
20+
hooks:
21+
- id: black
22+
types: [python]
2323

24-
- repo: https://github.com/pycqa/flake8
25-
rev: 5.0.4
26-
hooks:
27-
- id: flake8
28-
additional_dependencies:
29-
[
30-
"flake8-bugbear",
31-
]
24+
- repo: https://github.com/pycqa/flake8
25+
rev: 5.0.4
26+
hooks:
27+
- id: flake8
28+
additional_dependencies: ["flake8-bugbear"]
3229

33-
- repo: https://github.com/pre-commit/pre-commit-hooks
34-
rev: v4.3.0
35-
hooks:
30+
- repo: https://github.com/pre-commit/pre-commit-hooks
31+
rev: v4.3.0
32+
hooks:
3633
- id: trailing-whitespace
3734
- id: end-of-file-fixer
3835
- id: debug-statements
3936
- id: check-added-large-files
4037
- id: check-merge-conflict
4138
- id: mixed-line-ending
4239
args: ["--fix=lf"]
40+
41+
- repo: https://github.com/mgedmin/check-manifest
42+
rev: "0.48"
43+
hooks:
44+
- id: check-manifest
45+
46+
- repo: local
47+
hooks:
48+
- id: mypy
49+
name: mypy
50+
language: system
51+
entry: mypy
52+
args: [src/extra_checks, tests]
53+
pass_filenames: false
54+
- id: django-check
55+
name: django check
56+
language: system
57+
entry: env DJANGO_SETTINGS_MODULE=tests.settings django-admin
58+
args: [check, --fail-level, CRITICAL]
59+
pass_filenames: false

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ EXTRA_CHECKS = {
119119

120120
## Development
121121

122-
Install dev deps in virtualenv `pip install -e .[dev]`.
122+
Install dev deps in virtualenv `pip install -e .[dev,test]`.
123123

124124
## Credits
125125

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ install_requires =
3737
where = src
3838

3939
[options.extras_require]
40-
dev =
40+
test =
4141
pytest
4242
pytest-cov
4343
pytest-django
44+
45+
dev =
4446
Django
4547
djangorestframework
4648
django-stubs
@@ -50,7 +52,6 @@ dev =
5052
pre-commit
5153
isort
5254
pdbpp
53-
tox
5455
black
5556

5657
[flake8]

shell.nix

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
{ pkgs ? import <nixpkgs> { }, system ? builtins.currentSystem }:
2-
with pkgs;
1+
{ nixpkgs ? import <nixpkgs> { }, system ? builtins.currentSystem }:
32
let
43
devshellSrc = fetchTarball {
5-
url = "https://github.com/numtide/devshell/archive/f87fb932740abe1c1b46f6edd8a36ade17881666.tar.gz";
6-
sha256 = "10cimkql88h7jfjli89i8my8j5la91zm4c78djqlk22dqrxmm6bs";
4+
url = "https://github.com/numtide/devshell/archive/f55e05c6d3bbe9acc7363bc8fc739518b2f02976.tar.gz";
5+
sha256 = "0fv6jgwrcm04q224hd19inlvwaagp86175jykjdrsm7dh3gz0xp7";
76
};
8-
devshell = import devshellSrc { inherit system pkgs; };
7+
devshell = import devshellSrc { inherit system nixpkgs; };
98
in
109
devshell.mkShell {
1110
name = "django-extra-checks";
1211
packages = [
13-
python310
12+
nixpkgs.python310
1413
];
1514

1615
env = [
@@ -37,7 +36,7 @@ devshell.mkShell {
3736
{
3837
help = "install dev deps";
3938
name = "app.install";
40-
command = "pip install -U pip wheel && pip install -e .[dev] && pre-commit install";
39+
command = "pip install -U pip wheel && pip install -e .[dev,test] && pre-commit install";
4140
}
4241
{
4342
help = "typecheck project";

tox.ini

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

0 commit comments

Comments
 (0)