Skip to content

Conversation

@aepfli
Copy link
Member

@aepfli aepfli commented Nov 22, 2024

autogenerating protobuf files is crucial - hence that, i applied a hatch plugin to build them automatically

The downside is, that this plugin is fairly new https://github.com/nanoporetech/hatch-protobuf - but from my check it currently looks safe to be used.

What happened in this PR:

  • moved all submodules to an own directory (important for having nice paths with the protobuf generation)
  • changed the test targets to proper hatch configuration, instead of running hatch run test it is now hatch test or hatch test -c if you want coverage
  • to work with the repo we currently need to run hatch build first - i am investigating how to best solve this see Running hook before `hatch test` pypa/hatch#1824

@aepfli aepfli requested a review from a team as a code owner November 22, 2024 07:11
@codecov
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.21%. Comparing base (d8e10c7) to head (dd1a212).
Report is 51 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #109      +/-   ##
==========================================
+ Coverage   90.55%   95.21%   +4.66%     
==========================================
  Files           8       13       +5     
  Lines         180      481     +301     
==========================================
+ Hits          163      458     +295     
- Misses         17       23       +6     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aepfli aepfli force-pushed the feat/autogenerate_proto_files branch from a900822 to 3477153 Compare November 22, 2024 13:10
Copy link
Member

@gruebel gruebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work 🍻

I'm actually not so worried about the plugin being new or will become unmaintained over time. I checked the code and worst case we can just copy it over or maintain our own fork of it.

Did you test the wheel creation and made sure the generated files are included?

@aepfli
Copy link
Member Author

aepfli commented Nov 24, 2024

Did you test the wheel creation and made sure the generated files are included?

As I am lacking a little bit of insight/terminology. I write what I did and what I saw afterward ;) and what i interpret into it.

I ran hatch build, which created the dist folder. Within the dist folder, I have a .tar.gz file, which contains the schemas in the src (and sadly also the test-harness and spec folder). So, I would say this is packaged with the release. for the test-harness exclusion, I'll create my own issue/pullrequests.

//EDIT: added #112 for handling the dist files

@aepfli aepfli force-pushed the feat/autogenerate_proto_files branch 7 times, most recently from 3e506c2 to 9b65323 Compare November 24, 2024 20:55
@aepfli
Copy link
Member Author

aepfli commented Nov 24, 2024

This is still not ideal, but the proto files are now within a directory called flags within the src folder. As flagd is an openFeature-specific name, we should be save for the beginning.

If we move the submodules under an 'openfeature' directory and build the files from there, we would have a package a la 'openfeature.schemas.protobuf' - and some of the configuration would also be easier to use. As we always exclude one directory, instead of one per submodule moved

@aepfli aepfli force-pushed the feat/autogenerate_proto_files branch 3 times, most recently from 5767066 to 3bfe42f Compare November 25, 2024 11:01
Signed-off-by: Simon Schrottner <[email protected]>
@aepfli aepfli force-pushed the feat/autogenerate_proto_files branch from 3bfe42f to 4b74a53 Compare November 25, 2024 11:08
@aepfli aepfli closed this Nov 25, 2024
@aepfli aepfli reopened this Nov 26, 2024
@toddbaert toddbaert requested a review from gruebel November 26, 2024 13:46
@gruebel
Copy link
Member

gruebel commented Nov 26, 2024

ok, I updated my previous PR #115 with @aepfli new changes and now it works without needing the type:ignore comments. I created a dedicated hatch env for mypy (which I will also do for the other 2 packages) with its own config and dependencies.

Either you can pull my changes into your branch or we merge my

fyi, nice workaround with moving the schemas to an openfeature subfolder!

@gruebel
Copy link
Member

gruebel commented Nov 27, 2024

Implemented via #115

@gruebel gruebel closed this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants