Skip to content

Commit

Permalink
Merge pull request #1169 from swarmauri/mono/dev
Browse files Browse the repository at this point in the history
Mono/dev
  • Loading branch information
cobycloud authored Feb 19, 2025
2 parents 11f8950 + 105a200 commit 77c4646
Show file tree
Hide file tree
Showing 1,000 changed files with 28,455 additions and 3,079 deletions.
File renamed without changes.
File renamed without changes.
17 changes: 8 additions & 9 deletions .github/workflows/v0.6.0_prepare_install_publish_single.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ name: 0.6.0 - Single (Prepare, Install, Publish)
on:
workflow_dispatch:
inputs:
soliloquy_file:
pyproject_directory:
description: "File to use for install, prepare, and release steps"
required: true
default: "pyproject.toml"
bump_type:
description: "Bump type (patch or finalize) for the prepare phase"
required: false
default: "patch"
commit_msg:
description: "Commit message for the prepare phase"
required: false
default: "chore: auto increment packages"
default: "chore: auto increment package"

concurrency:
group: dev-branch-workflow-group
Expand Down Expand Up @@ -54,8 +53,8 @@ jobs:
- name: Run install phase
run: |
source $UNIQUE_VENV_PATH/bin/activate
cd pkgs
soliloquy install --file "${{ github.event.inputs.soliloquy_file }}"
cd "pkgs/${{ github.event.inputs.pyproject_directory }}"
soliloquy install --file "pyproject.toml"
- name: Pip freeze
run: |
Expand All @@ -68,9 +67,9 @@ jobs:
source $UNIQUE_VENV_PATH/bin/activate
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
cd pkgs
cd "pkgs/${{ github.event.inputs.pyproject_directory }}"
soliloquy prepare \
--file "${{ github.event.inputs.soliloquy_file }}" \
--file "pyproject.toml" \
--bump "${{ github.event.inputs.bump_type }}" \
--commit-msg "${{ github.event.inputs.commit_msg }}" \
--lint-fix
Expand All @@ -85,9 +84,9 @@ jobs:
- name: Run release phase
run: |
source $UNIQUE_VENV_PATH/bin/activate
cd pkgs
cd "pkgs/${{ github.event.inputs.pyproject_directory }}"
soliloquy release \
--file "${{ github.event.inputs.soliloquy_file }}" \
--file "pyproject.toml" \
--test-mode single \
--num-workers 4 \
--no-cleanup \
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/v0.6.0_prepare_install_validate.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: 0.6.0 - Mono (Prepare, Install, Validate)

on:
push:
branches: [ "mono/dev" ]
workflow_dispatch:

concurrency:
group: dev-branch-workflow-group
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/v0.6.0_prepare_install_validate_single.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ name: 0.6.0 - Single (Prepare, Install, Validate)
on:
workflow_dispatch:
inputs:
soliloquy_file:
pyproject_directory:
description: "File to use for install, prepare, and release steps"
required: true
default: "pyproject.toml"
bump_type:
description: "Bump type (patch or finalize) for the prepare phase"
required: false
default: "patch"
commit_msg:
description: "Commit message for the prepare phase"
required: false
default: "chore: auto increment packages"
default: "chore: auto increment package"
test_mode:
description: "Test-mode (each, single, monorepo) for the validate phase"
required: false
default: "single"

