2020-04-27 20:30:36 +00:00
|
|
|
.PHONY: clean-pyc clean-build docs
|
|
|
|
|
2020-04-24 17:55:10 +00:00
|
|
|
help:
|
|
|
|
@echo "clean-build - remove build artifacts"
|
|
|
|
@echo "clean-pyc - remove Python file artifacts"
|
2020-05-26 20:51:05 +00:00
|
|
|
@echo "build-docs - build documentation"
|
|
|
|
@echo "validate-docs - Validate news fragments"
|
|
|
|
@echo "docs - build then validate"
|
|
|
|
@echo "mac-docs - build, validate, the open in default browser (mac only)"
|
2020-04-24 17:55:10 +00:00
|
|
|
@echo "release - package and push a new release"
|
2020-05-26 20:51:05 +00:00
|
|
|
@echo "dist - build wheels and source distribution"
|
|
|
|
@echo "smoke-test - build a source distribution and spawn an active virtual environment"
|
|
|
|
@echo "lock - Regenerate dependency locks"
|
|
|
|
@echo "env - Regenerate locks and create a new development pipenv"
|
|
|
|
@echo "install - Development installation via pipenv"
|
2020-04-24 17:55:10 +00:00
|
|
|
|
|
|
|
clean: clean-build clean-pyc
|
|
|
|
|
|
|
|
clean-build:
|
|
|
|
rm -fr build/
|
|
|
|
rm -fr dist/
|
|
|
|
rm -fr *.egg-info
|
|
|
|
|
|
|
|
clean-pyc:
|
|
|
|
find . -name '*.pyc' -exec rm -f {} +
|
|
|
|
find . -name '*.pyo' -exec rm -f {} +
|
|
|
|
find . -name '*~' -exec rm -f {} +
|
|
|
|
|
|
|
|
build-docs:
|
2020-04-27 20:30:36 +00:00
|
|
|
$(MAKE) -C docs clean
|
|
|
|
$(MAKE) -C docs html
|
2020-04-24 17:55:10 +00:00
|
|
|
|
|
|
|
validate-docs: build-docs
|
2020-08-20 15:25:40 +00:00
|
|
|
# Requires dependencies from docs-requirements.txt
|
2021-12-14 00:30:28 +00:00
|
|
|
python3 newsfragments/validate_files.py
|
|
|
|
python3 -m towncrier --draft
|
2020-04-24 17:55:10 +00:00
|
|
|
|
|
|
|
docs: build-docs validate-docs
|
|
|
|
readlink -f docs/build/html/index.html
|
|
|
|
|
2020-08-18 20:59:04 +00:00
|
|
|
mac-docs: build-docs validate-docs
|
2020-05-28 21:44:08 +00:00
|
|
|
open docs/build/html/index.html
|
2020-04-24 17:55:10 +00:00
|
|
|
|
|
|
|
release: clean
|
|
|
|
# Enable GPG signing of release commits
|
|
|
|
CURRENT_SIGN_SETTING=$(git config commit.gpgSign)
|
|
|
|
git config commit.gpgSign true
|
|
|
|
# Let UPCOMING_VERSION be the version that is used for the current bump
|
|
|
|
$(eval UPCOMING_VERSION=$(shell bumpversion $(bump) --dry-run --list | grep new_version= | sed 's/new_version=//g'))
|
|
|
|
# Now generate the release notes to have them included in the release commit
|
|
|
|
towncrier --yes --version $(UPCOMING_VERSION)
|
|
|
|
# We need --allow-dirty because of the generated release_notes file but it is safe because the
|
|
|
|
# previous dry-run runs *without* --allow-dirty which ensures it's really just the release notes
|
|
|
|
# file that we are allowing to sit here dirty, waiting to get included in the release commit.
|
|
|
|
bumpversion --allow-dirty $(bump)
|
2020-07-21 02:08:11 +00:00
|
|
|
git push upstream main && git push upstream v$(UPCOMING_VERSION)
|
2020-04-24 17:55:10 +00:00
|
|
|
# Restore the original system setting for commit signing
|
|
|
|
git config commit.gpgSign "$(CURRENT_SIGN_SETTING)"
|
|
|
|
|
|
|
|
dist: clean
|
|
|
|
# Build a source distribution and wheel
|
|
|
|
python setup.py sdist bdist_wheel
|
|
|
|
ls -l dist
|
|
|
|
|
2020-05-26 20:51:05 +00:00
|
|
|
smoke-test: clean
|
2020-04-24 17:55:10 +00:00
|
|
|
# Build a source distribution and wheel then build a smoke test virtual env from the wheel
|
|
|
|
python setup.py sdist bdist_wheel
|
|
|
|
python scripts/release/test_package.py
|
|
|
|
|
|
|
|
lock: clean
|
|
|
|
# Relock dependencies
|
2021-01-07 16:10:57 +00:00
|
|
|
scripts/dependencies/relock_dependencies.sh
|
2020-04-24 17:55:10 +00:00
|
|
|
|
|
|
|
env: lock
|
|
|
|
# Relock dependencies and generate a pipenv virtualenv from the result
|
2020-04-24 19:00:46 +00:00
|
|
|
pipenv run pip install -e .[dev]
|
|
|
|
pipenv shell
|
|
|
|
nucypher --version
|
2020-04-24 17:55:10 +00:00
|
|
|
|
|
|
|
install: clean
|
2020-06-05 04:13:19 +00:00
|
|
|
pipenv --rm
|
2020-04-24 17:55:10 +00:00
|
|
|
# Development installation
|
2020-04-24 19:00:46 +00:00
|
|
|
pipenv run pip install -e .[dev]
|
2020-04-24 17:55:10 +00:00
|
|
|
# Show installed version and verify entry point
|
2020-04-24 19:00:46 +00:00
|
|
|
pipenv shell
|
|
|
|
nucypher --version
|