For Maintainers¶
This guide covers release management, CI/CD, and maintenance tasks for SLAF maintainers.
CI/CD Pipeline¶
The project uses GitHub Actions for automated testing and deployment:
Automated Checks¶
- Lint and Format: Code formatting and style checks
- Type Check: Static type checking with mypy
- Test Suite: Full test suite with coverage reporting
- Security: Vulnerability scanning with bandit and safety
- Build: Package building and validation
- Integration Tests: Additional integration tests
Deployment¶
- Documentation: Automatically deployed to GitHub Pages on main branch
- Coverage: Uploaded to Codecov with 70% minimum requirement
- Security Reports: Generated as artifacts
Release Management¶
PyPI Setup (One-time)¶
-
Create PyPI Account:
-
Go to PyPI
-
Create an account and verify email
-
Create API Token:
-
Go to PyPI API Tokens
- Create token with "Entire account" scope
-
Copy the token
-
Add to GitHub Secrets:
- Go to your GitHub repo →
Settings
→Secrets and variables
→Actions
- Add secret:
PYPI_API_TOKEN
with your PyPI token
Release Process¶
The release process is automated through GitHub Actions:
-
Prepare Release:
-
Go to
Actions
→Prepare Release
- Choose release type:
patch
,minor
, ormajor
-
The workflow will:
- Calculate the next version number
- Update
pyproject.toml
anduv.lock
- Generate a changelog with recent commits
- Create and push a release branch
- Provide direct links to create a PR
-
Create Pull Request:
-
Click the provided link in the workflow output
- Or go to:
https://github.com/slaf-project/slaf/compare/main...release-{VERSION}
-
Use the default title and description below
-
Create Release Tag:
- Automatic Publishing:
- The release workflow automatically:
- Builds the package
- Runs tests
- Publishes to PyPI
- Creates a GitHub release
CLI Release Commands¶
For manual release management:
# Prepare release (updates version and changelog)
slaf release prepare --type patch
# Run tests
slaf release test
# Build package
slaf release build
# Check package
slaf release check
Default PR Title and Message¶
When creating a release PR, use these defaults:
Title:
Description:
## Release 0.1.1
This PR prepares the release for version 0.1.1.
### Changes:
- Updated version in pyproject.toml
- Updated uv.lock
- Generated changelog
### Next steps:
1. Review the changes
2. Merge this PR
3. Create a tag: `git tag v0.1.1`
4. Push the tag: `git push origin v0.1.1`
The release workflow will automatically publish to PyPI when the tag is pushed.
Package Configuration¶
Version Management¶
The package version is managed in pyproject.toml
:
Dependencies¶
Dependencies are organized in optional groups:
[project.optional-dependencies]
dev = ["pytest>=8.0.0", "ruff==0.12.2", "mypy>=1.8.0", ...]
docs = ["mkdocs>=1.5.0", "mkdocs-material>=9.5.0", ...]
test = ["pytest>=8.0.0", "pytest-cov>=6.2.0", "coverage>=7.9.1"]
Documentation Management¶
Local Development¶
Examples Management¶
# List available examples
slaf examples --list
# Export all examples to HTML
slaf examples --export
# Export specific example
slaf examples --export getting-started
Troubleshooting¶
Common Issues¶
- Release fails: Check PyPI API token in GitHub secrets
- Tests fail: Review coverage reports and add tests
- Build fails: Check package configuration in pyproject.toml
- Documentation fails: Verify mkdocs configuration