-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (62 loc) · 1.96 KB
/
Copy pathMakefile
File metadata and controls
79 lines (62 loc) · 1.96 KB
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
ifeq ($(OS),Windows_NT)
RMDIR := rmdir /s /q
else
RMDIR := rm -rf
endif
.PHONY: test lint format deps clean build bump-major bump-minor bump-patch publish pack mix
TEST_PUBLISHED_OUTPUT := testpublishedoutput
deps:
uv sync --all-extras
test: lint
uv run pytest
# Check formatting and lint rules without touching anything. This is what CI
# and the release targets run.
lint: deps
uv run ruff format --check .
uv run ruff check .
# Apply the formatter and every autofixable lint rule.
format: deps
uv run ruff format .
uv run ruff check --fix .
clean:
-$(RMDIR) dist
-$(RMDIR) build
-$(RMDIR) src/libigc.egg-info
-$(RMDIR) $(TEST_PUBLISHED_OUTPUT)
build: clean test
uv build
# `$(ARGS)` allows passwing additional arguments to the command.
# For testing during development, you can run `make bump-major ARGS="--allow-dirty"`
bump-major: test
uv run bump-my-version bump major $(ARGS)
bump-minor: test
uv run bump-my-version bump minor $(ARGS)
bump-patch: test
uv run bump-my-version bump patch $(ARGS)
publish: build
uv run twine upload dist/* --verbose $(ARGS)
# Publish to Test PyPI (https://test.pypi.org/) for testing purposes.
test-publish: build
uv run twine upload -r testpypi dist/* --verbose $(ARGS)
# Run example script against the package published to Test PyPI, rather than
# against this checkout. --no-project keeps the local sources off sys.path and
# --with pulls libigc from the index.
# --index-strategy unsafe-best-match
# We need to force it to look for other dependencies from the regular pypi server.
# We save the output to a directory, and delete it afterwards if successful.
test-testpypi-artifact:
uv run \
--no-cache \
--no-project \
--with libigc \
--index https://test.pypi.org/simple/ \
--verbose \
--index-strategy unsafe-best-match \
examples/libigc_demo.py \
tests/testfiles/napret.igc \
tests/testfiles/napret.lkt \
-o $(TEST_PUBLISHED_OUTPUT)
-$(RMDIR) $(TEST_PUBLISHED_OUTPUT)
pack:
repomix
mix: pack