Skip to content

Commit b09781e

Browse files
committed
Packaging: pep517/518 conform workflow with pyproject.toml
1 parent 088a267 commit b09781e

14 files changed

Lines changed: 188 additions & 122 deletions

.coveragerc

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,40 @@ env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919

2020
jobs:
21+
source_check:
22+
name: source check
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Set up Python 3.8
31+
uses: actions\setup-python@v2
32+
with:
33+
python-version: 3.8
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install black #pylint
39+
pip install --editable .
40+
- name: black check
41+
run: |
42+
python -m black --check .
43+
# - name: pylint check
44+
# run: |
45+
# python -m pylint anaflow/
46+
2147
build_sdist:
2248
name: sdist on ${{ matrix.os }} with py ${{ matrix.python-version }}
2349
runs-on: ${{ matrix.os }}
2450
strategy:
2551
fail-fast: false
2652
matrix:
2753
os: [ubuntu-latest, windows-latest, macos-latest]
28-
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
54+
python-version: [3.6, 3.7, 3.8, 3.9]
2955

3056
steps:
3157
- uses: actions/checkout@v2
@@ -40,21 +66,18 @@ jobs:
4066
- name: Install dependencies
4167
run: |
4268
python -m pip install --upgrade pip
43-
pip install -U wheel
44-
pip install -r requirements_setup.txt
45-
pip install -r requirements.txt
46-
pip install -r requirements_test.txt
47-
pip install coveralls>=3.0.0
48-
49-
- name: Build sdist
50-
run: |
51-
python setup.py sdist --formats=gztar bdist_wheel -d dist
69+
pip install build coveralls>=3.0.0
70+
pip install --editable .[test]
5271
5372
- name: Run tests
5473
run: |
5574
python -m pytest --cov anaflow --cov-report term-missing -v tests/
5675
python -m coveralls --service=github
5776
77+
- name: Build sdist
78+
run: |
79+
python -m build
80+
5881
- uses: actions/upload-artifact@v2
5982
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
6083
with:
@@ -73,7 +96,7 @@ jobs:
7396
- name: Publish to Test PyPI
7497
# only if working on develop
7598
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
76-
uses: pypa/gh-action-pypi-publish@master
99+
uses: pypa/gh-action-pypi-publish@release/v1
77100
with:
78101
user: __token__
79102
password: ${{ secrets.test_pypi_password }}
@@ -83,7 +106,7 @@ jobs:
83106
- name: Publish to PyPI
84107
# only if tagged
85108
if: startsWith(github.ref, 'refs/tags')
86-
uses: pypa/gh-action-pypi-publish@master
109+
uses: pypa/gh-action-pypi-publish@release/v1
87110
with:
88111
user: __token__
89112
password: ${{ secrets.pypi_password }}

.readthedocs.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
3+
sphinx:
4+
configuration: docs/source/conf.py
5+
6+
formats: all
7+
8+
python:
9+
version: 3.7
10+
install:
11+
- method: pip
12+
path: .
13+
extra_requirements:
14+
- doc

MANIFEST.in

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
include README.md
2-
include MANIFEST.in
3-
include setup.py
4-
include setup.cfg
5-
recursive-include anaflow *.py
6-
recursive-include tests *.py
7-
recursive-include docs/source *
8-
include docs/Makefile docs/requirements.txt
9-
include LICENSE
1+
prune *
2+
graft anaflow
3+
graft tests
4+
5+
include LICENSE README.md pyproject.toml setup.cfg
6+
global-exclude __pycache__ *.py[cod] .*

anaflow/flow/ext_grf_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def ext_grf_steady(
123123
rate=-1e-4,
124124
h_ref=0.0,
125125
arg_dict=None,
126-
**kwargs
126+
**kwargs,
127127
):
128128
"""
129129
The extended "General radial flow" model for steady flow.

anaflow/tools/mean.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def annular_amean(func, val_arr, ann_dim=2, arg_dict=None, **kwargs):
192192
f_inv=lambda x: x,
193193
ann_dim=ann_dim,
194194
arg_dict=arg_dict,
195-
**kwargs
195+
**kwargs,
196196
)
197197

198198

@@ -260,7 +260,7 @@ def annular_gmean(func, val_arr, ann_dim=2, arg_dict=None, **kwargs):
260260
f_inv=np.exp,
261261
ann_dim=ann_dim,
262262
arg_dict=arg_dict,
263-
**kwargs
263+
**kwargs,
264264
)
265265

266266

@@ -322,7 +322,7 @@ def annular_hmean(func, val_arr, ann_dim=2, arg_dict=None, **kwargs):
322322
f_inv=lambda x: 1.0 / x,
323323
ann_dim=ann_dim,
324324
arg_dict=arg_dict,
325-
**kwargs
325+
**kwargs,
326326
)
327327

328328

@@ -392,5 +392,5 @@ def annular_pmean(func, val_arr, p=2.0, ann_dim=2, arg_dict=None, **kwargs):
392392
f_inv=lambda x: np.power(x, 1.0 / p),
393393
ann_dim=ann_dim,
394394
arg_dict=arg_dict,
395-
**kwargs
395+
**kwargs,
396396
)

docs/requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/requirements_doc.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel",
5+
"setuptools_scm[toml]>=3.5",
6+
]
7+
build-backend = "setuptools.build_meta"
8+
9+
[tool.setuptools_scm]
10+
write_to = "anaflow/_version.py"
11+
write_to_template = "__version__ = '{version}'"
12+
local_scheme = "no-local-version"
13+
fallback_version = "0.0.0.dev0"
14+
15+
[tool.black]
16+
exclude = "_version.py"
17+
line-length = 79
18+
target-version = [
19+
"py36",
20+
"py37",
21+
"py38",
22+
]
23+
24+
[tool.coverage]
25+
[tool.coverage.run]
26+
source = ["anaflow"]
27+
omit = [
28+
"*docs*",
29+
"*examples*",
30+
"*tests*",
31+
]
32+
33+
[tool.coverage.report]
34+
exclude_lines = [
35+
"pragma: no cover",
36+
"if __name__ == '__main__':",
37+
"def __repr__",
38+
"def __str__",
39+
]
40+
41+
[tool.pylint]
42+
[tool.pylint.master]
43+
extension-pkg-whitelist = [
44+
"numpy",
45+
"scipy",
46+
]
47+
ignore = "_version.py"
48+
49+
[tool.pylint.message_control]
50+
disable = [
51+
"R0801",
52+
]
53+
54+
[tool.pylint.reports]
55+
output-format = "colorized"
56+
57+
[tool.pylint.design]
58+
max-args = 20
59+
max-locals = 50
60+
max-branches = 30
61+
max-statements = 80
62+
max-attributes = 25
63+
max-public-methods = 75

requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)