poetry self add poetry-dotenv-plugin
poetry self add poetry-bumpversion
poetry install --all-extras
poetry run pre-commit install
- Add .env based on .env.template
-
Run all
poetry run pytest -s -v --log-cli-level=INFO
-
Run a specific test
poetry run pytest -s -v --log-cli-level=INFO tests/test_core_sdk.py::test_flush
-
E2E tests involving OpenAI and Serp API are usually skipped, remove skip decorators in tests/test_langchain.py to run them.
- Generate Fern Python SDK in langfuse and copy the files generated in
generated/python
into thelangfuse/api
folder in this repo. - Execute the linter by running
poetry run ruff format .
- Rebuild and deploy the package to PyPi.
Make sure you have your PyPi API token setup in your poetry config. If not, you can set it up by running:
poetry config pypi-token.pypi $your-api-token
Run the release script:
poetry run release
poetry version patch
poetry version prepatch
for pre-release versions
poetry install
poetry build
git commit -am "chore: release v{version}"
git push
git tag v{version}
git push --tags
poetry publish
- Create PyPi API token: https://pypi.org/manage/account/token/
- Setup:
poetry config pypi-token.pypi your-api-token
- Create a release on GitHub with the changelog
Note: The generated SDK reference is currently work in progress.
The SDK reference is generated via pdoc. You need to have all extra dependencies installed to generate the reference.
poetry install --all-extras
To update the reference, run the following command:
poetry run pdoc -o docs/ --docformat google --logo "https://langfuse.com/langfuse_logo.svg" langfuse
To run the reference locally, you can use the following command:
poetry run pdoc --docformat google --logo "https://langfuse.com/langfuse_logo.svg" langfuse
Thanks to the PostHog team for the awesome work on posthog-python. This project is based on it as it was the best starting point to build an async Python SDK.