Contributing¶
The source lives at https://github.com/vexyart/vexy-glob. Bug reports and pull requests go to the GitHub issue tracker and pull request queue.
Prerequisites¶
- Python 3.8 or newer (3.12 is used in the examples)
- A Rust toolchain from https://rustup.rs/, with
rustfmtandclippy uv
Set up a development build¶
-
Clone the repository and enter it:
-
Create and activate a virtual environment:
-
Install the build and test tools:
-
Compile the extension into the environment:
Repeat this step after every change to a
.rsfile. Python-only changes invexy_glob/take effect without rebuilding.
Run the tests¶
| Command | What it runs |
|---|---|
python -m pytest tests/ -v |
Python test suite (tests/test_*.py) |
cargo test |
Rust unit tests in src/ |
cargo bench |
Criterion benchmarks in benches/ |
The tests/platform_tests/ directory holds platform-specific checks with
their own runner, tests/platform_tests/run_platform_tests.py.
Code style¶
Python:
pyproject.toml sets target-version = "py38" and a line length of 100.
Keep the code importable on Python 3.8.
Rust:
The CI workflow runs cargo fmt -- --check and cargo clippy -- -D warnings.
Build the documentation¶
The documentation sources are the Markdown files in src_docs/md/, and the
configuration is src_docs/mkdocs.yml. The site is built with ProperDocs and
the MaterialX theme into docs/, which GitHub Pages serves at
https://vexy.dev/vexy-glob/.
-
Preview with live reload:
Open http://127.0.0.1:8000.
-
Build the site in strict mode:
Any warning, such as a broken link between pages, stops the build.
You do not need to commit docs/ by hand. The Docs workflow
(.github/workflows/docs.yml) rebuilds it on every push to main that
changes src_docs/, and commits the result.
Build the package¶
This deletes dist/, runs uv build (source distribution plus one wheel for
the current machine, built by maturin from the source distribution) and runs
twine check on the results. ./build.sh with no argument builds the
documentation as well; ./build.sh docs builds only the documentation.
Releasing¶
Why the version needs care¶
maturin writes the version from Cargo.toml into every wheel and the source
distribution. It does not read git tags. A tag v1.2.3 on a commit whose
Cargo.toml says 1.2.2 would publish files labelled 1.2.2. Also, a local
build produces a wheel for one platform only, so the published wheels must come
from CI.
The release procedure¶
Prerequisites: push access to vexyart/vexy-glob, uv on your PATH, and a
working tree whose uncommitted changes you are ready to release, because the
script commits all of them.
-
Add a section for the new version to
CHANGELOG.md, headed## [X.Y.Z]. The GitHub release takes its notes from that section. -
Run the release script from the repository root:
The script:
- fetches tags from
originand stops if your branch is behind its upstream; - finds the highest
vX.Y.Ztag and adds 1 to the patch number, the same rulegitnextveruses (v1.0.10becomesv1.0.11); - stops if that tag already exists;
- writes the new version into
Cargo.toml; - runs
./build.sh packageas a check that the package still builds; - runs
uvx gitnextver, which commits all pending changes with the tag name as the message, creates the tag and pushes the branch and the tags; - checks that
HEADcarries the tag it computed in step 2.
Nothing is uploaded from your machine.
- fetches tags from
-
Watch the
Releaseworkflow in the repository's Actions tab. On the tag push it:- fails early if the tag does not equal the
Cargo.tomlversion; - builds wheels for Linux (
x86_64,aarch64), macOS (x86_64,arm64) and Windows (x64), and the source distribution, withPyO3/maturin-action; - uploads all files to PyPI with
uv publish, skipping files that are already there; - creates the GitHub release.
- fails early if the tag does not equal the
-
Check the result on https://pypi.org/project/vexy-glob/.
The upload step needs PyPI credentials in the repository: either a
PYPI_API_TOKEN secret, or a PyPI trusted publisher configured for the
vexyart/vexy-glob repository and the release.yml workflow.
If something goes wrong¶
- The script stops before
gitnextver. Nothing was committed or pushed.Cargo.tomlmay already hold the new version; keep it or restore it withgit checkout Cargo.toml. - The tag check in the workflow fails. The tag and
Cargo.tomldisagree. Nothing was uploaded. Delete the tag locally and on GitHub, fixCargo.toml, and release again. - A wheel job fails. Nothing was uploaded, because the upload job waits for all build jobs. Fix the problem and re-run the failed jobs, or release a new patch version.