Skip to content

Commit 88b318f

Browse files
Switch to make-based tooling (#198)
* Switch to make-based tooling * Fix Makefile for Windows * Drop windows
1 parent bc29248 commit 88b318f

File tree

13 files changed

+66
-133
lines changed

13 files changed

+66
-133
lines changed

β€ŽCONTRIBUTING.mdβ€Ž

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,52 +16,52 @@ Here are a few ways in which you can help:
1616
1. Clone it on your machine.
1717
1. Install dependencies:
1818

19-
```bash
20-
scripts/install
19+
```
20+
make install
2121
```
2222

2323
### Tests
2424

2525
Run the tests using:
2626

27-
```bash
28-
scripts/test
27+
```
28+
make test
2929
```
3030

3131
### Code style
3232

3333
Run code auto-formatting with:
3434

35-
```bash
36-
scripts/lint
35+
```
36+
make format
3737
```
3838

3939
Run code style checks using:
4040

41-
```bash
42-
scripts/check
41+
```
42+
make check
4343
```
4444

4545
### Generating migrations
4646

4747
This package includes migrations. To update them in case of changes without setting up a Django project, run:
4848

49-
```bash
50-
scripts/makemigrations
49+
```
50+
make migrations
5151
```
5252

5353
### Documentation
5454

55-
Serve the docs site locally (with hot-reload) using:
55+
Build the documentation using:
5656

57-
```bash
58-
scripts/serve
57+
```
58+
make docs
5959
```
6060

61-
Build the documentation using:
61+
Serve the docs site locally (with hot-reload) using:
6262

63-
```bash
64-
scripts/docs build
63+
```
64+
make docs-serve
6565
```
6666

6767
## Notes to maintainers
@@ -76,4 +76,4 @@ scripts/docs build
7676
- Release title, `Version 2.1.0`.
7777
- Description copied from the changelog.
7878
- Once created, this release will be automatically uploaded to PyPI via a publish job on Azure Pipelines.
79-
- Deploy the docs using: `scripts/docs gh-deploy`
79+
- Deploy the docs using: `make docs-deploy`

β€ŽMakefileβ€Ž

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
venv = venv
2+
bin = ${venv}/bin/
3+
pysources = src/ test_project/ tests/
4+
pysources_mypy = src/ test_project/ tests/conftest.py
5+
6+
build:
7+
${python} setup.py sdist bdist_wheel
8+
${bin}twine check dist/*
9+
rm -r build
10+
11+
check:
12+
${bin}black --check --diff --target-version=py36 ${pysources}
13+
${bin}flake8 ${pysources}
14+
${bin}mypy ${pysources_mypy}
15+
${bin}isort --check --diff ${pysources}
16+
make migrations-check
17+
18+
docs:
19+
${bin}mkdocs build
20+
21+
docs-serve:
22+
${bin}mkdocs serve
23+
24+
docs-deploy:
25+
${bin}mkdocs gh-deploy
26+
27+
install:
28+
python3 -m venv ${venv}
29+
${bin}pip install -U pip wheel
30+
${bin}pip install -r requirements.txt
31+
32+
format:
33+
${bin}autoflake --in-place --recursive ${pysources}
34+
${bin}isort ${pysources}
35+
${bin}black --target-version=py36 ${pysources}
36+
37+
migrations:
38+
${bin}python -m tools.makemigrations
39+
40+
migrations-check:
41+
${bin}python -m tools.makemigrations --check
42+
43+
publish:
44+
${bin}twine upload dist/*
45+
46+
test:
47+
${bin}pytest

β€Žci/azure-pipelines.ymlβ€Ž

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resources:
44
type: github
55
endpoint: github
66
name: florimondmanca/azure-pipelines-templates
7-
ref: refs/tags/4.0
7+
ref: refs/tags/5.0
88
containers:
99
- container: pg11
1010
image: postgres:11
@@ -56,9 +56,6 @@ stages:
5656
variables:
5757
DJANGO_VERSION: "3.2.*"
5858

59-
py38_windows:
60-
os: windows
61-
6259
py38_postgres:
6360
services:
6461
postgres: pg11

β€Žscripts/buildβ€Ž

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

β€Žscripts/checkβ€Ž

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

β€Žscripts/docsβ€Ž

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

β€Žscripts/envβ€Ž

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

β€Žscripts/installβ€Ž

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

β€Žscripts/lintβ€Ž

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

β€Žscripts/publishβ€Ž

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

0 commit comments

Comments
Β (0)