Skip to content

🏗️ Building & Packaging Siyarix

Welcome to the build guide! Siyarix uses hatchling as its build system. This document covers building from source, packaging, and deploying. Since this is a growing personal project, the build scripts are designed to be as simple and useful as possible.

Note

If you just want to install and use Siyarix, head over to the main installation guide. This page is primarily for developers helping out with the code!

🛠️ Build System

Siyarix uses hatchling for the build process.

[build-system]
requires = ["hatchling>=1.21.1"]
build-backend = "hatchling.build"

📦 Build from Source

Building the source code is straightforward:

# Install the build tool
pip install build

# Run the build process
python -m build

# 🎯 Your artifacts will be ready in the dist/ folder:
# dist/siyarix-1.2.0-py3-none-any.whl
# dist/siyarix-1.2.0.tar.gz

Development Installation

If you are actively developing Siyarix, install it in editable mode:

pip install -e ".[all,cli,siem,dev]"

🚀 Publishing to PyPI

If you're a maintainer publishing a release:

pip install twine
python -m build

# ⚠️ Always test your release on TestPyPI first!
twine upload --repository testpypi dist/*

# ✅ Once verified, push to production
twine upload dist/*

🧩 Optional Extras

Extras match pyproject.toml (source of truth). Install only what you need:

Extra What it provides
terminal Rich, prompt-toolkit, Textual (+ Win32 helpers)
cli Typer + terminal stack
siem httpx for SIEM integrations
autonomous Anthropic + OpenAI SDKs
openai / anthropic Single-provider SDKs
gemini Documented no-op — Gemini uses native REST via httpx (core); extra kept so pip install siyarix[gemini] stays valid
api Reserved FastAPI / Uvicorn / PyJWT — no in-tree HTTP server yet (FEAT-02). Not pulled by [all]
security Bandit, pip-audit
mobile / windows Thin platform helpers over terminal
all cli + siem + autonomous + security + mobile + windows — excludes api
dev Pytest, ruff, mypy, pre-commit, build, twine, …

Examples:

pip install "siyarix[autonomous]"
pip install "siyarix[all]"          # does not install the reserved api extra
pip install "siyarix[api]"          # deps only — no runnable HTTP API in-tree
pip install "siyarix[dev]"

📁 Package Structure

A quick look at the directory layout:

siyarix/
├── src/siyarix/          # Package source
├── tests/                # Test suite
├── packages/             # Platform-specific packaging
├── docs/                 # Documentation (Built with MkDocs)
├── scripts/              # Utility scripts
├── Dockerfile            # Docker build
└── pyproject.toml        # Build configuration & metadata

🌍 Platform Packages

Here's how to install Siyarix:

🐍 pip (Cross-Platform)

pip install siyarix
pip install "siyarix[all]"

🐳 Docker

I've also included a Dockerfile if you prefer containers.

# Build the image
docker build -t siyarix:latest .

# Run a quick command
docker run siyarix:latest scan --help

🔄 CI/CD Automation

I use GitHub Actions to automate testing and checks on PRs: - Tests across Python 3.11+ - CodeQL analysis - Dependabot for dependency updates

🛠️ Makefile Targets

I've wrapped common operations in a Makefile:

Target Description
make install Install dependencies
make install-dev Install all development dependencies
make test Run the test suite
make lint Run Ruff linter
make typecheck Run MyPy
make build Build the sdist and wheel
make docs Build the documentation

Danger

Always try to run make test, make lint, and make typecheck before pushing code.

✅ Publishing Checklist

Before shipping a new release: 1. Update version in pyproject.toml. 2. Document changes in CHANGELOG.md. 3. Run tests: pytest 4. Lint: ruff check src/ 5. Verify types: mypy src/siyarix/ 6. Build artifacts: python -m build 7. Upload to PyPI via twine. 8. Tag the release.