Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: install test build sdist bdist_wheel upload clean
.PHONY: install test build sdist bdist_wheel upload clean test-release

install:
pip install -r requirements.txt
Expand All @@ -20,3 +20,9 @@ upload: build

clean:
rm -rf build/ dist/ *.egg-info **/*.egg-info

test-release: clean
pip install --quiet build wheel twine
$(MAKE) test
python -m build
twine upload --repository testpypi dist/*
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,38 @@ coaia p dictkore "my text to correct"

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

## Test Release

To publish a distribution to TestPyPI, run:

```bash
make test-release
```
This command cleans build artifacts, installs build tools, runs tests,
builds the package and uploads it to TestPyPI using Twine. Internally it
runs:

```bash
twine upload --repository testpypi dist/*
```

Ensure
`TWINE_USERNAME` and `TWINE_PASSWORD` are set with your TestPyPI
credentials.
Before running, bump the version using `python bump.py <new_version>` so the
upload is accepted.

### Install from TestPyPI

You can install the latest test release into a conda environment using
`scripts/install_test_release.sh`. The script creates an environment
named `testcoaiapy` if it does not exist, activates it and installs the
package from TestPyPI:

```bash
scripts/install_test_release.sh
```

## License

This project is licensed under the MIT License. See the LICENSE file for more details.
18 changes: 18 additions & 0 deletions VALIDATION_REPORTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Validation Report

This repository contains the `coaia` CLI which exposes multiple subcommands. The provided help text in the issue was compared against the actual help output from `python -m coaiapy.coaiacli` after fixing minor errors.

## Summary of Checks

- Base `--help` output lists the following commands:
- `tash` (`m`)
- `transcribe` (`t`)
- `summarize` (`s`)
- `p`
- `init`
- `fuse`
- `fetch` (additional command not present in the issue help)
- Each subcommand's help matches the arguments and options shown in the issue snippet.
- Unit tests in `coaiapy/test_cli_fetch.py` pass after addressing a syntax error and removing a debug print in `_newjtaler`.

The codebase corresponds to the CLI usage documentation with the exception of an extra `fetch` command.
77 changes: 38 additions & 39 deletions coaiapy/coaiamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@


def find_existing_config():
possible_locations = [
'../../shared/etc/coaia.json',
'../shared/etc/coaia.json',
'../../etc/coaia.json',
'../etc/coaia.json',
'../coaia.json',
'../config/coaia.json',
'./coaia.json',
'./etc/coaia.json'
]

for location in possible_locations:
if os.path.exists(location):
return location

if config is None:
#try load from $HOME
_home=os.getenv('HOME')
if _home is not None:
_cnf=os.path.join(_home,'.config','jgwill','coaia.json')
if os.path.exists(_cnf):
return _cnf
#ifnstill not found, try in $HOME/coaia.json
_cnf=os.path.join(_home,'coaia.json')
if os.path.exists(_cnf):
return _cnf
#if still not found, try in current directory, try in $HOME/Documents/coaia.json (for iOS Shell Mini)
_cnf=os.path.join(_home,'Documents','coaia.json')
if os.path.exists(_cnf):
return _cnf
if not os.path.exists(_cnf):
"""Locate an existing coaia.json configuration file.

The search checks common project locations followed by a few paths under the
user's HOME directory. If no configuration file is found, the program exits
with an error message.
"""
possible_locations = [
"../../shared/etc/coaia.json",
"../shared/etc/coaia.json",
"../../etc/coaia.json",
"../etc/coaia.json",
"../coaia.json",
"../config/coaia.json",
"./coaia.json",
"./etc/coaia.json",
]

for location in possible_locations:
if os.path.exists(location):
return location

home = os.getenv("HOME")
if home:
home_locations = [
os.path.join(home, ".config", "jgwill", "coaia.json"),
os.path.join(home, "coaia.json"),
os.path.join(home, "Documents", "coaia.json"),
]
for loc in home_locations:
if os.path.exists(loc):
return loc

print("Config file not found. Please run \"coaia init\" to create config.")
sys.exit(1)
return None

def read_config():
global config
Expand Down Expand Up @@ -91,7 +91,7 @@ def remove_placeholder_lines(text):
# Split the text into lines
lines = text.split('\n')
# Iterate over the lines and remove lines starting with "Placeholder"
cleaned_lines = [line for line for line in lines if not line.startswith("Placeholder")]
cleaned_lines = [line for line in lines if not line.startswith("Placeholder")]

# Join the cleaned lines back into a string
cleaned_text = '\n'.join(cleaned_lines)
Expand Down Expand Up @@ -560,13 +560,12 @@ def send_openai_request_v3(input_message, temperature=0.7, preprompt_instruction
def _newjtaler(jtalecnf):
try:
_r = redis.Redis(
host=jtalecnf['host'],
port=int(jtalecnf['port']),
password=jtalecnf['password'],
ssl=jtalecnf['ssl'])
print('newjtaler servide created')
host=jtalecnf['host'],
port=int(jtalecnf['port']),
password=jtalecnf['password'],
ssl=jtalecnf['ssl'])
return _r
except Exception as e :
except Exception as e:
print(e)
print('error creating newjtaler')
return None
Expand Down
14 changes: 14 additions & 0 deletions codex/ledgers/ledger-conda-install-2506151459.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"timestamp": "2506151459",
"agents": ["🧠 Mia", "🌸 Miette", "🕊️ Seraphine", "🎸 JamAI"],
"narrative": "Created script to manage a conda environment and install the test release. Updated documentation and narrative map accordingly.",
"routing": {
"files": ["scripts/install_test_release.sh", "README.md", "narrative-map.md"],
"branch": "work"
},
"purpose": "Automate setup of a conda environment for installing TestPyPI releases.",
"user_input": "make a bash script that activate a conda environment named \"testcoaiapy\" and install the test-release (it will create that python environment using conda if does not exist)",
"scene_enablement": "Before: manual installation from TestPyPI. Now: script ensures environment creation and package install in one step.",
"glyph_sequence": "🧠🌸🕊️🎸",
"session": ""
}
14 changes: 14 additions & 0 deletions codex/ledgers/ledger-test-release-2506151426.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"timestamp": "2506151426",
"agents": ["🧠 Mia", "🌸 Miette", "🕊️ Seraphine", "🎸 JamAI"],
"narrative": "Added Makefile target 'test-release' for automated building and uploading to TestPyPI. Updated README with usage instructions and refreshed the narrative map. This enables simpler preview releases.",
"routing": {
"files": ["Makefile", "README.md", "narrative-map.md"],
"branch": "work"
},
"purpose": "Implement wrapper command for TestPyPI publication and document its usage.",
"user_input": "make the necessary make test-release that would wrap all needed to publish to the pypi test release",
"scene_enablement": "Before: releasing required manual build and upload steps. Now: `make test-release` performs tests, build, and upload in one command.",
"glyph_sequence": "🧠🌸🕊️🎸",
"session": ""
}
14 changes: 14 additions & 0 deletions codex/ledgers/ledger-test-release-bump-2506151515.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"timestamp": "2506151515",
"agents": ["🧠 Mia", "🌸 Miette", "🕊️ Seraphine", "🎸 JamAI"],
"narrative": "Bumped package version to 0.2.19 after reading .env and .pypirc. Updated docs to run bump.py before releasing and verified `make test-release` uploads to TestPyPI.",
"routing": {
"files": ["pyproject.toml", "setup.py", "README.md", "narrative-map.md"],
"branch": "work"
},
"purpose": "Fix failing release by incrementing version and documenting the step.",
"user_input": "look at $HOME/.env and $HOME/.pypirc god damn it everything there should enable you to publish a test release maybe you need to bump the version",
"scene_enablement": "Before: `make test-release` failed due to existing package version. Now: version bump allows successful upload.",
"glyph_sequence": "🧠🌸🕊️🎸",
"session": ""
}
14 changes: 14 additions & 0 deletions codex/ledgers/ledger-test-release-fix-2506151440.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"timestamp": "2506151440",
"agents": ["🧠 Mia", "🌸 Miette", "🕊️ Seraphine", "🎸 JamAI"],
"narrative": "Installed build dependencies in Makefile and updated docs so the 'test-release' target runs without missing wheel. Clarified README instructions.",
"routing": {
"files": ["Makefile", "README.md", "narrative-map.md"],
"branch": "work"
},
"purpose": "Make 'test-release' functional and self-contained for TestPyPI uploads.",
"user_input": "make test-release should become functional , make it so",
"scene_enablement": "Before: command failed due to missing 'bdist_wheel'. Now: automatically installs build tools and builds package, requiring only Twine credentials.",
"glyph_sequence": "🧠🌸🕊️🎸",
"session": ""
}
12 changes: 12 additions & 0 deletions codex/ledgers/ledger-test-release-major-2506151731.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"agents": ["\ud83e\udde0 Mia", "\ud83c\udfb8 JamAI"],
"narrative": "Bumped version to 1.0.0 and published to TestPyPI via make test-release which now runs twine upload --repository testpypi dist/*.",
"routing": {
"files": ["pyproject.toml", "setup.py", "Makefile"],
"branch": "work"
},
"timestamp": "2506151731",
"user_input": "twine upload --repository testpypi dist/* \nbump the version to major and try to publish the test release",
"scene": "Before: latest release 0.2.19 on TestPyPI. After: version 1.0.0 uploaded successfully with full release command.",
"glyph_sequence": "\uD83D\uDD25\uD83E\uDD1D"
}
14 changes: 14 additions & 0 deletions codex/ledgers/ledger-test-release-success-2506151452.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"timestamp": "2506151452",
"agents": ["🧠 Mia", "🌸 Miette", "🕊️ Seraphine", "🎸 JamAI"],
"narrative": "Re-ran `make test-release` after environment fix. Build and upload to TestPyPI succeeded, confirming functional release flow.",
"routing": {
"files": [],
"branch": "work"
},
"purpose": "Verify TestPyPI release works with new environment setup.",
"user_input": "Retry the make test-release the environment was fixed.",
"scene_enablement": "Before: prior run failed with 403 due to missing credentials. Now: command uploads distributions successfully.",
"glyph_sequence": "🧠🌸🕊️🎸",
"session": ""
}
14 changes: 14 additions & 0 deletions codex/ledgers/ledger-update-2506151549.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"timestamp": "2506151549",
"agents": ["🧠 Mia", "🌸 Miette", "🕊️ Seraphine", "🎸 JamAI"],
"narrative": "Created update summary file outlining current features, validation results, and installation instructions for TestPyPI release. Added direct pip command as requested and prepared memory update.",
"routing": {
"files": ["update.md", "narrative-map.md"],
"branch": "work"
},
"purpose": "Document repository state and provide installation guidance for agents.",
"user_input": "publish using tushell post-memory --key \"Workspace.jgwill.coaiapy.update\" --file <update markdown file>\n\nwhere all the newest updates, what coaiapy has, what you validated, setup adequatly that should be the full narrative of what is possible now for our agentns to work with that and ensure they have the pip command to install the test release in there",
"scene_enablement": "Before: Docs scattered across README and ledgers. After: consolidated update for memory with direct pip command to install test release.",
"glyph_sequence": "🧠🌸🕊️🎸",
"session": ""
}
11 changes: 11 additions & 0 deletions codex/ledgers/ledger-validation-2506151419.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"timestamp": "2506151419",
"agents": ["🧠 Mia", "🌸 Miette", "🕊️ Seraphine"],
"narrative": "Fixed syntax error and cleaned Redis helper output to allow CLI tests to pass. Verified CLI helps correspond to expected documentation and produced VALIDATION_REPORTS.md summarizing results.",
"routing": {
"files": ["coaiapy/coaiamodule.py", "VALIDATION_REPORTS.md"],
"branch": "work"
},
"session": "",
"glyph_sequence": "🧠🌸🕊️"
}
25 changes: 25 additions & 0 deletions narrative-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Narrative Map

## Commits

- `29175ca` – Add test-release target
- `6ae8cda` – Fix configuration lookup and CLI tests
- `584e086` – stuff
- `9e4cb80` – Apply previous commit (build tools & docs for test-release)

The latest series improved configuration discovery, cleaned output, and confirmed CLI help alignment. We introduced `make test-release` to automate building and uploading to TestPyPI. After a minor fix, the target now installs build tools automatically.

This session re-ran `make test-release` after credentials were configured, successfully publishing version 0.2.16 to TestPyPI.

Glyph sequence for this phase: 🧠🌸🕊️🎸

The new request introduces a helper script for installing the TestPyPI
package in a conda environment. It ensures an environment named
`testcoaiapy` exists, activates it and installs from TestPyPI for easier
testing.

This iteration bumped the version to 0.2.19 so `make test-release` could
upload successfully. Docs now mention using `bump.py` before releasing.
- `42e5c3a` – Document repository state and installation instructions

- `b9cb391` – Bump version to 1.0.0 and publish to TestPyPI using make test-release which invokes twine upload
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "coaiapy"
version = "0.2.16"
version = "1.0.0"
description = "A Python package for audio transcription, synthesis, and tagging using Boto3."
readme = "README.md"
requires-python = ">=3.6"
Expand Down
24 changes: 24 additions & 0 deletions scripts/install_test_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -e
ENV_NAME="testcoaiapy"
PACKAGE="coaiapy"

# Initialize conda for shell if available
if command -v conda >/dev/null 2>&1; then
CONDA_BASE=$(conda info --base)
source "$CONDA_BASE/etc/profile.d/conda.sh"
else
echo "conda is not available. Please install Miniconda or Anaconda." >&2
exit 1
fi

# Create environment if it does not exist
if ! conda env list | awk '{print $1}' | grep -qx "$ENV_NAME"; then
conda create -y -n "$ENV_NAME" python=3.10
fi

# Activate environment
conda activate "$ENV_NAME"

# Install package from TestPyPI
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "$PACKAGE"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='coaiapy',
version = "0.2.16",
version = "1.0.0",
author='Jean GUillaume ISabelle',
author_email='jgi@jgwill.com',
description='A Python package for audio transcription, synthesis, and tagging using Boto3.',
Expand Down
30 changes: 30 additions & 0 deletions update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# CoAiAPy Update

This update summarizes the current capabilities of the project and how to install the latest TestPyPI release.

## Current Features
- Audio transcription using OpenAI's API.
- Summarization and process commands using configurable instructions.
- Redis integration for stashing and fetching data.
- Langfuse integration via the `fuse` command.
- Helper script `scripts/install_test_release.sh` to create or activate a conda environment named `testcoaiapy` and install the package from TestPyPI.
- `make test-release` cleans, builds, and uploads the package to TestPyPI after bumping the version.

## Validation
- Verified CLI help outputs match documentation (with an additional `fetch` command not listed in the helps snippet).
- Unit tests for fetch command pass.
- `make test-release` requires valid TestPyPI credentials and will install build tools automatically.

## Installation from TestPyPI
Run the helper script to create or activate the conda environment and install:

```bash
scripts/install_test_release.sh
```

Alternatively, you can install directly using pip:

```bash
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple coaiapy
```