| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6495d84 commit 4b1c564
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | test/fixtures/* eol=lf | |
| 2 | 2 | init-tests-after-clone.sh eol=lf | |
| 3 | - check-version.sh eol=lf | ||
| 4 | 3 | Makefile eol=lf | |
| 4 | + check-version.sh eol=lf | ||
| 5 | + build-release.sh eol=lf | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,17 +11,6 @@ release: clean | |||
| 11 | 11 | make force_release | |
| 12 | 12 | ||
| 13 | 13 | force_release: clean | |
| 14 | - # IF we're in a virtual environment, add build tools | ||
| 15 | - test -z "$$VIRTUAL_ENV" || pip install -U build twine | ||
| 16 | - | ||
| 17 | - # Build the sdist and wheel that will be uploaded to PyPI. | ||
| 18 | - if test -n "$$VIRTUAL_ENV"; then \ | ||
| 19 | - python -m build --sdist --wheel; \ | ||
| 20 | - else \ | ||
| 21 | - python3 -m build --sdist --wheel || \ | ||
| 22 | - { echo "Use a virtual-env with 'python -m venv env && source env/bin/activate' instead" && false; }; \ | ||
| 23 | - fi | ||
| 24 | - | ||
| 25 | - # Upload to PyPI and push the tag. | ||
| 14 | + ./build-release.sh | ||
| 26 | 15 | twine upload dist/* | |
| 27 | 16 | git push --tags origin main | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,22 @@ | |||
| 1 | + #!/usr/bin/env bash | ||
| 2 | + # | ||
| 3 | + # This script builds a release. If run in a venv, it auto-installs its tools. | ||
| 4 | + # You may want to run "make release" instead of running this script directly. | ||
| 5 | + | ||
| 6 | + set -eEu | ||
| 7 | + | ||
| 8 | + if test -n "${VIRTUAL_ENV:-}"; then | ||
| 9 | + deps=(build twine) # Install twine along with build, as we need it later. | ||
| 10 | + printf 'Virtual environment detected. Adding packages: %s\n' "${deps[*]}" | ||
| 11 | + pip install -U "${deps[@]}" | ||
| 12 | + printf 'Starting the build.\n' | ||
| 13 | + python -m build --sdist --wheel | ||
| 14 | + else | ||
| 15 | + suggest_venv() { | ||
| 16 | + venv_cmd='python -m venv env && source env/bin/activate' | ||
| 17 | + printf "Use a virtual-env with '%s' instead.\n" "$venv_cmd" | ||
| 18 | + } | ||
| 19 | + trap suggest_venv ERR # This keeps the original exit (error) code. | ||
| 20 | + printf 'Starting the build.\n' | ||
| 21 | + python3 -m build --sdist --wheel # Outside a venv, use python3. | ||
| 22 | + fi | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,8 @@ | |||
| 1 | 1 | #!/usr/bin/env bash | |
| 2 | 2 | # | |
| 3 | - # This script checks if we appear ready to build and publish a new release. | ||
| 3 | + # This script checks if we are in a consistent state to build a new release. | ||
| 4 | 4 | # See the release instructions in README.md for the steps to make this pass. | |
| 5 | + # You may want to run "make release" instead of running this script directly. | ||
| 5 | 6 | ||
| 6 | 7 | set -eEfuo pipefail | |
| 7 | 8 | trap 'printf "%s: Check failed. Stopping.\n" "$0" >&2' ERR | |
| Back | FazBrowse Home | New Git URL |
0 commit comments