-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathrelease_to_pypi.sh
More file actions
executable file
·52 lines (42 loc) · 1.34 KB
/
release_to_pypi.sh
File metadata and controls
executable file
·52 lines (42 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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"