Skip to content

Commit

Permalink
changed package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Kulaga committed Nov 23, 2024
1 parent fc73899 commit d14d120
Show file tree
Hide file tree
Showing 112 changed files with 656 additions and 134 deletions.
24 changes: 12 additions & 12 deletions bin/install_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ eval "$(micromamba shell hook --shell bash)"
micromamba activate just-agents

# Install packages in the correct order
echo "Installing just_agents package..."
cd just_agents
echo "Installing core package..."
cd core
pip install -e .
cd ..

echo "Installing just_agents_coding package..."
cd just_agents_coding
echo "Installing coding package..."
cd coding
pip install -e .
cd ..

echo "Installing just_agents_web package..."
cd just_agents_web
echo "Installing web package..."
cd web
pip install -e .
cd ..

echo "Installing just_agents_tools package..."
cd just_agents_tools
echo "Installing tools package..."
cd tools
pip install -e .
cd ..

echo "Installing just_agents_router package..."
cd just_agents_router
echo "Installing router package..."
cd router
pip install -e .
cd ..

echo "Installing just_agents_examples package..."
cd just_agents_examples
echo "Installing examples package..."
cd examples
pip install -e .
cd ..
51 changes: 36 additions & 15 deletions bin/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
# we assume that the script is running from the root of the project
# like this: ./bin/publish.sh

# Add environment variable check
if [ -z "$PYPI_TOKEN" ]; then
echo "Error: PYPI_TOKEN environment variable is not set"
exit 1
fi

# Parse command line arguments
skip_publish=false
while getopts "s" opt; do
case $opt in
s) skip_publish=true ;;
*) echo "Usage: $0 [-s]" >&2
echo " -s: Skip publishing to PyPI"
exit 1 ;;
esac
done

# Function to extract version from pyproject.toml
get_version() {
if [ ! -f "$1/pyproject.toml" ]; then
Expand All @@ -12,35 +29,39 @@ get_version() {
}

# 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
for pkg in core web tools coding router 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 just_agents_web just_agents_tools just_agents_coding just_agents_router just_agents_examples; do
base_version=$(get_version "core")
for pkg in core web tools coding router 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) != core ($base_version)"
exit 1
fi
done

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

# Upload all packages
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
# Upload all packages if not skipped
if [ "$skip_publish" = false ]; then
for pkg in core web tools coding router examples; do
echo "Uploading just_agents/$pkg..."
if [ -d "$pkg/dist" ]; then
twine upload --verbose "$pkg/dist/*" --username "__token__" --password "$PYPI_TOKEN" || { echo "Failed to upload just_agents/$pkg"; exit 1; }
else
echo "Warning: No dist directory found for just_agents/$pkg"
fi
done
else
echo "Skipping package upload (--skip-publish flag set)"
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 12 additions & 10 deletions just_agents_examples/pyproject.toml → coding/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,37 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "just-agents-examples"
version = "0.3.3"
description = "Just Agents - Example Components"
name = "just-agents-coding"
version = "0.3.7"
description = "Just Agents - Coding Components"
readme = "README.md"
requires-python = ">=3.10"
authors = [
{ name = "Alex Karmazin", email = "karmazinalex@gmail.com" },
{ name = "Anton Kulaga", email = "antonkulaga@gmail.com" },
{ name = "Newton Winter", email = "isoutthere@gmail.com" },
]
maintainers = [
{ name = "Anton Kulaga", email = "antonkulaga@gmail.com" },
{ name = "Newton Winter", email = "isoutthere@gmail.com" },
]
dependencies = [
"just-agents>=0.3.1",
"just-agents-coding>=0.3.1",
"just-agents-router>=0.3.1",
"just-agents-web>=0.3.1",
"just-agents-tools>=0.3.1",
"just-agents>=0.3.7",
"llm-sandbox>=0.1.4",
]
license = {text = "MIT"}

[tool.setuptools.packages.find]
where = ["."]
include = ["just_agents_examples*", "config*"]
include = ["just_agents*"]
exclude = [
"logs*",
"output*",
"*.egg-info",
"build",
"dist"
]

[tool.setuptools.package-data]
"config" = ["*.yaml", "*.yml"]
"just_agents_examples" = ["*.yaml", "*.yml"]
"just_agents" = ["*.yaml", "*.yml"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit d14d120

Please sign in to comment.