This assumes you have uv installed, otherwise please follow these instructions.
# fetch this repo
git clone git@github.com:xorq-labs/xorq.git
# set uv run command to not sync
export UV_NO_SYNC=1
# prepare development environment and install dependencies (including current package)
uv sync --all-extras --all-groups
# activate the venv
source .venv/bin/activate
# set up the git hook scripts
uv run pre-commit installImportant
Rename .gitignore.template to .gitignore
Install the just command runner, if needed. Download example data to run the tests successfully.
just download-dataPopulate the environment variables:
export POSTGRES_DATABASE=ibis_testing
export POSTGRES_HOST=localhost
export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=postgres
export POSTGRES_PORT=5432To test the code:
# make sure you activate the venv using "source venv/bin/activate" first
just up postgres # some of the tests use postgres
python -m pytest # or pytestxorq follows the Conventional Commits structure. In brief, the commit summary should look like:
fix(types): make all floats doubles
The type (e.g. fix) can be:
fix: A bug fix. Correlates with PATCH in SemVerfeat: A new feature. Correlates with MINOR in SemVerdocs: Documentation only changesstyle: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
If the commit fixes a GitHub issue, add something like this to the bottom of the description:
fixes #4242
Tip
Read our style guide to learn more about our writing style.
To build or preview the documentation locally, follow the steps below.
-
Install Quarto
Follow the official Quarto installation guide: https://quarto.org/docs/get-started/
-
Install required Python dependencies
Run the following to install all development, test, and documentation dependencies:
uv sync --locked --group dev --group test --group docs --extra examples -
Build and preview the documentation
cd docs # ensure you are in the docs directory uv run --no-sync quartodoc build --verbose --config _quarto.yml uv run --no-sync quarto preview
This will build the API reference and launch a local preview server so you can iterate on documentation changes.
xorq-datafusion is a Backend developed by xorq labs based on the DataFusion query engine, occasionally we make change to it that must be reflected in xorq. So when working with both repos, the following workflow is proposed:
- Add the following config in
pyproject.tomlofxorq(see more in here):
[tool.uv.sources]
xorq-datafusion = { path = "local/path/to/xorq-datafusion-repo" }- Make changes to
xorq-datafusion(add tests if required). - Verify the change in xorq via tests.
- Commit the changes to
xorq-datafusion, open a PR, commit to main, and release a new version ofxorq-datafusion. - Remove
tool.uv.sourcesfrom thepyproject.tomland open a PR with the respective change toxorq.
Notice that our test run with --no-sources so they will fail if a new version of xorq-datafusion with the required
change is not present in PyPI.
This section is intended for xorq maintainers
- Ensure you're on upstream main:
git switch main && git pull - Compute the new version number (
$version_number) according to Semantic Versioning rules. - Create a branch that starts from the upstream main:
git switch --create=release-$version_number - Update the version number in
pyproject.toml:version = "$version_number" - Update the CHANGELOG using
git cliff --github-repo xorq-labs/xorq -p CHANGELOG.md --tag v$version_number -u, manually add any additional notes (links to blogposts, etc.). - Create commit with a message denoting the release:
git add --update && git commit -m "release: $version_number". - Push the new branch:
git push --set-upstream upstream "release-$version_number" - Open a PR for the new branch
release-$version_number - Trigger the ci-pre-release action from the branch created: Run workflow -> Use workflow from -> Branch
$version_number - Wait for all ci-pre-release tests to pass
- "Squash and merge" the PR
- Tag the updated main with
v$version_numberand push the tag:git fetch && git tag v$version_number origin/main && git push --tags - Create a GitHub release to trigger the publishing workflow.