Skip to content

Commit df4c1cc

Browse files
committed
Update github actions integration
1 parent 4d62447 commit df4c1cc

File tree

8 files changed

+175
-111
lines changed

8 files changed

+175
-111
lines changed

.bumpversion.cfg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[bumpversion]
2+
current_version = 0.0.4
3+
commit = true
4+
tag = true
5+
tag_name = {new_version}
6+
7+
[bumpversion:file:setup.py]
8+
9+
[bumpversion:file:docs/conf.py]
10+
11+
[bumpversion:file:src/django_session_timeout/__init__.py]

.github/workflows/python-package.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release to PyPi
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python 3.7
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.7
16+
- name: Install build requirements
17+
run: python -m pip install wheel
18+
- name: Build package
19+
run: python setup.py sdist bdist_wheel
20+
- name: Publish package
21+
uses: pypa/gh-action-pypi-publish@master
22+
with:
23+
user: __token__
24+
password: ${{ secrets.pypi_password }}

.github/workflows/python-test.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Python Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
7+
format:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Python 3.7
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.7
15+
- name: Install dependencies
16+
run: pip install tox
17+
- name: Validate formatting
18+
run: tox -e format
19+
20+
test:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
max-parallel: 4
24+
matrix:
25+
tox_env:
26+
- py36-django22
27+
- py36-django30
28+
- py37-django22
29+
- py37-django30
30+
- py38-django22
31+
- py38-django30
32+
include:
33+
- python-version: 3.6
34+
tox_env: py36-django22
35+
- python-version: 3.6
36+
tox_env: py36-django30
37+
- python-version: 3.7
38+
tox_env: py37-django22
39+
- python-version: 3.7
40+
tox_env: py37-django30
41+
- python-version: 3.8
42+
tox_env: py38-django22
43+
- python-version: 3.8
44+
tox_env: py38-django30
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Set up Python ${{ matrix.python-version }}
49+
uses: actions/setup-python@v1
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install tox tox-gh-actions
56+
- name: Test with tox
57+
run: tox -e ${{ matrix.tox_env }}
58+
- name: Prepare artifacts
59+
run: mkdir .coverage-data && mv .coverage.* .coverage-data/
60+
- uses: actions/upload-artifact@master
61+
with:
62+
name: coverage-data
63+
path: .coverage-data/
64+
65+
coverage:
66+
runs-on: ubuntu-latest
67+
needs: [test]
68+
steps:
69+
- uses: actions/checkout@v2
70+
- uses: actions/download-artifact@master
71+
with:
72+
name: coverage-data
73+
path: .
74+
- name: Set up Python 3.7
75+
uses: actions/setup-python@v1
76+
with:
77+
python-version: 3.7
78+
- name: Install dependencies
79+
run: |
80+
python -m pip install --upgrade pip
81+
pip install tox
82+
- name: Prepare Coverage report
83+
run: tox -e coverage-report
84+
- name: Upload to codecov
85+
uses: codecov/[email protected]

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
[build-system]
3+
requires = ["setuptools>=40.6.0", "wheel"]
4+
build-backend = "setuptools.build_meta"
5+
6+
[tool.coverage.run]
7+
branch = true
8+
source = ["django_session_timeout"]
9+
10+
[tool.coverage.paths]
11+
source = ["src", ".tox/*/site-packages"]
12+
13+
[tool.coverage.report]
14+
show_missing = true
15+
16+
[tool.isort]
17+
line_length = 88
18+
multi_line_output = 3
19+
include_trailing_comma = true
20+
balanced_wrapping = true
21+
default_section = "THIRDPARTY"
22+
known_first_party = ["django_session_timeout", "tests"]
23+
use_parentheses = true
24+
indent_style = "space"
25+
indent_size = 4
26+
tab_width = 4

setup.cfg

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,7 @@
1-
[bumpversion]
2-
current_version = 0.0.4
3-
commit = true
4-
tag = true
5-
tag_name = {new_version}
6-
71
[tool:pytest]
82
minversion = 3.0
93
strict = true
104
testpaths = tests
115

126
[wheel]
137
universal = 1
14-
15-
[flake8]
16-
max-line-length = 99
17-
18-
[bumpversion:file:setup.py]
19-
20-
[bumpversion:file:docs/conf.py]
21-
22-
[bumpversion:file:src/django_session_timeout/__init__.py]
23-
24-
[coverage:run]
25-
branch = True
26-
source =
27-
django_session_timeout
28-
29-
[coverage:paths]
30-
source =
31-
src/django_session_timeout
32-
.tox/*/lib/python*/site-packages/django_session_timeout
33-
.tox/pypy*/site-packages/django_session_timeout
34-
35-
[coverage:report]
36-
show_missing = True
37-

setup.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
docs_require = ["sphinx>=1.8.4"]
66

77
tests_require = [
8-
"coverage==4.5.3",
9-
"freezegun==0.3.11",
10-
"pytest==4.3.1",
11-
"pytest-django==3.4.8",
12-
"pytest-cov==2.6.1",
8+
"coverage[toml]==5.0.3",
9+
"freezegun==0.3.15",
10+
"pytest==5.3.5",
11+
"pytest-django==3.8.0",
12+
"pytest-cov==2.8.1",\
1313
# Linting
14-
"isort==4.3.15",
15-
"flake8==3.7.7",
14+
"isort[pyproject]==4.3.21",
15+
"flake8==3.7.9",
1616
"flake8-blind-except==0.1.1",
1717
"flake8-debugger==3.1.0",
1818
]
@@ -47,10 +47,10 @@
4747
"Development Status :: 5 - Production/Stable",
4848
"Environment :: Web Environment",
4949
"Framework :: Django",
50-
"Framework :: Django :: 1.11",
5150
"Framework :: Django :: 2.0",
5251
"Framework :: Django :: 2.1",
5352
"Framework :: Django :: 2.2",
53+
"Framework :: Django :: 3.0",
5454
"License :: OSI Approved :: MIT License",
5555
"Programming Language :: Python",
5656
"Programming Language :: Python :: 3",

tox.ini

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
11
[tox]
2-
envlist =
3-
py{36,37}-django111
4-
py{36,37}-django22
2+
envlist = py{36,37,38}-django{22,30}
3+
4+
5+
[gh-actions]
6+
python =
7+
3.6: py36
8+
3.7: py37
9+
3.8: py38
510

611
[testenv]
712
commands = coverage run --source django_session_timeout --parallel -m pytest {posargs}
813
deps =
9-
django111: Django>=1.11,<1.12
1014
django22: Django>=2.2,<2.3
15+
django30: Django>=3.0,<3.1
1116
extras = test
1217

1318
[testenv:coverage-report]
14-
deps = coverage
19+
basepython = python3.7
20+
deps = coverage[toml]
1521
skip_install = true
1622
commands =
1723
coverage combine
1824
coverage xml
1925
coverage report
26+
27+
[testenv:format]
28+
basepython = python3.7
29+
deps =
30+
black
31+
isort[toml]
32+
skip_install = true
33+
commands =
34+
isort --recursive --check-only src tests
35+
black --check src/ tests/

0 commit comments

Comments
 (0)