Skip to content

Commit bb4a0a6

Browse files
PicoCentauriagoscinski
authored andcommitted
Add test for build/package integrity
1 parent 8d23d32 commit bb4a0a6

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This workflow builds and checks the package for release
2+
name: Build
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: "3.10"
18+
- run: pip install tox
19+
20+
- name: Test build integrity
21+
run: tox -e build

MANIFEST.in

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
recursive-include src/skmatter/datasets/data/ *
2-
recursive-include src/skmatter/datasets/descr/ *
1+
graft src
32

3+
include LICENSE
4+
include contributors.txt
5+
include README.rst
6+
7+
prune docs
8+
prune developer
9+
prune examples
410
prune tests
11+
prune .github
12+
prune .tox
13+
14+
exclude CHANGELOG
15+
exclude CODE_OF_CONDUCT.md
16+
exclude .gitignore
17+
exclude .codecov.yml
18+
exclude .readthedocs.yaml
19+
exclude tox.ini
20+
21+
global-exclude *.py[cod] __pycache__/* *.so *.dylib

tox.ini

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tox]
22
envlist =
33
lint
4+
build
45
tests
56

67
lint_folders =
@@ -10,6 +11,23 @@ lint_folders =
1011
"{toxinidir}/examples"
1112

1213

14+
[testenv:build]
15+
# builds the package and checks integrity
16+
17+
usedevelop = true
18+
deps =
19+
build
20+
check-manifest
21+
twine
22+
allowlist_externals = bash
23+
commands_pre =
24+
bash -c "if [ -e {toxinidir}/dist/*tar.gz ]; then unlink {toxinidir}/dist/*.whl; fi"
25+
bash -c "if [ -e {toxinidir}/dist/*tar.gz ]; then unlink {toxinidir}/dist/*.tar.gz; fi"
26+
commands =
27+
python -m build
28+
twine check dist/*.tar.gz dist/*.whl
29+
check-manifest {toxinidir}
30+
1331
[testenv:tests]
1432
usedevelop = true
1533
changedir = tests

0 commit comments

Comments
 (0)