From 9b4b0f6165c367af452f219ee6f541c4f3e3d475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mayoral=20Vilches?= Date: Wed, 28 May 2025 12:00:06 +0000 Subject: [PATCH] v0.4.0 release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: VĂ­ctor Mayoral Vilches --- pyproject.toml | 45 ++++++++++++++++++++++++++++++++++++--- release_to_pypi.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 3 deletions(-) create mode 100755 release_to_pypi.sh diff --git a/pyproject.toml b/pyproject.toml index e4b237c7..3a2eb50e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,16 +89,55 @@ agents = { workspace = true } requires = ["hatchling"] build-backend = "hatchling.build" +[tool.hatch.build] +exclude = [ + ".trunk/", + ".git/", + ".vscode/", + ".devcontainer/", + ".mypy_cache/", + ".pytest_cache/", + ".ruff_cache/", + "venv/", + ".venv/", + "dist/", + "build/", + "*.egg-info/", + "workspaces/", + "benchmarks/", + "logs/", + "site/", + ".cai/", + "nohup.out" +] + [tool.hatch.build.targets.wheel] packages = ["src/cai", "tools"] +exclude = [ + ".trunk/", + ".git/", + ".vscode/", + ".devcontainer/", + ".mypy_cache/", + ".pytest_cache/", + ".ruff_cache/", + "venv/", + ".venv/", + "dist/", + "build/", + "*.egg-info/", + "workspaces/", + "benchmarks/", + "logs/", + "site/", + ".cai/", + "nohup.out" +] [tool.hatch.build.targets.wheel.sources] "src" = "" "tools" = "tools" -[tool.hatch.build.targets.wheel.force-include] -"src/cai/prompts" = "cai/prompts" - [tool.ruff] line-length = 100 target-version = "py39" diff --git a/release_to_pypi.sh b/release_to_pypi.sh new file mode 100755 index 00000000..3b91de94 --- /dev/null +++ b/release_to_pypi.sh @@ -0,0 +1,52 @@ +#!/bin/bash +set -e + +echo "Preparing cai-framework for PyPI release..." + + +# Install required build tools without upgrading pip +# pip install --upgrade pip setuptools wheel twine build +pip install setuptools wheel twine build + +# Check if pyproject.toml exists +if [ ! -f "pyproject.toml" ]; then + echo "ERROR: pyproject.toml is missing" + exit 1 +fi + + +# Check if README.md exists +if [ ! -f "README.md" ]; then + echo "ERROR: README.md is missing" + exit 1 +fi + +# Clean previous builds +rm -rf build/ dist/ *.egg-info/ .eggs/ +# Also clean any cached build files +rm -rf src/*.egg-info/ + +# Build the package +echo "Building package..." +python3 -m build + +# Check the package +echo "Running twine check..." +twine check dist/* + +echo "" +echo "Package is ready for upload!" +echo "" +echo "To upload to TestPyPI (recommended for testing):" +echo "twine upload --repository testpypi dist/*" +echo "" +echo "To upload to PyPI (production):" +echo "twine upload dist/*" +echo "" +echo "After uploading to TestPyPI, you can install with:" +echo "pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple cai-framework" +echo "" +echo "To test in a clean environment:" +echo "python3 -m venv test_env" +echo "source test_env/bin/activate" +echo "pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple cai-framework"