generated from automl/automl_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (53 loc) · 2.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# These have been configured to only really run short tasks. Longer form tasks
# are usually completed in github actions.
SHELL := /bin/bash
NAME := CARP-S
PACKAGE_NAME := carps
VERSION := 0.1.1
DIST := dist
.PHONY: help install-dev clean-build check build docs publish test
help:
@echo "Makefile ${NAME}"
@echo "* install-dev to install all dev requirements and install pre-commit"
@echo "* clean-build to clean any build files"
@echo "* check to run the pre-commit check"
@echo "* build to build a dist"
@echo "* docs to generate and view the html files, checks links"
@echo "* publish to help publish the current branch to pypi"
@echo "* test to run the tests"
PYTHON ?= python
PIP ?= pip
test:
$(PYTHON) -m pytest tests
docs:
$(PYTHON) -m webbrowser -t "http://127.0.0.1:8000/"
$(PYTHON) -m mkdocs serve --clean
check:
pre-commit run --all-files
install-dev:
pip install -e ".[dev]"
pre-commit install
clean-build:
rm -rf ${DIST}
# Build a distribution in ./dist
build:
$(PYTHON) -m pip install build
$(PYTHON) -m build --sdist
# Publish to testpypi
# Will echo the commands to actually publish to be run to publish to actual PyPi
# This is done to prevent accidental publishing but provide the same conveniences
publish: clean-build build
read -p "Did you update the version number in Makefile, pyproject.toml, and CITATION.cff?"
$(PIP) install twine
$(PYTHON) -m twine upload --repository testpypi ${DIST}/*
@echo
@echo "Test with the following:"
@echo "* Create a new virtual environment to install the uploaded distribution into"
@echo "* Run the following:"
@echo "--- pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ ${PACKAGE_NAME}==${VERSION}"
@echo
@echo "* Run this to make sure it can import correctly, plus whatever else you'd like to test:"
@echo "--- python -c 'import ${PACKAGE_NAME}'"
@echo
@echo "Once you have decided it works, publish to actual pypi with"
@echo "--- python -m twine upload dist/*"