Skip to content

Commit a74fa77

Browse files
authored
Drop python 2 / Django < 2.2 (#136)
* Drop python 2 / Django < 2.2 Update tooling: - github actions - pre-commit - towncrier / bump2version * Add Django 3.1 / django CMS 3.8
1 parent 24422b9 commit a74fa77

Some content is hidden

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

77 files changed

+2455
-1244
lines changed

.checkignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tests/*
2+
docs/*
23
djangocms_page_meta/migrations/*
3-
djangocms_page_meta/south_migrations/*

.codeclimate.yml

+6-28
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,8 @@
1-
---
2-
engines:
3-
csslint:
4-
enabled: true
5-
duplication:
6-
enabled: true
7-
config:
8-
languages:
9-
- ruby
10-
- javascript
11-
- python
12-
- php
13-
fixme:
14-
enabled: true
15-
radon:
16-
enabled: true
17-
ratings:
18-
paths:
19-
- "**.css"
20-
- "**.inc"
21-
- "**.js"
22-
- "**.jsx"
23-
- "**.module"
24-
- "**.php"
25-
- "**.py"
26-
- "**.rb"
1+
languages:
2+
Ruby: false
3+
JavaScript: false
4+
PHP: false
5+
Python: true
276
exclude_paths:
287
- 'djangocms_page_meta/migrations/*'
29-
- 'djangocms_page_meta/south_migrations/*'
30-
- tests/
8+
- 'tests/*'

.coveragerc

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

55
[report]
6-
omit = ../*migrations*,../*tests*
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

+6-6
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}]
23-
indent_size = 4
23+
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://djangocms-page-meta.readthedocs.io/en/latest/contributing.html)
15+
* [ ] Code lint checked via `inv lint`
16+
* [ ] ``changes`` file included (see [docs](https://djangocms-page-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

+41
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@v2
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

+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@v2
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

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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]
12+
django: [31, 30, 22]
13+
cms: [38, 37]
14+
exclude:
15+
- django: 31
16+
cms: 37
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Cache pip
24+
uses: actions/cache@v1
25+
with:
26+
path: ~/.cache/pip
27+
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
28+
restore-keys: |
29+
${{ runner.os }}-pip-${{ matrix.toxenv }}
30+
- name: Cache tox
31+
uses: actions/cache@v1
32+
with:
33+
path: .tox
34+
key: ${{ runner.os }}-tox-${{ format('{{py{0}-django{1}-cms{2}}}', matrix.python-version, matrix.django, matrix.cms) }}-${{ hashFiles('setup.cfg') }}
35+
restore-keys: |
36+
${{ runner.os }}-tox-${{ format('{{py{0}-django{1}-cms{2}}}', matrix.python-version, matrix.django, matrix.cms) }}-
37+
- name: Install dependencies
38+
run: |
39+
sudo apt-get install gettext
40+
python -m pip install --upgrade pip tox>=3.5
41+
- name: Test with tox
42+
env:
43+
TOX_ENV: ${{ format('py-django{1}-cms{2}', matrix.python-version, matrix.django, matrix.cms) }}
44+
COMMAND: coverage run
45+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
COVERALLS_SERVICE_NAME: github
47+
run: |
48+
tox -e$TOX_ENV
49+
.tox/$TOX_ENV/bin/coverage xml
50+
.tox/$TOX_ENV/bin/coveralls
51+
- uses: codecov/codecov-action@v1
52+
with:
53+
token: ${{ secrets.CODECOV_TOKEN }}
54+
flags: unittests
55+
file: ./coverage.xml
56+
fail_ci_if_error: false
57+
services:
58+
redis:
59+
image: redis
60+
ports:
61+
- 6379:6379

0 commit comments

Comments
 (0)