Skip to content

Commit cc202cc

Browse files
committed
Improve when and how Makefile suggests virtual env
The avoids showing the message when the build command was already run in a virtual environment. It also keeps the command failing, so the subsequent twine command is not attempted. (Just adding "|| echo ..." caused the command to succeed, because "echo ..." itself succeeds except in the rare case it cannot write to standard output.)
1 parent b1c61d9 commit cc202cc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ release: clean
2121
force_release: clean
2222
# IF we're in a virtual environment, add build tools
2323
test -z "$$VIRTUAL_ENV" || pip install -U build twine
24-
python3 -m build --sdist --wheel || echo "Use a virtual-env with 'python -m venv env && source env/bin/activate' instead"
24+
25+
# Build the sdist and wheel that will be uploaded to PyPI.
26+
python3 -m build --sdist --wheel || \
27+
test -z "$$VIRTUAL_ENV" && \
28+
echo "Use a virtual-env with 'python -m venv env && source env/bin/activate' instead" && \
29+
false
30+
31+
# Upload to PyPI and push the tag.
2532
twine upload dist/*
2633
git push --tags origin main

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy