-
Notifications
You must be signed in to change notification settings - Fork 140
/
tox.ini
129 lines (119 loc) · 2.91 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
[tox]
description = "PyRFC Build"
minversion = 4.5
envlist =
linter, docs, reuse, sdist, pack,
py38, py39, py310, py311, py312
package = wheel
skip_missing_interpreters = false
isolated_build = true
[testenv:.pkg]
passenv = SAPNWRFC_HOME, PYRFC_BUILD_CYTHON
[testenv]
description = Build binary wheels and run unit tests
passenv = SAPNWRFC_HOME, PYRFC_BUILD_CYTHON
deps =
build
Cython
pytest
pytest-testdox
pytest-html-reporter
commands =
# build binary wheel for release
python -m build --wheel --outdir dist
# unit test
python -m pytest tests --testdox --html-report=./report {posargs}
[testenv:linter]
description = Check linting
platform = darwin
basepython = python3.11
skip_install = true
deps =
ruff
cython-lint
pydocstyle
commands =
cython-lint src/pyrfc --max-line-length=180
ruff format src setup.py tests examples
pydocstyle src
[testenv:docs]
description = Build sphinx documentation
platform = darwin
basepython = python3.11
passenv = SAPNWRFC_HOME
change_dir = doc
allowlist_externals =
sphinx-build
deps = sphinx
commands =
sphinx-build -b html -a -E -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:gh-pages]
description = Build gh-pages
platform = darwin
basepython = python3.11
skip_install = true
allowlist_externals =
git
rm
cp
commands =
git checkout gh-pages
rm -rf *.html searchindex.js objects.inv _images _sources _static
cp -R {toxworkdir}/docs/tmp/html/. .
git add .
git commit -m "gh-pages update by tox"
git checkout main
[testenv:reuse]
description = Reuse compliance check
platform = darwin
basepython = python3.11
skip_install = true
deps = reuse
commands=
python -m reuse lint
[testenv:pypi-publish]
description = Publish on PyPI
platform = darwin
basepython = python3.11
skip_install = true
deps = twine
commands =
python -m twine upload dist/*-macosx*.whl dist/*-win*.whl dist/*.tar.gz --verbose
[testenv:pypi-test-publish]
description = Publish on Test PyPI
platform = darwin
basepython = python3.11
skip_install = true
deps = twine
commands =
python -m twine upload --repository testpypi dist/*-macosx*.whl dist/*-win*.whl dist/*.tar.gz --verbose
[testenv:pack]
description = Build the test wheel for unit test
platform = linux
basepython = python3.11
skip_install = true
passenv = SAPNWRFC_HOME, PYRFC_BUILD_CYTHON
allowlist_externals =
find
tar
unzip
deps =
build
setuptools
Cython
commands =
python -m build --sdist --wheel --outdir {env_tmp_dir}
find {env_tmp_dir} -name *.tar.gz -exec tar -xf {} -C {env_tmp_dir} \;
unzip {env_tmp_dir}/\*.whl -d {env_tmp_dir}
find {env_tmp_dir} '(' -name *.tar.gz -o -name *.whl ')' -exec rm {} \;
[testenv:sdist]
description = Build sdist
platform = linux
basepython = python3.11
skip_install = true
passenv = SAPNWRFC_HOME, PYRFC_BUILD_CYTHON
deps =
Cython
build
commands =
python -m build --sdist --outdir dist