-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (55 loc) · 1.71 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
68
69
70
71
# Makefile
# Check if the OS is Windows
ifeq ($(OS),Windows_NT)
VENV_ACTIVATE = .venv\Scripts\activate &&
PYTHON = python
RM = del /Q
RMDIR = rmdir /S /Q
else
VENV_ACTIVATE = . .venv/bin/activate &
PYTHON = python3
RM = rm -f
RMDIR = rm -rf
endif
.PHONY: install build example test clean upload_pypi upload-testpypi
install:
$(info Installing the repo)
ifeq ($(OS),Windows_NT)
@if not exist .venv mkdir .venv
else
@mkdir -p .venv
endif
pipenv install -e . --dev
build:
$(VENV_ACTIVATE) $(PYTHON) -m build
example:
$(VENV_ACTIVATE) $(PYTHON) examples/examples.py
test:
$(VENV_ACTIVATE) $(PYTHON) -m unittest discover -v -s ./tests -p "*test*.py"
clean:
ifeq ($(OS),Windows_NT)
@if exist build $(RMDIR) build
@if exist dist $(RMDIR) dist
@if exist .eggs $(RMDIR) .eggs
@if exist tempit.egg-info $(RMDIR) tempit.egg-info
else
$(RMDIR) build
$(RMDIR) dist
$(RMDIR) .eggs
$(RMDIR) tempit.egg-info
endif
upload-pypi: clean install test build check
# DEPRECATED
# Instead use tags and the pypi_release.yml will upload the Github release and pypi
# Push your changes to main
# git tag 0.0.1 # or whatever version needed
# git push origin --tags
# Upload to PyPI. Make sure you have in your ~/.pypirc file in home directory
$(VENV_ACTIVATE) $(PYTHON) -m twine upload dist/*
upload-testpypi: clean install test build check
# DEPRECATED
# Upload to TestPyPI. Make sure you have in your ~/.pypirc file in home directory
# Use $(PYTHON) -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ tempit
# for installing the testpypi version
# or use pipenv install tempit -i https://test.pypi.org/simple
$(VENV_ACTIVATE) $(PYTHON) -m twine upload --repository testpypi dist/*