diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 42b77d3..d9474df 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -39,6 +39,7 @@ RUN dnf -y --setopt=install_weak_deps=False reinstall $(dnf list --installed | a # Basic development tools RUN dnf -y --setopt=install_weak_deps=False install \ git \ + just \ which # Python diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2056121..4111665 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -47,8 +47,7 @@ } }, "updateContentCommand": { - "rust": ".devcontainer/check-rust.sh", - "python": ".devcontainer/setup-py.sh" + "reset-check": "just reset check" }, "postAttachCommand": { "python": ". .venv/bin/activate" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1703437..47691a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # FizzBuzz Changelog +## Python 1.3.1 + +- Clean before building each set of wheels to ensure that wheels compiled for non x86 linux architectures run correctly +- Add a justfile to make cleaning, linting, testing etc. easier + ## Rust 2.1.0 & Python 1.3.0 - Process `Vec`s / `list`s with more than 300k elements in parallel diff --git a/__pyversion__ b/__pyversion__ index 589268e..6261a05 100644 --- a/__pyversion__ +++ b/__pyversion__ @@ -1 +1 @@ -1.3.0 \ No newline at end of file +1.3.1 \ No newline at end of file diff --git a/justfile b/justfile new file mode 100644 index 0000000..3f8057e --- /dev/null +++ b/justfile @@ -0,0 +1,46 @@ +# list available recipes +list: + @just --list --justfile {{justfile()}} + +# remove pre-built rust and python libraries (excluding .venv) +clean: + cargo clean + rm -rf .pytest_cache + find . -depth -type d -not -path "./.venv/*" -name "__pycache__" -exec rm -rf "{}" \; + find . -depth -type d -path "*.egg-info" -exec rm -rf "{}" \; + find . -type f -name "*.egg" -delete + find . -type f -name "*.so" -delete + +# clean, remove existing .venv and rebuild the venv with pip install -e .[dev] +reset: clean + rm -rf .venv + python -m venv .venv + . .venv/bin/activate + python -m pip install --upgrade pip + pip install -e .[dev] + +# lint rust files with fmt & clippy +lint-rust: + - cargo fmt --check + - cargo clippy --workspace + +# test rust workspace +test-rust: + - cargo test --quiet --workspace + +# lint and test rust +check-rust: lint-rust test-rust + +# lint python with ruff +lint-python: + - ruff check . + +# test python +test-python: + - pytest + +# lint and test python +check-python: lint-python test-python + +# lint and test both rust and python +check: check-rust check-python \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6dbe7f5..b32708f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ skip = [ ] [tool.cibuildwheel.linux] -before-all = "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal" +before-all = "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal && cargo install just && just clean" environment = { PATH = "$HOME/.cargo/bin:$PATH" } archs = "all" test-command = "pytest {package}"