Skip to content

Commit 25b61b3

Browse files
🐞 fix: best practice of tox
1 parent 2707a3d commit 25b61b3

7 files changed

Lines changed: 25 additions & 21 deletions

File tree

docs/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ This will give you a test report and a lint report. You should see no errors exc
151151
## Step 6: Create GitHub Repo
152152

153153
???+Info
154-
Going through step 6 and 7 is tedious. So that's why we provide a bash script --repo.sh, to help creating repo, setting secrets and publishing your code to the repo automatically.
154+
Going through step 6 and 7 is tedious. So that's why we provide a bash script --github.sh, to help creating repo, setting secrets and publishing your code to the repo automatically.
155155

156156
The script looks like the following:
157157
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool]
22
[tool.poetry]
33
name = "ppw"
4-
version = "1.3.3"
4+
version = "1.3.4"
55
description = "A Wizard to create a skeleton python project with up-to-date technology"
66
license = "BSD-3-Clause"
77
authors = ["Aaron Yang <aaron_yang@jieyu.ai>"]

reload.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ $# == 1 ]; then
2020
rm -rf /tmp/$1
2121
fi
2222

23-
rm -rf /tmp/ppwtest
23+
rm -rf /tmp/ppw
2424

2525
echo "running ppw"
2626
ppw

{{cookiecutter.project_slug}}/.github/workflows/dev.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
pull_request:
1212
branches:
1313
- '*'
14-
1514
# Allows you to run this workflow manually from the Actions tab
1615
workflow_dispatch:
1716

@@ -33,6 +32,7 @@ jobs:
3332
package_name: ${{ steps.variables_step.outputs.package_name }}
3433
repo_name: ${{ steps.variables_step.outputs.repo_name }}
3534
repo_owner: ${{ steps.variables_step.outputs.repo_owner }}
35+
build_number: ${{ steps.variables_step.outputs.build_number }}
3636

3737
# uncomment the following to pickup services
3838
# services:
@@ -133,7 +133,7 @@ jobs:
133133
password: ${{ secrets.BUILD_NOTIFY_MAIL_PASSWORD }}
134134
from: build-bot
135135
to: ${{ secrets.BUILD_NOTIFY_MAIL_RCPT }}
136-
subject: ${{ needs.test.outputs.package_name }}.${{ needs.test.outputs.package_version}}.${{ github.run_number }} build successfully
136+
subject: ${{ needs.test.outputs.package_name }}.${{ needs.test.outputs.package_version}}.dev.${{ github.run_number }} build successfully
137137
convert_markdown: true
138138
html_body: |
139139
## Build Success
@@ -178,8 +178,8 @@ jobs:
178178
# title: CI Notification | Success
179179
# text: |
180180
# ### Build Success
181-
# ${{ needs.test.outputs.package_version }}.dev.${{ github.run_number }} is built and published to test pypi
181+
# ${{ needs.test.outputs.package_version }}.dev.${{ github.run_number }}published to TEST pypi
182182
# ### Change History
183183
# Please check change history at https://${{ needs.test.outputs.repo_owner }}.github.io/${{ needs.test.outputs.repo_name }}/${{ needs.test.outputs.package_version }}.dev/history
184184
# ### Package Download
185-
# Please download the pacakge at: https://test.pypi.org/project/${{ needs.test.outputs.repo_name }}/
185+
# The pacakge is availabled at: https://test.pypi.org/project/${{ needs.test.outputs.repo_name }}/

{{cookiecutter.project_slug}}/.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
poetry run mkdocs build
6666
git config --global user.name Docs deploy
6767
git config --global user.email docs@dummy.bot.com
68-
poetry run mike deploy -p -f --ignore `poetry version --short`
68+
poetry run mike deploy -p -f --ignore `poetry version --short` latest
6969
poetry run mike set-default -p `poetry version --short`
7070
7171
- name: Build wheels and source tarball
@@ -114,7 +114,7 @@ jobs:
114114
convert_markdown: true
115115
html_body: |
116116
## Build Success
117-
${{ needs.release.outputs.package_name }}.${{ needs.release.outputs.package_version }} is built and published to PYPI
117+
${{ needs.release.outputs.package_name }}.${{ needs.release.outputs.package_version }} has been published to PYPI
118118
119119
## Change Details
120120
${{ github.event.head_commit.message }}
@@ -157,9 +157,9 @@ jobs:
157157
# msgtype: markdown
158158
# title: CI Notification | Success
159159
# text: |
160-
# ### Build Success
161-
# ${{ needs.release.outputs.package_version_full }} is built and published to test pypi
160+
# ### ${{ needs.release.outputs.package_name }} Build Success
161+
# ${{ needs.release.outputs.package_version }} has been published to PYPI
162162
# ### Change History
163-
# Please check change history at https://${{ needs.release.outputs.repo_owner }}.github.io/${{ needs.release.outputs.repo_name }}/history
163+
# Please check change history at https://${{ needs.release.outputs.repo_owner }}.github.io/${{ needs.release.outputs.repo_name }}/latest/history
164164
# ### Package Download
165-
# Please download the pacakge at: https://test.pypi.org/project/${{ needs.release.outputs.repo_name }}/
165+
# Please download the pacakge at: https://pypi.org/project/${{ needs.release.outputs.repo_name }}/

{{cookiecutter.project_slug}}/tox.ini

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,27 @@ python =
1010
3.7: py37
1111

1212
[testenv:lint]
13+
extras =
14+
dev
15+
doc
16+
deps =
17+
poetry
1318
commands =
14-
poetry install -E dev -E doc
15-
isort {{ cookiecutter.project_slug }}
16-
black {{ cookiecutter.project_slug }} tests
17-
flake8 {{ cookiecutter.project_slug }} tests
19+
poetry run isort {{ cookiecutter.project_slug }}
20+
poetry run black {{ cookiecutter.project_slug }} tests
21+
poetry run flake8 {{ cookiecutter.project_slug }}
1822
poetry build
19-
mkdocs build
20-
twine check dist/*
23+
poetry run mkdocs build
24+
poetry run twine check dist/*
2125

2226
[testenv]
23-
skip_install = true
2427
passenv = *
2528
setenv =
2629
PYTHONPATH = {toxinidir}
2730
PYTHONWARNINGS = ignore
2831
deps =
2932
poetry
33+
extras =
34+
test
3035
commands =
31-
poetry install -E test
3236
poetry run pytest -s --cov={{ cookiecutter.project_slug }} --cov-append --cov-report=xml --cov-report term-missing tests

0 commit comments

Comments
 (0)