Skip to content
Merged
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
10 changes: 6 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
pre-commit:
name: ✨ Code Quality (Pre-commit)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -20,11 +21,12 @@ jobs:
- uses: pre-commit/action@v3.0.1

build-python:
name: 🐍 Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -85,7 +87,7 @@ jobs:
if-no-files-found: error

typescript-quality:
name: TypeScript Code Quality
name: 💎 TypeScript Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -124,7 +126,7 @@ jobs:
pnpm type-check

typescript-test:
name: TypeScript Tests
name: 🧪 TypeScript Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -158,7 +160,7 @@ jobs:
pnpm test

typescript-build:
name: TypeScript Build
name: 📦 TypeScript Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for setuptools_scm to determine version from Git tags

- name: Debug Git tags
run: |
echo "Current tag: ${GITHUB_REF#refs/tags/}"
git tag -l

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.13"

Expand Down
50 changes: 50 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,56 @@ terse_prompt = get_prompt(detail_level="terse")

Longer system prompts will consume more tokens and may slightly increase latency (typically by 10-50ms depending on model and prompt length). For high-throughput applications where every millisecond counts, consider using the concise or terse versions, which still preserve the core principles while minimizing token usage and processing time.

## Development

### Requirements

- Python 3.10 or higher
- pip

### Testing Across Multiple Python Versions

This package supports Python 3.10, 3.11, 3.12, and 3.13. To test across versions locally:

**Using tox (traditional approach):**
```bash
cd python
pip install tox
tox # Test all Python versions
tox -e py313 # Test specific version
tox -e lint # Run linting
```

**Using uv (modern, faster approach):**
```bash
pip install uv
cd python

# Test on specific Python version
uv run --python 3.10 pytest
uv run --python 3.11 pytest
uv run --python 3.13 pytest

# Install dev dependencies
uv pip install -e ".[dev]"
```

### Running Tests

```bash
cd python
pip install -e ".[test]"
pytest
```

### Building the Package

```bash
cd python
pip install -e ".[dev]"
python -m build
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an issue on the [GitHub repository](https://github.com/technickai/heart-centered-prompts).
Expand Down
22 changes: 17 additions & 5 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ readme = "README.md"
authors = [
{name = "TechnickAI"}
]
license = { text = "MIT" }
license = "MIT"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.8"
requires-python = ">=3.10"
keywords = [
"AI",
"prompts",
Expand All @@ -39,14 +37,28 @@ root = ".."
local_scheme = "no-local-version"
fallback_version = "0.0.0"

# Ensure setuptools_scm is invoked for dynamic versioning
[tool.setuptools]
packages = {find = {}}
zip-safe = false

[tool.setuptools.package-data]
heart_centered_prompts = ["prompts/*/*.txt"]

[project.urls]
Homepage = "https://github.com/technickai/heart-centered-prompts"
"Bug Tracker" = "https://github.com/technickai/heart-centered-prompts/issues"

[project.optional-dependencies]
test = [
"pytest>=8.0.0",
]
dev = [
"pytest>=8.0.0",
"ruff>=0.8.0",
"build>=1.0.0",
"setuptools-scm>=6.2",
]

[tool.black]
line-length = 120
target-version = ["py313"]
Expand Down
23 changes: 23 additions & 0 deletions python/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[tox]
envlist = py3{10,11,12,13}
isolated_build = True
skip_missing_interpreters = True

[testenv]
description = Run tests with pytest
extras = test
commands =
pytest {posargs}

[testenv:lint]
description = Run linting with ruff
extras = dev
commands =
ruff check .

[testenv:build]
description = Build package and verify
extras = dev
commands =
python -m build
python -c "from setuptools_scm import get_version; print(f'Version: {get_version(root=\"..\")}')"
Comment thread
cursor[bot] marked this conversation as resolved.