concurrency:
group: dev-branch-workflow-group
Expand Down Expand Up @@ -55,8 +58,8 @@ jobs:
- name: Run install phase
run: |
source $UNIQUE_VENV_PATH/bin/activate
cd pkgs
soliloquy install --file "${{ github.event.inputs.soliloquy_file }}"
cd "pkgs/${{ github.event.inputs.pyproject_directory }}"
soliloquy install --file "pyproject.toml"
- name: Pip freeze
run: |
Expand All @@ -69,9 +72,9 @@ jobs:
source $UNIQUE_VENV_PATH/bin/activate
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
cd pkgs
cd "pkgs/${{ github.event.inputs.pyproject_directory }}"
soliloquy prepare \
--file "${{ github.event.inputs.soliloquy_file }}" \
--file "pyproject.toml" \
--bump "${{ github.event.inputs.bump_type }}" \
--commit-msg "${{ github.event.inputs.commit_msg }}" \
--lint-fix
Expand All @@ -86,7 +89,7 @@ jobs:
- name: Run validate phase
run: |
source $UNIQUE_VENV_PATH/bin/activate
cd pkgs
soliloquy validate --file "${{ github.event.inputs.soliloquy_file }}" \
--test-mode each \
cd "pkgs/${{ github.event.inputs.pyproject_directory }}"
soliloquy validate --file "pyproject.toml" \
--test-mode "${{ github.event.inputs.test_mode }}" \
--num-workers 4
8 changes: 4 additions & 4 deletions .github/workflows/v0.6.0_validate_changed_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
PACKAGE_ROOT_PATH="${PACKAGE_ROOT#pkgs/}"
# If the changed file itself is a test...
if echo "$FILE" | grep -qE '/tests/.*_test\.py$'; then
if echo "$FILE" | grep -qE '/tests/.*(test_.*\.py|.*_test\.py)$'; then
# Keep test file path relative to the package root
# For example, if FILE="pkgs/community/swarmauri_toolkit_github/tests/unit/test_xyz.py",
# then RELATIVE_TEST_FILE="tests/unit/test_xyz.py"
Expand All @@ -91,7 +91,7 @@ jobs:
if [ -d "$TEST_DIR" ]; then
# Find any test file that includes the changed component name
MATCHING_TEST_FILES=$(find "$TEST_DIR" -type f -iname "*${COMPONENT_NAME}*_test.py")
MATCHING_TEST_FILES=$(find "$TEST_DIR" -type f \( -iname "*${COMPONENT_NAME}_test.py" -o -iname "test_${COMPONENT_NAME}.py" \))
for TEST_FILE in $MATCHING_TEST_FILES; do
RELATIVE_TEST_FILE=$(echo "$TEST_FILE" | sed "s|^$PACKAGE_ROOT/||")
PACKAGE_TEST_MAP["$PACKAGE_ROOT_PATH"]="${PACKAGE_TEST_MAP[$PACKAGE_ROOT_PATH]} $RELATIVE_TEST_FILE"
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
source $UNIQUE_VENV_PATH/bin/activate
python -m pip install --upgrade pip
pip install poetry
pip install soliloquy=="0.1.4"
pip install soliloquy=="0.1.5.dev1"
- name: Soliloquy Install
run: |
Expand Down Expand Up @@ -180,4 +180,4 @@ jobs:
# Move into the directory that has pyproject.toml
cd "pkgs/$PKG_PATH"
soliloquy validate -f pyproject.toml --test-mode each --num-workers 4
soliloquy validate -f pyproject.toml --test-mode single --num-workers 4 --required-passed ge:99
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ env
/combined
.venv_core*
*.obj
pytest_results.json
146 changes: 146 additions & 0 deletions STYLE_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# SDK Style Guide

This document outlines the coding and documentation standards for our SDK. Our goal is to ensure a consistent, clear, and maintainable codebase. We adhere to established Python standards (PEP 8 and PEP 257) and specifically utilize spaCy’s docstring style.

---

## Table of Contents

