Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate generated files automatically if any are changed #3050

Merged
merged 6 commits into from
Aug 21, 2024

Conversation

CoolCat467
Copy link
Member

Making true on #2835 (comment), in this pull request I add a local pre-commit hook that automatically regenerates all the generated files if either the generated file itself or the files used to create them are edited. The only one it doesn't match at the moment is gen_exports.py itself, and I could add this if needed.

Copy link

codecov bot commented Aug 3, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.63%. Comparing base (6fad505) to head (ce58a36).
Report is 10 commits behind head on main.

Files Patch % Lines
src/trio/_tools/gen_exports.py 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3050      +/-   ##
==========================================
- Coverage   99.63%   99.63%   -0.01%     
==========================================
  Files         121      121              
  Lines       17839    17848       +9     
  Branches     3206     3208       +2     
==========================================
+ Hits        17774    17782       +8     
  Misses         46       46              
- Partials       19       20       +1     
Files Coverage Δ
src/trio/_tests/tools/test_gen_exports.py 100.00% <100.00%> (ø)
src/trio/_tools/gen_exports.py 98.31% <75.00%> (-0.82%) ⬇️

@CoolCat467 CoolCat467 changed the title Regenerate files automatically if any are changed Regenerate generated files automatically if any are changed Aug 3, 2024
@A5rocks
Copy link
Contributor

A5rocks commented Aug 3, 2024

Tbh you can probably add uv pre-commit to keep those up to date too, just not have it with updating flags

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@CoolCat467
Copy link
Member Author

Tbh you can probably add uv pre-commit to keep those up to date too, just not have it with updating flags

I'm afraid I don't quite understand what you mean by this. As far as I am aware, regenerating the generated code files doesn't have anything to do with uv, right?

@A5rocks
Copy link
Contributor

A5rocks commented Aug 3, 2024

Tbh you can probably add uv pre-commit to keep those up to date too, just not have it with updating flags

I'm afraid I don't quite understand what you mean by this. As far as I am aware, regenerating the generated code files doesn't have anything to do with uv, right?

Sorry, was referring to the generated requirements files. I guess that could be another PR.

@CoolCat467 CoolCat467 merged commit 50e09c0 into python-trio:main Aug 21, 2024
34 of 35 checks passed
@CoolCat467 CoolCat467 deleted the auto-regenerate branch August 21, 2024 18:43
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.

2 participants