Python bindings to softprops's Rust codeowners library.
To allow Python users to parse codeowners files without having to rewrite
an existing implementation.
poetry add codeowners
from codeowners import CodeOwners
example_file = """\
# owners for js files
owners = CodeOwners(example_file)
assert owners.of("test.js") == [('USERNAME', '@ghost')]
cargo test --no-default-features
# trying a build in Python
./.venv/bin/python -c "import codeowners; print(codeowners.CodeOwners)"
Releasing a New Version
# bump version in Cargo.toml
# build the macos version
./.venv/bin/pyo3-pack build --release
# build the linux versions
# Note: this is just the version for the builder container
docker build -f build.Dockerfile . --tag "$TAG"
# Note: building the Python versions can take a while if you are running Docker inside a VM
docker run --rm -v $(pwd):/io "$TAG" build --release
# upload wheels to PyPi
# Note: this will prompt for PyPi creds
./.venv/bin/twine upload --skip-existing target/wheels/*
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.