open-feature / python-sdk-contrib

Community contributions for hooks and reference providers in python
https://openfeature.dev
10 stars 11 forks source link

chore: reorganize repo for multiple packages #35

Closed federicobond closed 7 months ago

federicobond commented 8 months ago

This is a ~work-in-progress~ proposal for organizing the repo around multiple packages

federicobond commented 8 months ago

Tooling is still a bit of a hack, happy to take suggestions. I mostly wanted to get the basic structure right.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6e082a7) 85.12% compared to head (e3ea4b2) 90.86%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #35 +/- ## ========================================== + Coverage 85.12% 90.86% +5.73% ========================================== Files 6 8 +2 Lines 121 186 +65 ========================================== + Hits 103 169 +66 + Misses 18 17 -1 ``` | [Flag](https://app.codecov.io/gh/open-feature/python-sdk-contrib/pull/35/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-feature) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/open-feature/python-sdk-contrib/pull/35/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-feature) | `90.86% <100.00%> (+5.73%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-feature#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

federicobond commented 8 months ago

Ok, so I did some research on the tooling for packaging and dependency management and after looking at different options, including Flit, Poetry and PDM, I have integrated a tool called Hatch that is being developed under the umbrella of the PyPA.

Hatch solves the problem of running tests in isolated environments for each package, which we weren't able to do with the existing Makefile setup. It's easy to understand, fast, and adheres much better to modern Python packaging standards (Poetry is known for doing its own thing, sometimes with questionable choices for package authors).

The only downside of Hatch is that there is no explicit monorepo support yet, but I don't believe it to be a deal breaker at the moment.

I think we can give it a try and see if works for our use case. Worst case scenario is we have to tweak up pyproject.toml files to use a different tool.

beeme1mr commented 8 months ago

I'll look into this more tomorrow but it looks like great progress.

beeme1mr commented 8 months ago

@federicobond could you please sign off on the commits when you have a moment?

federicobond commented 8 months ago

Sure! I was missing the last one apparently, sorry about that.