- [General Coding Standards](#general-coding-standards)
- [Docstring Conventions](#docstring-conventions)
- [Overview](#overview)
- [Structure](#structure)
- [Example](#example)
- [Contributing](#contributing)
- [References](#references)

---

## General Coding Standards

- **PEP 8 Compliance:**
Follow PEP 8 for overall code style, including naming conventions, line lengths, and whitespace usage.

- **Readable and Maintainable Code:**
Write clear, self-explanatory code. Refactor and comment where necessary to improve clarity.

- **Consistent Formatting:**
Use our style guide and formatting tools (e.g., linters, formatters) to maintain consistency across the codebase.

---

## Docstring Conventions

We follow spaCy’s docstring style to ensure our documentation is clear and consistent.

### Overview

- **Triple Double Quotes:**
Use `"""` for all docstrings.

- **Placement:**
Place the docstring immediately after the function, method, class, or module definition.

- **Imperative Mood:**
Write summaries in the imperative mood (e.g., "Return", "Process", "Compute").

### Structure

1. **One-Line Summary:**
- A concise description of what the function/class/module does.

2. **Blank Line:**
- Insert a blank line after the summary if the docstring contains additional detail.

3. **Extended Description:**
- Provide any extra information necessary to understand the code’s purpose or behavior.

4. **Parameter Section (Args):**
- List each parameter, its type, and a brief description.

5. **Returns Section:**
- Describe the return type and the meaning of the returned value.

6. **Raises Section (if applicable):**
- List any exceptions that might be raised by the function.

### Example

Below is an example demonstrating the spaCy docstring style at the method level:

```python
def process_text(text: str) -> Doc:
"""
Process a text string and return a spaCy Doc object.
This function tokenizes and annotates the input text using spaCy's NLP pipeline.
Args:
text (str): The input text to be processed.
Returns:
Doc: The processed spaCy Doc object.
Raises:
ValueError: If the input text is empty.
"""
if not text:
raise ValueError("Input text must not be empty.")
# Processing code goes here
```

Below is an example demonstrating the spaCy docstring style at the module level:

```python
"""
text_utils.py
This module provides utilities for processing text data. It leverages spaCy's NLP
pipeline to tokenize, annotate, and analyze text, offering helper classes and functions
to simplify common text processing tasks.
"""

import spacy
```

Below is an example demonstrating spaCy docstring style at the class level:

```python
class TextProcessor:
"""
A class for processing and analyzing text data using spaCy.
This class provides methods to tokenize, lemmatize, and extract named entities from text.
It utilizes spaCy's NLP pipeline to annotate the text and offers helper methods for
common text processing tasks.
Attributes:
nlp (spacy.language.Language): The spaCy NLP model used for processing text.
"""

def __init__(self, model: str = "en_core_web_sm"):
"""
Initialize the TextProcessor with the specified spaCy model.
Args:
model (str): The name of the spaCy model to load (default is "en_core_web_sm").
"""
self.nlp = spacy.load(model)

def process(self, text: str):
"""
Process the input text and return the annotated spaCy Doc object.
Args:
text (str): The input text to process.
Returns:
spacy.tokens.Doc: The processed document with tokens, entities, and annotations.
Raises:
ValueError: If the input text is empty.
"""
if not text:
raise ValueError("Input text must not be empty.")
return self.nlp(text)
```
File renamed without changes.
2 changes: 2 additions & 0 deletions docs/docs/foundation/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Foundation

29 changes: 29 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: "Home"
hide_posts: true
---
# Home

Welcome to the official documentation for our Python monorepo! This site is built with [MkDocs](https://www.mkdocs.org/) and styled with [Material for MkDocs Insiders](https://squidfunk.github.io/mkdocs-material-insiders/). Here you'll find everything you need to get started, understand our guides, and explore our API references.

## What You'll Find Here

- **About**: Learn more about the project and its goals.
- **Guide**: Step-by-step instructions on how to install, configure, and use the various tools and modules.
- **API**: Detailed documentation for our Python modules.

## Getting Started

If you're new to the project, we recommend starting with the [About](about.md) page for an overview of our objectives. Then, head over to the [Guide](guide/installation.md) to learn how to set up and use our software.

## Contributing

We welcome contributions to the documentation! If you'd like to help improve the docs, please review our [Contributing Guidelines](CONTRIBUTING.md) to get started.

## Feedback

Have questions or feedback? Feel free to open an issue or reach out on our community channels.

---

Enjoy your exploration, and happy documenting!
5 changes: 5 additions & 0 deletions docs/docs/news/.authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
authors:
cobycloud:
name: Jacob Stewart
description: Creator
avatar: https://github.com/cobycloud.png
2 changes: 2 additions & 0 deletions docs/docs/news/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Blog

11 changes: 11 additions & 0 deletions docs/docs/news/posts/hello-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
date: 2024-01-31
tags:
- Foo
- Bar
authors:
- cobycloud
---


# Hello World
9 changes: 9 additions & 0 deletions docs/docs/src/swarmauri_base/agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Documentation for `swarmauri_base.agents`

::: swarmauri_base.agents
options.extra:
show_submodules: false
show_inheritance: false
filters:
- '!.*' # exclude everything but the module docstring

6 changes: 6 additions & 0 deletions docs/docs/src/swarmauri_base/agents/AgentBase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Class `swarmauri_base.agents.AgentBase.AgentBase`

::: swarmauri_base.agents.AgentBase.AgentBase
options.extra:
show_inheritance: true

6 changes: 6 additions & 0 deletions docs/docs/src/swarmauri_base/agents/AgentConversationMixin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Class `swarmauri_base.agents.AgentConversationMixin.AgentConversationMixin`

::: swarmauri_base.agents.AgentConversationMixin.AgentConversationMixin
options.extra:
show_inheritance: true

6 changes: 6 additions & 0 deletions docs/docs/src/swarmauri_base/agents/AgentRetrieveMixin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Class `swarmauri_base.agents.AgentRetrieveMixin.AgentRetrieveMixin`

::: swarmauri_base.agents.AgentRetrieveMixin.AgentRetrieveMixin
options.extra:
show_inheritance: true

Loading

0 comments on commit 77c4646

Please sign in to comment.