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
43 changes: 43 additions & 0 deletions .github/workflows/codeflash.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Codeflash

on:
pull_request:
paths:
# So that this workflow only runs when code within the target module is modified
- 'src/**'
workflow_dispatch:

concurrency:
# Any new push to the PR will cancel the previous run, so that only the latest code is optimized
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
optimize:
name: Optimize new Python code
# Don't run codeflash on codeflash-ai[bot] commits, prevent duplicate optimizations
if: ${{ github.actor != 'codeflash-ai[bot]' }}
runs-on: ubuntu-latest
env:
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
CODEFLASH_PR_NUMBER: ${{ github.event.number }}

steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: 📦 Install Dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --all-extras
- name: ⚡️Codeflash Optimization
run: |
poetry env use python
poetry run codeflash
36 changes: 26 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ openai-agents = { version = "<0.0.13", optional = true }

galileo-core = "~=3.32.0"

[project.optional-dependencies]
langchain = ["langchain-core"]
openai = ["openai", "packaging (>=24.2,<25.0)", "openai-agents"]
all = ["langchain-core", "openai"]


[tool.poetry.group.test.dependencies]
pytest = "^8.3.5"
coverage = "^7.2.3"
Expand Down Expand Up @@ -55,11 +49,7 @@ mkdocstrings-python = "^1.10.8"
griffe-fieldz = "^0.2.0"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

# Test.
[tool.pytest.ini_options]
pythonpath = ["./src/"]
env = [
Expand Down Expand Up @@ -89,6 +79,7 @@ addopts = [
asyncio_default_fixture_loop_scope = "function"

# Linters and formatters.

[tool.ruff]
line-length = 120
fix = true
Expand All @@ -110,6 +101,7 @@ split-on-trailing-comma = false
[tool.ruff.lint.pydocstyle]
convention = "numpy"


[tool.docformatter]
style = "numpy"
recursive = true
Expand All @@ -126,6 +118,7 @@ follow_imports = "skip"
plugins = ["pydantic.mypy"]

# Release.

[tool.semantic_release]
version_variables = ["src/galileo/__init__.py:__version__"]
version_toml = ["pyproject.toml:project.version"]
Expand All @@ -138,8 +131,31 @@ commit_message = "chore(release): v{version}\n\nAutomatically generated by pytho
patch_tags = ["fix", "perf", "chore", "docs", "style", "refactor"]



[tool.coverage.run]
omit = [
# ignore autogenerated code
"./src/galileo/resources/*",
]

[tool.codeflash]
# All paths are relative to this pyproject.toml's directory.
module-root = "src"
tests-root = "tests"
test-framework = "pytest"
benchmarks-root = ""
ignore-paths = []
disable-telemetry = false
formatter-cmds = ["ruff check --exit-zero --fix $file", "ruff format $file"]

[project.optional-dependencies]
langchain = ["langchain-core"]
openai = ["openai", "packaging (>=24.2,<25.0)", "openai-agents"]
all = ["langchain-core", "openai"]


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

# Test.
Loading