Skip to content

Commit 1c3cffd

Browse files
authored
Update packaging and port to update layout (#119)
- Drop Python 2 - Drop Django<2.2 - Update tooling - Port to github-actions
1 parent 48833fa commit 1c3cffd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2321
-1529
lines changed

.coveragerc

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
[run]
2-
source = meta
32
branch = True
4-
omit =
5-
tests/*
6-
example/*
3+
source = meta
74

85
[report]
6+
omit = *migrations*,*tests*,*test_utils*
7+
# Regexes for lines to exclude from consideration
98
exclude_lines =
9+
# Have to re-enable the standard pragma
1010
pragma: no cover
11+
12+
# Don't complain about missing debug-only code:
1113
def __repr__
14+
if self\.debug
15+
16+
# Don't complain if tests don't hit defensive assertion code:
1217
raise AssertionError
1318
raise NotImplementedError
14-
if __name__ == .__main__.:
19+
20+
# Don't complain if non-runnable code isn't run:
21+
if 0:
22+
if __name__ == .__main__.:
23+
24+
ignore_errors = True
25+
26+
[html]
27+
directory = coverage_html

.editorconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ end_of_line = lf
88
charset = utf-8
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
11-
max_line_length = 80
11+
max_line_length = 120
1212

1313
[*.md]
1414
trim_trailing_whitespace = false
1515

1616
[*.rst]
17-
max_line_length = 80
17+
max_line_length = 120
1818

1919
[*.py]
2020
max_line_length = 120
@@ -24,11 +24,11 @@ indent_size = 2
2424
indent_style = space
2525
max_line_length = 120
2626

27-
[*.js]
27+
[*.{js,vue,json}]
2828
indent_size = 2
2929
max_line_length = 120
3030

31-
[*.yml]
31+
[*.{yml,yaml}]
3232
indent_size = 2
3333

3434
[Makefile]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: "\U0001F41B Bug report"
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'type: bug'
6+
assignees: ''
7+
8+
---
9+
10+
<!--
11+
Please fill in each section to help maintainers to be helpful and quick to respond.
12+
-->
13+
14+
## Description
15+
16+
<!--
17+
Describe issue in general terms.
18+
-->
19+
20+
## Steps to reproduce
21+
22+
<!--
23+
Provide clear steps to reproduce the issue.
24+
-->
25+
26+
## Versions
27+
28+
<!--
29+
Provide at least Python, Django and application version.
30+
-->
31+
32+
## Expected behaviour
33+
34+
<!--
35+
Provide what you would have expected to happen.
36+
-->
37+
38+
## Actual behaviour
39+
40+
<!--
41+
Provide what happened.
42+
-->
43+
44+
## Additional information
45+
46+
<!--
47+
Add any other information.
48+
-->
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: "\U0001F389 Feature request"
3+
about: Share your idea, let's discuss it!
4+
title: ''
5+
labels: 'type: feature'
6+
assignees: ''
7+
8+
---
9+
10+
<!--
11+
Please fill in each section to help maintainers to be helpful and quick to respond.
12+
-->
13+
14+
## Description
15+
16+
<!--
17+
Describe the feature in general terms.
18+
-->
19+
20+
## Use cases
21+
22+
<!--
23+
What use cases these feature will address?
24+
-->
25+
26+
## Proposed solution
27+
28+
<!--
29+
A clear and concise description of what you want to happen.
30+
-->
31+
32+
## Alternatives
33+
34+
<!--
35+
A clear and concise description of any alternative solutions or features you've considered.
36+
-->
37+
38+
## Additional information
39+
40+
<!--
41+
Add any other information.
42+
-->

.github/pull_request_template.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Description
2+
3+
Describe:
4+
5+
* Content of the pull request
6+
* Feature added / Problem fixed
7+
8+
## References
9+
10+
Provide any github issue fixed (as in ``Fix #XYZ``)
11+
12+
# Checklist
13+
14+
* [ ] I have read the [contribution guide](https://django-meta.readthedocs.io/en/latest/contributing.html)
15+
* [ ] Code lint checked via `inv lint`
16+
* [ ] ``changes`` file included (see [docs](https://django-meta.readthedocs.io/en/latest/contributing.html#pull-request-guidelines))
17+
* [ ] Usage documentation added in case of new features
18+
* [ ] Tests added

.github/workflows/lint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Code quality
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
9+
strategy:
10+
matrix:
11+
python-version: [3.8]
12+
toxenv: [pep8, isort, black, pypi-description, docs, towncrier]
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
repository: ${{ github.event.pull_request.head.repo.full_name }}
17+
ref: ${{ github.event.pull_request.head.ref }}
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Cache pip
23+
uses: actions/cache@v1
24+
with:
25+
path: ~/.cache/pip
26+
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
27+
restore-keys: |
28+
${{ runner.os }}-pip-${{ matrix.toxenv }}
29+
- name: Cache tox
30+
uses: actions/cache@v1
31+
with:
32+
path: .tox
33+
key: ${{ runner.os }}-lint-${{ matrix.toxenv }}-${{ hashFiles('setup.cfg') }}
34+
restore-keys: |
35+
${{ runner.os }}-lint-${{ matrix.toxenv }}-
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip setuptools tox>=1.8
39+
- name: Test with tox
40+
run: |
41+
tox -e${{ matrix.toxenv }}

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published,prereleased]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: '3.x'
16+
- name: Cache pip
17+
uses: actions/cache@v1
18+
with:
19+
path: ~/.cache/pip
20+
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
21+
restore-keys: |
22+
${{ runner.os }}-pip-${{ matrix.toxenv }}
23+
- name: Cache tox
24+
uses: actions/cache@v1
25+
with:
26+
path: .tox
27+
key: ${{ runner.os }}-tox-release-${{ hashFiles('setup.cfg') }}
28+
restore-keys: |
29+
${{ runner.os }}-tox-release-
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip setuptools tox>=1.8
33+
- name: Build and publish
34+
env:
35+
TWINE_USERNAME: __token__
36+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
37+
run: |
38+
tox -erelease

.github/workflows/test.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Tox tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: [3.8, 3.7, 3.6, 3.5]
12+
django: [31,30, 22]
13+
sekizai: [sekizai,nosekizai]
14+
exclude:
15+
- python-version: 3.5
16+
django: 30
17+
- python-version: 3.5
18+
django: 31
19+
- django: 31
20+
sekizai: sekizai
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v1
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Cache pip
28+
uses: actions/cache@v1
29+
with:
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-${{ matrix.toxenv }}
34+
- name: Cache tox
35+
uses: actions/cache@v1
36+
with:
37+
path: .tox
38+
key: ${{ runner.os }}-tox-${{ format('py-django{1}-{2}', matrix.python-version, matrix.django, matrix.sekizai) }}-${{ hashFiles('setup.cfg') }}
39+
restore-keys: |
40+
${{ runner.os }}-tox-${{ format('py-django{1}-{2}', matrix.python-version, matrix.django, matrix.sekizai) }}-
41+
- name: Install dependencies
42+
run: |
43+
sudo apt-get install gettext
44+
python -m pip install --upgrade pip tox>=3.5
45+
- name: Test with tox
46+
env:
47+
TOX_ENV: ${{ format('py-django{1}-{2}', matrix.python-version, matrix.django, matrix.sekizai) }}
48+
COMMAND: coverage run
49+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
COVERALLS_SERVICE_NAME: github
51+
run: |
52+
tox -e$TOX_ENV
53+
.tox/$TOX_ENV/bin/coverage xml
54+
.tox/$TOX_ENV/bin/coveralls
55+
- uses: codecov/codecov-action@v1
56+
with:
57+
token: ${{ secrets.CODECOV_TOKEN }}
58+
flags: unittests
59+
file: ./coverage.xml
60+
fail_ci_if_error: false
61+
services:
62+
redis:
63+
image: redis
64+
ports:
65+
- 6379:6379

0 commit comments

Comments
 (0)