Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/with-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ USER user
WORKDIR /home/user

ENV PATH="/home/user/.local/bin:${PATH}"
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN curl -LsSf https://astral.sh/uv/install.sh | sh

RUN wget -O rustup.sh https://sh.rustup.rs && \
chmod +x rustup.sh && \
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ jobs:
uses: ./.github/actions/with-docker
with:
container-name: ${CONTAINER}
- name: 'Build komet'
run: docker exec --user user ${CONTAINER} poetry install
- name: 'Build semantics'
run: docker exec --user user ${CONTAINER} make kdist-build
- name: 'Run integration tests'
Expand All @@ -88,8 +86,6 @@ jobs:
uses: ./.github/actions/with-docker
with:
container-name: ${CONTAINER}
- name: 'Build komet'
run: docker exec --user user ${CONTAINER} poetry install
- name: 'Build semantics'
run: docker exec --user user ${CONTAINER} make kdist-build
- name: 'Run lemma tests'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v9
- name: 'Install uv'
uses: astral-sh/setup-uv@v5
- name: 'Update Poetry files'
run: |
PYKWASM_VERSION="$(cat deps/kwasm_release)"
sed -i 's!pykwasm = { git = "https://github.com/runtimeverification/wasm-semantics.git", tag = "[v0-9\.]*", subdirectory = "pykwasm" }!pykwasm = { git = "https://github.com/runtimeverification/wasm-semantics.git", tag = "v'${PYKWASM_VERSION}'", subdirectory = "pykwasm" }!' pyproject.toml
poetry update
git add . && git commit -m "Sync Poetry files ${PYKWASM_VERSION}" || true
sed -i 's! "pykwasm@git+https://github.com/runtimeverification/wasm-semantics.git@v[0-9\.]*#subdirectory=pykwasm",! "pykwasm@git+https://github.com/runtimeverification/wasm-semantics.git@v'${PYKWASM_VERSION}'#subdirectory=pykwasm",!'
uv lock --update
git add pyproject.toml uv.lock && git commit -m "pyproject.toml, uv.lock: Update pykwasm version ${PYKWASM_VERSION}" || true
- name: 'Update K release'
run: |
K_VERSION=$(poetry run python3 -c 'import pyk; print(pyk.__version__)')
Expand Down
74 changes: 32 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
POETRY := poetry
POETRY_RUN := $(POETRY) run
UV := uv
UV_RUN := $(UV) run


default: check test-unit
Expand All @@ -11,41 +11,31 @@ clean:
rm -rf dist .coverage cov-* .mypy_cache .pytest_cache
find -type d -name __pycache__ -prune -exec rm -rf {} \;

.PHONY: build
build:
$(POETRY) build

.PHONY: poetry-install
poetry-install:
$(POETRY) install


# Semantics

kdist-build: poetry-install
$(POETRY) run kdist -v build -j2 soroban-semantics.*

kdist-clean: poetry-install
$(POETRY) run kdist clean
kdist-build:
$(UV) run kdist -v build -j2 soroban-semantics.*

kdist-clean:
$(UV) run kdist clean

# Tests

TEST_ARGS :=

test: test-all

test-all: poetry-install
$(POETRY_RUN) pytest src/tests --maxfail=1 --verbose --durations=0 --numprocesses=4 --dist=worksteal $(TEST_ARGS)
test-all:
$(UV_RUN) pytest src/tests --maxfail=1 --verbose --durations=0 --numprocesses=4 --dist=worksteal $(TEST_ARGS)

test-unit: poetry-install
$(POETRY_RUN) pytest src/tests/unit --maxfail=1 --verbose $(TEST_ARGS)
test-unit:
$(UV_RUN) pytest src/tests/unit --maxfail=1 --verbose $(TEST_ARGS)

test-integration: poetry-install
$(POETRY_RUN) pytest src/tests/integration --maxfail=1 --verbose --durations=0 --numprocesses=4 --dist=worksteal $(TEST_ARGS)
test-integration:
$(UV_RUN) pytest src/tests/integration --maxfail=1 --verbose --durations=0 --numprocesses=4 --dist=worksteal $(TEST_ARGS)

test-lemmas: poetry-install
$(POETRY_RUN) pytest src/tests/lemmas --maxfail=1 --verbose --durations=0 --numprocesses=4 --dist=worksteal $(TEST_ARGS)
test-lemmas:
$(UV_RUN) pytest src/tests/lemmas --maxfail=1 --verbose --durations=0 --numprocesses=4 --dist=worksteal $(TEST_ARGS)

# Coverage

Expand All @@ -70,34 +60,34 @@ cov-integration: test-integration
format: autoflake isort black
check: check-flake8 check-mypy check-autoflake check-isort check-black

check-flake8: poetry-install
$(POETRY_RUN) flake8 src
check-flake8:
$(UV_RUN) flake8 src

check-mypy: poetry-install
$(POETRY_RUN) mypy src
check-mypy:
$(UV_RUN) mypy src

autoflake: poetry-install
$(POETRY_RUN) autoflake --quiet --in-place src
autoflake:
$(UV_RUN) autoflake --quiet --in-place src

check-autoflake: poetry-install
$(POETRY_RUN) autoflake --quiet --check src
check-autoflake:
$(UV_RUN) autoflake --quiet --check src

isort: poetry-install
$(POETRY_RUN) isort src
isort:
$(UV_RUN) isort src

check-isort: poetry-install
$(POETRY_RUN) isort --check src
check-isort:
$(UV_RUN) isort --check src

black: poetry-install
$(POETRY_RUN) black src
black:
$(UV_RUN) black src

check-black: poetry-install
$(POETRY_RUN) black --check src
check-black:
$(UV_RUN) black --check src


# Optional tools

SRC_FILES := $(shell find src -type f -name '*.py')

pyupgrade: poetry-install
$(POETRY_RUN) pyupgrade --py310-plus $(SRC_FILES)
pyupgrade:
$(UV_RUN) pyupgrade --py310-plus $(SRC_FILES)
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.64
0.1.65
Loading