|
5 | 5 |
|
6 | 6 | set -eEu
|
7 | 7 |
|
| 8 | +function release_with() { |
| 9 | + 1ドル -m build --sdist --wheel |
| 10 | +} |
| 11 | + |
8 | 12 | if test -n "${VIRTUAL_ENV:-}"; then
|
9 | 13 | 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 | + echo"Virtual environment detected. Adding packages: ${deps[*]}" |
| 15 | + pip install --quiet --upgrade "${deps[@]}" |
| 16 | + echo 'Starting the build.' |
| 17 | + release_with python |
14 | 18 | else
|
15 | | - suggest_venv() { |
| 19 | + functionsuggest_venv() { |
16 | 20 | venv_cmd='python -m venv env && source env/bin/activate'
|
17 | | - printf "Use a virtual-env with '%s' instead.\n" "$venv_cmd" |
| 21 | + printf "HELP: To avoid this error, use a virtual-env with '%s' instead.\n" "$venv_cmd" |
18 | 22 | }
|
19 | 23 | 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. |
| 24 | + echo 'Starting the build.' |
| 25 | + release_with python3 # Outside a venv, use python3. |
22 | 26 | fi
|
0 commit comments