Skip to content

Commit

Permalink
fixed publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Kulaga committed Nov 20, 2024
1 parent 51bb7ea commit d437b94
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
3 changes: 2 additions & 1 deletion environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ dependencies:
- pip
- pip:
- litellm>=1.52.9
- numpydoc
- numpydoc #for tool calling
- build #for building
- semanticscholar>=0.8.4 #for just-agents-tools
- llm-sandbox>=0.1.4 #for just-agents-coding
- loguru #for just-agents-web
Expand Down
50 changes: 27 additions & 23 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,43 @@

# Function to extract version from pyproject.toml
get_version() {
if [ ! -f "$1/pyproject.toml" ]; then
echo "Error: $1/pyproject.toml not found"
exit 1
fi
grep 'version = ' "$1/pyproject.toml" | cut -d'"' -f2
}

# Check if directories exist
for pkg in just_agents just_agents_web just_agents_tools just_agents_coding just_agents_router just_agents_examples; do
if [ ! -d "$pkg" ]; then
echo "Error: Directory $pkg not found"
exit 1
fi
done

# Check versions
base_version=$(get_version "just-agents")
for pkg in just-agents-web just-agents-tools just-agents-coding just-agents-router just-agents-examples just-agents-all; do
base_version=$(get_version "just_agents")
for pkg in just_agents just_agents_web just_agents_tools just_agents_coding just_agents_router just_agents_examples; do
pkg_version=$(get_version "$pkg")
if [ "$base_version" != "$pkg_version" ]; then
echo "Version mismatch: $pkg ($pkg_version) != just-agents ($base_version)"
echo "Version mismatch: $pkg ($pkg_version) != just_agents ($base_version)"
exit 1
fi
done

# Remove old distributions
rm -rf dist/
rm -rf */dist/
rm -rf *.egg-info
rm -rf */*.egg-info

# Build each package
cd just-agents && python -m build && cd ..
cd just-agents-web && python -m build && cd ..
cd just-agents-tools && python -m build && cd ..
cd just-agents-coding && python -m build && cd ..
cd just-agents-router && python -m build && cd ..
cd just-agents-examples && python -m build && cd ..
cd just-agents-all && python -m build && cd ..
for pkg in just_agents just_agents_web just_agents_tools just_agents_coding just_agents_router just_agents_examples; do
echo "Building $pkg..."
(cd "$pkg" && python -m build) || { echo "Failed to build $pkg"; exit 1; }
done

# Upload all packages
twine upload --verbose just-agents/dist/* --config-file .pypirc
twine upload --verbose just-agents-web/dist/* --config-file .pypirc
twine upload --verbose just-agents-tools/dist/* --config-file .pypirc
twine upload --verbose just-agents-coding/dist/* --config-file .pypirc
twine upload --verbose just-agents-router/dist/* --config-file .pypirc
twine upload --verbose just-agents-examples/dist/* --config-file .pypirc
twine upload --verbose just-agents-all/dist/* --config-file .pypirc
for pkg in just_agents just_agents_web just_agents_tools just_agents_coding just_agents_router just_agents_examples; do
echo "Uploading $pkg..."
if [ -d "$pkg/dist" ]; then
twine upload --verbose "$pkg/dist/*" --config-file .pypirc || { echo "Failed to upload $pkg"; exit 1; }
else
echo "Warning: No dist directory found for $pkg"
fi
done

0 comments on commit d437b94

Please sign in to comment.