Skip to content

Commit b54c346

Browse files
committed
Use "python" in the virtual env, "python3" outside
This changes the build command to run with "python" when in a virtual environment, since all virtual environments support this even when "python" outside it is absent or refers to the wrong version. On Windows, virtual environments don't contain a python3 command, but a global python3 command may be present, so the errors are confusing. This fixes that by avoiding such errors altogether.
1 parent cc202cc commit b54c346

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ force_release: clean
2323
test -z "$$VIRTUAL_ENV" || pip install -U build twine
2424

2525
# Build the sdist and wheel that will be uploaded to PyPI.
26-
python3 -m build --sdist --wheel || \
27-
test -z "$$VIRTUAL_ENV" && \
26+
if test -n "$$VIRTUAL_ENV"; then \
27+
python -m build --sdist --wheel; \
28+
else \
29+
python3 -m build --sdist --wheel || \
2830
echo "Use a virtual-env with 'python -m venv env && source env/bin/activate' instead" && \
29-
false
31+
false; \
32+
fi
3033

3134
# Upload to PyPI and push the tag.
3235
twine upload dist/*

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