-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
70 lines (56 loc) · 2.92 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
.PHONY: publish
publish: release ## alias for `make release`
.PHONY: release
release: cronjob_scripts/.python-deps-updated.timestamp ## Publish a new release
(cd cargo-quickinstall/ && cargo release patch --execute --no-push)
git push origin HEAD:release --tags
$(MAKE) recheck
# This is a poor man's lockfile.
# This format is used because it is well supported by dependabot etc.
# but for now, we do not have access to `uv` in CI and don't automatically update requirements.txt
# as part of our make rules. I might revisit this decision later.
requirements.txt: pyproject.toml ## Compile the python dependencies from pyproject.toml into requirements.txt
uv pip compile pyproject.toml --python-version=3.8 --output-file requirements.txt
.venv/bin/python:
python -m venv .venv
# install python dependencies and then record that we've done so so we don't do it again
cronjob_scripts/.python-deps-updated.timestamp: pyproject.toml .venv/bin/python
.venv/bin/python --version
.venv/bin/python -m pip install --constraint requirements.txt --editable .
touch cronjob_scripts/.python-deps-updated.timestamp
.PHONY: windows
windows: cronjob_scripts/.python-deps-updated.timestamp ## trigger a windows build
TARGET_ARCH=x86_64-pc-windows-msvc .venv/bin/trigger-package-build
.PHONY: mac
mac: cronjob_scripts/.python-deps-updated.timestamp ## trigger a mac build
TARGET_ARCH=x86_64-apple-darwin .venv/bin/trigger-package-build
.PHONY: m1
m1: cronjob_scripts/.python-deps-updated.timestamp ## trigger a mac m1 build
TARGET_ARCH=aarch64-apple-darwin .venv/bin/trigger-package-build
.PHONY: linux
linux: cronjob_scripts/.python-deps-updated.timestamp ## trigger a linux build
TARGET_ARCH=x86_64-unknown-linux-gnu .venv/bin/trigger-package-build
.PHONY: linux-musl
linux-musl: cronjob_scripts/.python-deps-updated.timestamp ## trigger a musl libc-based linux build
TARGET_ARCH=x86_64-unknown-linux-musl .venv/bin/trigger-package-build
.PHONY: recheck-self-only
recheck-self-only: cronjob_scripts/.python-deps-updated.timestamp ## build ourself on all arches
RECHECK_ONLY=cargo-quickinstall TARGET_ARCH=all .venv/bin/trigger-package-build
.PHONY: trigger-all
trigger-all: cronjob_scripts/.python-deps-updated.timestamp ## build some random packages on all arches
TARGET_ARCH=all .venv/bin/trigger-package-build
.PHONY: fmt
fmt: ## run rustfmt and ruff format
cargo fmt
.venv/bin/ruff format cronjob_scripts
.PHONY: test-cronjob-scripts
test-cronjob-scripts: cronjob_scripts/.python-deps-updated.timestamp ## run the tests for the python cronjob_scripts
.venv/bin/ruff format --check cronjob_scripts
.venv/bin/ruff check cronjob_scripts
.venv/bin/python -m unittest discover -s cronjob_scripts
.venv/bin/trigger-package-build --help
.venv/bin/crates-io-popular-crates
.venv/bin/stats
.PHONY: help
help: ## Display this help screen
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'