File tree Expand file tree Collapse file tree 3 files changed +118
-53
lines changed Expand file tree Collapse file tree 3 files changed +118
-53
lines changed Original file line number Diff line number Diff line change 8
8
pull_request :
9
9
10
10
jobs :
11
- modernize :
11
+ tox :
12
12
runs-on : ${{ matrix.os }}
13
13
strategy :
14
14
fail-fast : false
34
34
uses : actions/cache@v2
35
35
with :
36
36
path : ${{ steps.pip-cache.outputs.dir }}
37
- key : ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }}
37
+ key :
38
+ ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml', 'setup.py',
39
+ ' setup.cfg' ) }}
38
40
restore-keys : |
39
41
${{ runner.os }}-pip-
40
42
45
47
- name : tox
46
48
env :
47
49
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48
- run : tox -e py,lint,coveralls
50
+ run : tox -e py,lint,coveralls,release
51
+
52
+ - name : upload dist
53
+ uses : actions/upload-artifact@v2
54
+ with :
55
+ name : ${{ matrix.os }}_${{ matrix.python-version}}_dist
56
+ path : dist
57
+
58
+ all-successful :
59
+ # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
60
+ runs-on : ubuntu-latest
61
+ needs : [tox]
62
+ steps :
63
+ - name : Download dists for PyPI
64
+ uses : actions/download-artifact@v2
65
+ with :
66
+ name : ubuntu-latest_3.8_dist
67
+
68
+ - name : Publish package
69
+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
70
+ uses : pypa/gh-action-pypi-publish@master
71
+ with :
72
+ user : __token__
73
+ password : ${{ secrets.pypi_password }}
74
+
75
+ - name : note that all tests succeeded
76
+ run : echo "🎉"
Original file line number Diff line number Diff line change
1
+ [build-system ]
2
+ requires = [ " setuptools >= 35.0.2" , " wheel >= 0.29.0" ]
3
+ build-backend = " setuptools.build_meta"
4
+
5
+ [tool .isort ]
6
+ profile = " black"
7
+ add_imports =" from __future__ import generator_stop"
8
+
9
+ [tool .pytest .ini_options ]
10
+ addopts = [
11
+ " --strict-config" ,
12
+ " --strict-markers" ,
13
+ " --cov" ,
14
+ " --cov-fail-under=91.53" ,
15
+ " --cov-report=term-missing:skip-covered" ,
16
+ ]
17
+ xfail_strict = true
18
+ junit_family = " xunit2"
19
+ filterwarnings = [" error" ]
20
+
21
+ [tool .coverage .run ]
22
+ branch = true
23
+ source_pkgs = [
24
+ " modernize" ,
25
+ " libmodernize" ,
26
+ ]
27
+ source = [" tests" ]
28
+
29
+ [tool .coverage .paths ]
30
+ source = [
31
+ " ." ,
32
+ " .tox/*/lib/*/site-packages/" ,
33
+ ' .tox\\*\\Lib\\site-packages\\' ,
34
+ ]
35
+
36
+
37
+ [tool .tox ]
38
+ legacy_tox_ini = """
39
+ ; tox configuration file for running tests on local dev env and Travis CI.
40
+ ;
41
+ ; The local dev environment will be executed against latest released Twisted.
42
+ ; The coverage is reported only and local dev and not on Travis-CI as there
43
+ ; we have separate reported (ex codecov.io)
44
+
45
+ [tox]
46
+ envlist =
47
+ py{36,37,38},lint
48
+ minversion=3.20.0
49
+ requires=
50
+ virtualenv >= 20.0.31
51
+ tox-wheel >= 0.5.0
52
+
53
+ [testenv]
54
+ extras = test
55
+ commands = pytest {posargs}
56
+ wheel = True
57
+ wheel_pep517 = True
58
+ wheel_build_env = build
59
+
60
+ [testenv:build]
61
+ # empty environment to build universal wheel once per tox invocation
62
+ # https://github.com/ionelmc/tox-wheel#build-configuration
63
+
64
+ [testenv:coveralls]
65
+ passenv = GITHUB_*
66
+ deps =
67
+ coveralls
68
+ coverage>=5.3
69
+ commands = coveralls
70
+
71
+ [testenv:lint]
72
+ deps = pre-commit
73
+ commands = pre-commit run --all-files --show-diff-on-failure {posargs}
74
+ skip_install = true
75
+
76
+
77
+ [testenv:release]
78
+ deps = pep517
79
+ whitelist_externals =
80
+ cp
81
+ rm
82
+ commands =
83
+ rm -rf {toxinidir}/dist
84
+ cp -r {distdir} {toxinidir}/dist # copy the wheel built by tox-wheel
85
+ {envpython} -m pep517.build --source --out-dir={toxinidir}/dist {toxinidir}
86
+ """
Original file line number Diff line number Diff line change @@ -42,59 +42,10 @@ universal = 1
42
42
43
43
[zest.releaser]
44
44
python-file-with-version = libmodernize/__init__.py
45
+ tag-format = v{version}
45
46
46
47
[flake8]
47
48
disable-noqa = True
48
49
max-line-length = 88
49
50
extend-ignore =
50
51
E203, # whitespace before : is not PEP8 compliant (& conflicts with black)
51
-
52
- [isort]
53
- profile = black
54
- add_imports =from __future__ import generator_stop
55
-
56
- [tool:pytest]
57
- addopts =
58
- --strict-config
59
- --strict-markers
60
- --cov
61
- --cov-fail-under =91.53
62
- --cov-report =term-missing:skip-covered
63
- xfail_strict = True
64
- junit_family = xunit2
65
- filterwarnings =
66
- error
67
-
68
- [coverage:run]
69
- branch = True
70
- source_pkgs =
71
- modernize
72
- libmodernize
73
- source =
74
- tests
75
-
76
- [coverage:paths]
77
- source =
78
- .
79
- .tox/*/lib/*/site-packages/
80
- .tox\\*\\Lib\\site-packages\\
81
-
82
- [tox:tox]
83
- envlist =
84
- py{36,37,38},lint
85
-
86
- [testenv]
87
- extras = test
88
- commands = pytest {posargs}
89
-
90
- [testenv:coveralls]
91
- passenv = GITHUB_*
92
- deps =
93
- coveralls
94
- coverage>=5.3
95
- commands = coveralls
96
-
97
- [testenv:lint]
98
- deps = pre-commit
99
- commands = pre-commit run --all-files --show-diff-on-failure {posargs}
100
- skip_install = true
You can’t perform that action at this time.
0 commit comments