-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
88 lines (70 loc) · 2.53 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = sourcedocs
BUILDDIR = docs
# Default Docker command for CPython
DOCKER_CMD = curl -sL https://deb.nodesource.com/setup_20.x | bash \
&& apt-get update \
&& apt-get install -y nodejs \
&& cd /root \
&& cp -r /app/* . \
&& pip install poetry \
&& poetry install \
&& poetry run py.test
# Separate Docker command for PyPy
# Installs an up-to-date Rust toolchain with rustup (rather than older distro cargo/rustc).
# Also upgrades pip/setuptools/wheel/maturin to avoid potential parse issues.
DOCKER_CMD_PYPY = curl -sL https://deb.nodesource.com/setup_20.x | bash \
&& apt-get update \
&& apt-get install -y nodejs curl build-essential \
&& curl https://sh.rustup.rs -sSf | sh -s -- -y \
&& . /root/.cargo/env \
&& cd /root \
&& cp -r /app/* . \
&& pip install poetry \
&& poetry install \
&& poetry run py.test
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
test38:
echo "TEST PYTHON 3.8"
docker run -i --rm -v $(shell pwd):/app python:3.8 bash -c "$(DOCKER_CMD)"
test39:
echo "TEST PYTHON 3.9"
docker run -i --rm -v $(shell pwd):/app python:3.9 bash -c "$(DOCKER_CMD)"
test310:
echo "TEST PYTHON 3.10"
docker run -i --rm -v $(shell pwd):/app python:3.10 bash -c "$(DOCKER_CMD)"
test311:
echo "TEST PYTHON 3.11"
docker run -i --rm -v $(shell pwd):/app python:3.11 bash -c "$(DOCKER_CMD)"
test312:
echo "TEST PYTHON 3.12"
docker run -i --rm -v $(shell pwd):/app python:3.12 bash -c "$(DOCKER_CMD)"
test313:
echo "TEST PYTHON 3.13"
docker run -i --rm -v $(shell pwd):/app python:3.13 bash -c "$(DOCKER_CMD)"
test-pypy39:
echo "TEST PYPY 3.9"
docker run -i --rm -v $(shell pwd):/app pypy:3.9 bash -c "$(DOCKER_CMD_PYPY)"
test-pypy310:
echo "TEST PYPY 3.10"
docker run -i --rm -v $(shell pwd):/app pypy:3.10 bash -c "$(DOCKER_CMD_PYPY)"
test: test38 test39 test310 test311 test312 test313 test-pypy39 test-pypy310
echo "OK"
clear:
-rm -r $(shell find . -name __pycache__) build dist .mypy_cache aiosonic.egg-info .eggs
build: clear
poetry build
upload_pypi: build
twine upload dist/*
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)