Skip to content

Commit c5bb3cd

Browse files
authored
Update tooling (nephila#568)
* Move package metadata to setup.cfg * Port to github actions * Add towncrier * Add bumpversion * Add pre-commit * Add github issues / PR templates * Improve contributing documentation * Reformat code
1 parent ec83f5f commit c5bb3cd

File tree

151 files changed

+4841
-3826
lines changed

Some content is hidden

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

151 files changed

+4841
-3826
lines changed

.codeclimate.yml

-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ languages:
55
Python: true
66
exclude_paths:
77
- 'djangocms_blog/migrations/*'
8-
- 'djangocms_blog/south_migrations/*'
98
- 'tests/*'

.coveragerc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ branch = True
33
source = djangocms_blog
44

55
[report]
6-
omit = ../*migrations*,../*tests*,../*compat.*
6+
omit = *migrations*,*tests*,*test_utils*
77
# Regexes for lines to exclude from consideration
88
exclude_lines =
99
# Have to re-enable the standard pragma

.editorconfig

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@ 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]
20-
max_line_length = 100
20+
max_line_length = 120
2121

2222
[*.{scss,html}]
2323
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]
+48
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+
-->
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

+18
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-app-helper.readthedocs.io/en/latest/contributing.html)
15+
* [ ] Code lint checked via `inv lint`
16+
* [ ] ``changes`` file included (see [docs](https://django-app-helper.readthedocs.io/en/latest/contributing.html#pull-request-guidelines))
17+
* [ ] Usage documentation added in case of new features
18+
* [ ] Tests added

.github/workflows/publish.yml

+38
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

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Linting - Tests
2+
3+
on: [push]
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+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Cache pip
20+
uses: actions/cache@v1
21+
with:
22+
path: ~/.cache/pip
23+
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
24+
restore-keys: |
25+
${{ runner.os }}-pip-${{ matrix.toxenv }}
26+
- name: Cache tox
27+
uses: actions/cache@v1
28+
with:
29+
path: .tox
30+
key: ${{ runner.os }}-lint-${{ matrix.toxenv }}-${{ hashFiles('setup.cfg') }}
31+
restore-keys: |
32+
${{ runner.os }}-lint-${{ matrix.toxenv }}-
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip setuptools tox>=1.8
36+
- name: Test with tox
37+
run: |
38+
tox -e${{ matrix.toxenv }}
39+
40+
test:
41+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
python-version: [3.8, 3.7, 3.6, 3.5]
46+
django: [30, 22]
47+
cms: [37]
48+
exclude:
49+
- python-version: 3.5
50+
django: 30
51+
steps:
52+
- uses: actions/checkout@v2
53+
- name: Set up Python ${{ matrix.python-version }}
54+
uses: actions/setup-python@v1
55+
with:
56+
python-version: ${{ matrix.python-version }}
57+
- name: Cache pip
58+
uses: actions/cache@v1
59+
with:
60+
path: ~/.cache/pip
61+
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
62+
restore-keys: |
63+
${{ runner.os }}-pip-${{ matrix.toxenv }}
64+
- name: Cache tox
65+
uses: actions/cache@v1
66+
with:
67+
path: .tox
68+
key: ${{ runner.os }}-tox-${{ format('{{py{0}-django{1}-cms{2}}}', matrix.python-version, matrix.django, matrix.cms) }}-${{ hashFiles('setup.cfg') }}
69+
restore-keys: |
70+
${{ runner.os }}-tox-${{ format('{{py{0}-django{1}-cms{2}}}', matrix.python-version, matrix.django, matrix.cms) }}-
71+
- name: Install dependencies
72+
run: |
73+
sudo apt-get install gettext
74+
python -m pip install --upgrade pip tox>=3.5
75+
- name: Test with tox
76+
env:
77+
TOX_ENV: ${{ format('py{0}-django{1}-cms{2}', matrix.python-version, matrix.django, matrix.cms) }}
78+
COMMAND: coverage run
79+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
80+
run: |
81+
tox -e$TOX_ENV
82+
.tox/$TOX_ENV/bin/coverage xml
83+
.tox/$TOX_ENV/bin/coveralls
84+
- uses: codecov/codecov-action@v1
85+
with:
86+
token: ${{ secrets.CODECOV_TOKEN }}
87+
flags: unittests
88+
file: ./coverage.xml
89+
fail_ci_if_error: false
90+
services:
91+
redis:
92+
image: redis
93+
ports:
94+
- 6379:6379

0 commit comments

Comments
 (0)