Skip to content

Commit

Permalink
merge cmd to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Oct 25, 2024
1 parent 67bacc3 commit b6337bd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -39,8 +42,8 @@ jobs:
- name: Install tzfpy and test
shell: bash
run: |
uv run ruff check .
uv run pytest | tee benchmark_result.txt
make lint
make test | tee benchmark_result.txt
- name: Setup benchmark file name
id: gen-benchmark-file-name
Expand Down
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export PYTHONPATH := $(shell pwd)
export UV_PYTHON_PREFERENCE=only-system
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
export CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true

build:
uv build

fmt:
uv run ruff check --select I --fix .
uv run ruff format .

lint:
uv run ruff check .
uv run ruff format --check .

sync:
uv sync --compile

lock:
uv lock

upgrade:
uv lock --upgrade

all: lock sync
make fmt
make lint
make test

test: lint
uv run pytest -v .

0 comments on commit b6337bd

Please sign in to comment.