Skip to content

Commit

Permalink
fix: just read the package version and fail in Python, not the Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jenstroeger committed Nov 17, 2022
1 parent c9a8a3b commit 66d2e0d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@
# https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html
SHELL := bash

# Set the package's name and version for use throughout the Makefile. If the
# version can not be determined then error out.
# Set the package's name and version for use throughout the Makefile.
PACKAGE_NAME := package
ifneq ($(origin VIRTUAL_ENV),undefined)
PACKAGE_VERSION := $(shell python -c 'import $(PACKAGE_NAME); print($(PACKAGE_NAME).__version__)')
else ifneq ($(wildcard .venv/upgraded-on),)
PACKAGE_VERSION := $(shell .venv/bin/python -c 'import $(PACKAGE_NAME); print($(PACKAGE_NAME).__version__)')
else
$(error Unable to determine package version)
endif
PACKAGE_VERSION := $(shell python -c $$'try: import $(PACKAGE_NAME); print($(PACKAGE_NAME).__version__);\nexcept: print("unknown");')

# This variable contains the first goal that matches any of the listed goals
# here, else it contains an empty string. The net effect is to filter out
Expand Down

0 comments on commit 66d2e0d

Please sign in to comment.