-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (43 loc) · 1.18 KB
/
Makefile
File metadata and controls
54 lines (43 loc) · 1.18 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
.PHONY: setup run build clean lint lint-fix package smoke
.DEFAULT_GOAL := check
setup:
uv venv
uv sync --extra dev
run:
uv run python src/garmincli/__main__.py
lint:
uv run ruff check src/
uv run ruff format --check src/
lint-fix:
uv run ruff check --fix src/
uv run ruff format src/
test:
uv run pytest
check: lint test
build:
uv run pyinstaller \
--onefile \
--name gc \
--target-arch arm64 \
--add-data "src/garmincli/commands:garmincli/commands" \
--collect-all garminconnect \
--hidden-import garth \
src/garmincli/__main__.py
package: build
@set -e;
VERSION=$$(grep '^version' pyproject.toml | head -1 | cut -d'"' -f2);
echo "Packaging gc v$$VERSION...";
cd dist &&
tar -czf "garmin-cli-$$VERSION-macos.tar.gz" gc &&
shasum -a 256 "garmin-cli-$$VERSION-macos.tar.gz"
smoke: build
@set -e; \
tmp_home="$$(mktemp -d)"; \
trap 'rm -rf "$$tmp_home"' EXIT; \
env -i PATH="/usr/bin:/bin:/usr/sbin:/sbin" HOME="$$tmp_home" \
PYTHONNOUSERSITE=1 PYTHONPATH= PYTHONHOME= \
VIRTUAL_ENV= CONDA_PREFIX= CONDA_DEFAULT_ENV= PIPENV_ACTIVE= \
PYENV_VERSION= UV_PROJECT_ENV= \
./dist/gc --help
clean:
rm -rf dist build __pycache__ src/garmincli/__pycache__