Skip to content

Commit

Permalink
Initial commit public commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaPurtell committed Nov 18, 2024
0 parents commit ccd62eb
Show file tree
Hide file tree
Showing 33 changed files with 4,035 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: GitHub Actions CICD Testing Pipeline
run-name: ${{ github.actor }} pushed to ${{ github.ref }}
on: [push]
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Pythonc
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Local Version of synth_sdk
run: |
pip install -e .
- name: Find Tests
id: find_tests
run: |
# Find all files in the 'testing' directory and join them into a space-separated string
# NOTE: Only run pytests on files that end with '_test.py'
TEST_SCRIPTS=$(find testing -type f -name '*_test.py' -print | tr '\n' ' ')
echo "Found test scripts: $TEST_SCRIPTS"
echo "TEST_SCRIPTS=$TEST_SCRIPTS" >> $GITHUB_ENV
env:
SYNTH_API_KEY: ${{ secrets.SYNTH_API_KEY }}
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DUMMY_SECRET: ${{ secrets.DUMMY_SECRET }}
- name: Run Tests
run: |
# Execute test scripts listed in the TEST_SCRIPTS variable
echo "Running tests: $TEST_SCRIPTS"
for script in $TEST_SCRIPTS; do
echo "Running test $script"
pytest --log-level=WARNING $script
done
env:
SYNTH_API_KEY: ${{ secrets.SYNTH_API_KEY }}
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DUMMY_SECRET: ${{ secrets.DUMMY_SECRET }}




165 changes: 165 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# uv.lock is annoying
uv.lock
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# sdk
Python sdk for Synth

python -m build
twine check dist/*
twine upload dist/*
Empty file added __init__.py
Empty file.
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Build the distribution files
python -m build

# Upload to TestPyPI (optional but recommended)
python -m twine upload --repository testpypi dist/*

# Upload to PyPI
python -m twine upload dist/*
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[project]
name = "synth-sdk"
version = "0.2.74"
description = ""
authors = [{name = "Synth AI", email = "[email protected]"}]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"opentelemetry-api",
"opentelemetry-sdk",
"pydantic",
"requests",
"asyncio",
"zyk>=0.2.18",
"build>=1.2.2.post1",
"pypi",
"twine>=4.0.0",
"keyring>=24.0.0",
"python-dotenv>=1.0.1",
"langfuse>=2.53.9",
"pytest>=8.3.3",
]
classifiers = []

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv.sources]

[tool.hatch.build.targets.wheel]
packages = ["synth_sdk"]
30 changes: 30 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#apropos-ai==0.4.5
fastapi>=0.115.0
opentelemetry-api>=1.27.0
opentelemetry-instrumentation>=0.48b0
opentelemetry-sdk>=1.27.0
pydantic>=2.9.2
asyncpg>=0.24.0

supabase>=2.8.1
uvicorn>=0.15.0
redis>=4.0.0
python-dotenv>=0.19.0
python-jose[cryptography]>=3.3.0
passlib>=1.7.4
python-multipart>=0.0.5
pytest==8.3.3
pytest-asyncio==0.24.0
pytest-env==1.1.5


prefect>=3.0.4
psycopg2-binary==2.9.6
pydantic-settings>=2.5.2
argon2-cffi>=23.1.0
modal>=0.64.159
loguru>=0.7.2
alembic>=1.13.3
zyk>=0.2.10
#synth_sdk>=0.2.61
#smallbench>=0.2.11
21 changes: 21 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from setuptools import find_packages, setup

setup(
name="synth-sdk",
version="0.2.74",
packages=find_packages(),
install_requires=[
"opentelemetry-api",
"opentelemetry-sdk",
"pydantic",
"requests",
"asyncio",
],
author="Synth AI",
author_email="[email protected]",
description="",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
python_requires=">=3.9",
classifiers=[],
)
Empty file.
14 changes: 14 additions & 0 deletions synth_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Synth SDK initialization file"""

# Import version from package metadata
from importlib import metadata

try:
__version__ = metadata.version("synth-sdk")
except metadata.PackageNotFoundError:
__version__ = "unknown"
# You can also add other package-level imports and initialization here

from synth_sdk.tracing.decorators import trace_system_sync, trace_system_async, synth_tracker_sync, synth_tracker_async
from synth_sdk.tracing.trackers import SynthTrackerSync, SynthTrackerAsync
from synth_sdk.provider_support.openai_lf import AsyncOpenAI, AsyncAzureOpenAI, OpenAI, AzureOpenAI
Empty file added synth_sdk/config/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions synth_sdk/config/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Load environment variables from .env file"""

from dotenv import load_dotenv

load_dotenv()
Loading

0 comments on commit ccd62eb

Please sign in to comment.