Skip to content

Commit 78ebbc6

Browse files
committed
Common hooks to build and upload the package.
1 parent 81cc5b0 commit 78ebbc6

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Remove previous build artifacts
2+
clean:
3+
rm -rf dist/ build/ src/*.egg-info src/config_versioned.egg-info
4+
5+
# Build source distribution and wheel
6+
build: clean
7+
python -m build
8+
9+
# Validate the distributions before uploading
10+
check: build
11+
python -m twine check dist/*
12+
13+
# Upload to PyPI (https://pypi.org)
14+
upload: check
15+
python -m twine upload dist/*
16+
17+
# Convenience target to print all of the available targets in this file
18+
# From https://stackoverflow.com/questions/4219255
19+
.PHONY: list
20+
list:
21+
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | \
22+
awk -v RS= -F: '/^# File/,/^# Finished Make data base/ \
23+
{if ($$1 !~ "^[#.]") {print $$1}}' | \
24+
sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'

0 commit comments

Comments
 (0)