Skip to content

Commit 5c0f22c

Browse files
committed
bump, test, publish scripts
1 parent c183faa commit 5c0f22c

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

bump.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ -z "$1" ]; then
6+
echo "Usage: ./bump.sh <new_version>"
7+
echo "Example: ./bump.sh 0.0.2"
8+
exit 1
9+
fi
10+
11+
NEW_VERSION=$1
12+
13+
echo "Bumping version to $NEW_VERSION..."
14+
15+
# Update openapi-config.json
16+
jq ".packageVersion = \"$NEW_VERSION\"" openapi-config.json > openapi-config.json.tmp && mv openapi-config.json.tmp openapi-config.json
17+
echo "✓ Updated openapi-config.json packageVersion to $NEW_VERSION"
18+
19+
# Update pyproject.toml
20+
sed -i "s/^version = .*/version = \"$NEW_VERSION\"/" pyproject.toml
21+
echo "✓ Updated pyproject.toml version to $NEW_VERSION"
22+
23+
echo "Done! Version bumped to $NEW_VERSION"

publish.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Get version from pyproject.toml
6+
VERSION=$(grep "^version = " pyproject.toml | cut -d'"' -f2)
7+
8+
echo "Publishing FastComments Python SDK v$VERSION..."
9+
10+
# Clean up old builds
11+
echo "Cleaning up old builds..."
12+
rm -rf dist/ build/ *.egg-info
13+
14+
# Build the package
15+
echo "Building the package..."
16+
python3 -m pip install --upgrade build twine
17+
python3 -m build
18+
19+
# Check the package
20+
echo "Checking the package..."
21+
python3 -m twine check dist/*
22+
23+
echo ""
24+
echo "Package built successfully!"
25+
echo "To publish to PyPI, run:"
26+
echo " python3 -m twine upload dist/*"
27+
echo ""
28+
echo "Or to test on TestPyPI first:"
29+
echo " python3 -m twine upload --repository testpypi dist/*"
30+
echo ""
31+
echo "Users can then install it with:"
32+
echo " pip install fastcomments-python"

test.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
echo "Running FastComments Python SDK tests..."
6+
7+
# Check required environment variables
8+
if [ -z "$FASTCOMMENTS_API_KEY" ] || [ -z "$FASTCOMMENTS_TENANT_ID" ]; then
9+
echo "Error: FASTCOMMENTS_API_KEY and FASTCOMMENTS_TENANT_ID environment variables must be set"
10+
exit 1
11+
fi
12+
13+
# Activate virtual environment if it exists
14+
if [ -d "venv" ]; then
15+
source venv/bin/activate
16+
fi
17+
18+
# Install dependencies if needed
19+
if [ ! -d "venv" ]; then
20+
echo "Creating virtual environment..."
21+
python3 -m venv venv
22+
source venv/bin/activate
23+
echo "Installing dependencies..."
24+
pip install -e ".[dev]"
25+
fi
26+
27+
# Run unit tests
28+
echo "Running unit tests..."
29+
pytest tests/test_sso.py -v
30+
31+
echo ""
32+
echo "Running integration tests..."
33+
pytest tests/test_sso_integration.py -v
34+
35+
echo ""
36+
echo "✓ All tests passed!"

0 commit comments

Comments
 (0)