1. Run make install-uv to install uv if not already installed
1. Run make install to install all dependencies and pre-commit hooks
- Fork the Advanced Alchemy repository
- Clone your fork locally with git
- Set up the environment
- Make your changes
- Run
make lintto run linters and formatters. This step is optional and will be executed automatically by git before you make a commit, but you may want to run it manually in order to apply fixes automatically by git before you make a commit, but you may want to run it manually in order to apply fixes - Commit your changes to git
- Push the changes to your fork
- Open a pull request. Give the pull request a descriptive title
indicating what it changes. If it has a corresponding open issue, the issue number should be included in the title as
well. For example a pull request that fixes issue
bug: Increased stack size making it impossible to find needle #100could be titledfix(#100): Make needles easier to find by applying fire to haystack
Tip
Pull requests and commits all need to follow the Conventional Commit format
Note
To run the integration tests locally, you will need the ODBC Driver for SQL Server, one option is using unixODBC.
- All code should be fully typed. This is enforced via mypy.
- All code should be tested. This is enforced via pytest.
- All code should be properly formatted. This is enforced via Ruff.
.. todo:: Write this section
The documentation is located in the /docs directory and is ReST and
Sphinx. If you're unfamiliar with any of those,
ReStructuredText primer and
Sphinx quickstart are recommended reads.
To run or build the docs locally, you need to first install the required dependencies:
make install
Then you can serve the documentation with make docs-serve, or build them with make docs.
Set up your environment
- Ensure you have the
ghCLI installed and logged in to GitHub. - Switch to the
mainbranch.
- Ensure you have the
Install and update dependencies
Run:
make install # Install all dependencies make upgrade # Update dependencies to the latest versions make docs # Verify documentation builds
Bump the version
Run:
make release bump=patch
Use
bump=minororbump=majorif you need to bump the minor or major version instead.
Prepare the release
Run:
uv run tools/prepare_release.py -c -i --base v{current_version} {new_version}Replace
{current_version}with the current version (e.g.,1.2.3).Replace
{new_version}with the new version (e.g.,1.2.4).Example:
uv run tools/prepare_release.py -c -i --base v1.4.4 1.4.5
Run linters and formatters
Ensure code style compliance:
make lint
Clean up the changelog
Open
docs/changelog.rstand remove any placeholder comments, such as:<!-- By submitting this pull request, you agree to ... --> <!-- Please add in issue numbers this pull request will close ... -->
Commit the release
Create a new branch:
git checkout -b v{new_version}Commit the changes:
git commit -am "chore(release): bump to v{new_version}"
Open a pull request
- Push the branch and create a PR into
main. - Merge once CI checks pass.
- Push the branch and create a PR into
Verify the release draft
- Once merged, a draft release will be created under
Releaseson GitHub. - Edit and publish it.
- Once merged, a draft release will be created under
Publish to PyPI
- Approve the
Latest Releaseworkflow underActionsto publish the package to PyPI.
- Approve the
Use pre-releases to publish alpha, beta, or release candidate versions. These follow
PEP 440 pre-release format (e.g., 1.10.0a1, 1.10.0b1, 1.10.0rc1).
Bump to a pre-release version
make pre-release version=1.10.0a1 # First alpha make pre-release version=1.10.0a2 # Second alpha make pre-release version=1.10.0b1 # First beta make pre-release version=1.10.0rc1 # First release candidate
Commit and push
git add -A && git commit -m "chore(release): bump to v1.10.0a1" git push origin HEAD
Create a GitHub pre-release
gh release create v1.10.0a1 --prerelease --title "v1.10.0a1"PyPI behavior
PyPI automatically marks PEP 440 pre-release versions:
- Users won't get pre-releases via
pip install advanced-alchemy - Users can opt-in via
pip install --pre advanced-alchemy - Or pin explicitly:
pip install advanced-alchemy==1.10.0a1
- Users won't get pre-releases via
From the last release candidate, bump the pre part to move past rc to stable:
make release bump=pre # e.g. 1.10.0rc1 → 1.10.0Or skip to the next stable version directly:
make release bump=patch # From any version → next patch
make release bump=minor # From any version → next minorThen follow the standard Creating a new release steps above.