pydantic / logfire

Uncomplicated Observability for Python and beyond! 🪵🔥
https://docs.pydantic.dev/logfire/
MIT License
1.62k stars 46 forks source link

Add `logfire-api` #268

Open Kludex opened 1 week ago

Kludex commented 1 week ago

This PR creates the logfire-api package.

We'll have to remove rye - or it needs to work with editable mode, otherwise developers need to remember to remove the .venv and run rye sync --no-lock every time they perform changes.

The approach here is simple - the logfire-api/logfire_api/__init__.py contains all the runtime logic, and the type hints are generated from the make generate-stubs command - we have a lot of pyi files.

There are two tests:

  1. One that makes sure both logfire and logfire_api have the same objects in the __init__.py.
  2. Another that makes sure we have the __init__.pyi type compliant.
cloudflare-pages[bot] commented 1 week ago

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: ee6faaa
Status: âœ…  Deploy successful!
Preview URL: https://35eb6344.logfire-docs.pages.dev
Branch Preview URL: https://logfire-api.logfire-docs.pages.dev

View logs

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 88.19444% with 17 lines in your changes missing coverage. Please review. Files Patch % Lines
tests/test_logfire_api.py 88.11% 13 Missing and 4 partials :warning:

:loudspeaker: Thoughts on this report? Let us know!

Kludex commented 5 days ago

@alexmojaki do you know why those tests are failing? 🤔 There are different tests failing depending on the Python version...

alexmojaki commented 5 days ago

I don't know why. How new/consistent are they?