Skip to content

Commit 50608db

Browse files
authored
refactor publish test (#11)
* add publishable check to tox * use tox publishable test in workflow * rename release workflow to publish * cleanup * fix workflow names
1 parent d6da935 commit 50608db

File tree

5 files changed

+32
-48
lines changed

5 files changed

+32
-48
lines changed

.github/pretend_publish_version.py

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: publish
22

33
on:
44
release:

.github/workflows/publishable.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: publish
1+
name: publishable
22

33
on:
44
push:
@@ -7,7 +7,16 @@ on:
77

88
pull_request:
99
paths:
10-
- ".github/pretend_publish_version.py"
10+
- "light_the_torch/**"
11+
- "pyproject.toml"
12+
- "setup.cfg"
13+
- ".gitignore"
14+
- "CONTRIBUTING.rst"
15+
- "LICENSE"
16+
- "MANIFEST.in"
17+
- "README.rst"
18+
- "tox.ini"
19+
- "requirements-dev.txt"
1120
- ".github/workflows/publish.yml"
1221

1322
jobs:
@@ -26,21 +35,8 @@ jobs:
2635
- name: Checkout repository
2736
uses: actions/checkout@v2
2837

29-
- name: Install pep517 and twine
30-
run: pip install pep517 twine
38+
- name: Install dev requirements
39+
run: pip install -r requirements-dev.txt
3140

32-
- name: Build source and binary with pretended version
33-
run: |
34-
pip install setuptools_scm[toml]
35-
export SETUPTOOLS_SCM_PRETEND_VERSION=$(python .github/pretend_publish_version.py)
36-
python -m pep517.build --source --binary .
37-
38-
- name: Check README
39-
run: twine check dist/*
40-
41-
- name: Upload to TestPyPI
42-
env:
43-
TWINE_REPOSITORY: testpypi
44-
TWINE_USERNAME: ${{ secrets.TESTPYPI_USERNAME }}
45-
TWINE_PASSWORD: ${{ secrets.TESTPYPI_PASSWORD }}
46-
run: twine upload dist/*
41+
- name: Run unit tests
42+
run: tox -e publishable

.github/workflows/tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ on:
88

99
pull_request:
1010
paths:
11-
- "ltt/**"
11+
- "light_the_torch/**"
1212
- "tests/**"
13-
- "setup.py"
1413
- "pytest.ini"
1514
- "tox.ini"
1615
- ".coveragerc"

tox.ini

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ requires =
2525
pre-commit
2626
whitelist_externals =
2727
pre-commit
28-
skip_install = true
28+
skip_install = True
2929
deps =
3030
commands =
3131
pre-commit run --all-files
@@ -44,3 +44,17 @@ commands =
4444
--config=.flake8
4545
mypy \
4646
--config-file=mypy.ini
47+
48+
[testenv:publishable]
49+
whitelist_externals =
50+
rm
51+
skip_install = True
52+
deps =
53+
check-wheel-contents
54+
pep517
55+
twine
56+
commands =
57+
rm -rf build dist light_the_torch.egg-info
58+
python -m pep517.build --source --binary .
59+
twine check dist/*
60+
check-wheel-contents dist

0 commit comments

Comments
 (0)