Skip to content

Commit

Permalink
Clean build (#25)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
MusicalNinjaDad authored May 14, 2024
1 parent ce45da7 commit 52ac846
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 4 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion __pyversion__
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.1
46 changes: 46 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 52ac846

Please sign in to comment.