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

Refactor to create attrs extension instead of having the code inside our astbuilder #577

Merged
merged 9 commits into from
Jul 14, 2022

Conversation

tristanlatr
Copy link
Contributor

@tristanlatr tristanlatr commented May 13, 2022

This PR refactors the code that handles attrs declarations into an extension module.

@tristanlatr tristanlatr marked this pull request as draft May 13, 2022 03:46
@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #577 (704465f) into master (ebcc397) will increase coverage by 0.10%.
The diff coverage is 97.91%.

@@            Coverage Diff             @@
##           master     #577      +/-   ##
==========================================
+ Coverage   91.16%   91.26%   +0.10%     
==========================================
  Files          46       47       +1     
  Lines        7840     7868      +28     
  Branches     1701     1709       +8     
==========================================
+ Hits         7147     7181      +34     
+ Misses        433      427       -6     
  Partials      260      260              
Impacted Files Coverage Δ
pydoctor/model.py 93.80% <ø> (-0.02%) ⬇️
pydoctor/extensions/attrs.py 97.80% <97.80%> (ø)
pydoctor/astbuilder.py 94.76% <100.00%> (-0.16%) ⬇️
pydoctor/astutils.py 87.65% <0.00%> (+7.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ebcc397...704465f. Read the comment docs.

@tristanlatr tristanlatr marked this pull request as ready for review May 19, 2022 22:50
@tristanlatr tristanlatr requested a review from adiroiban May 20, 2022 06:51
@tristanlatr
Copy link
Contributor Author

This PR is also ready for review, it includes only some refactors to isolate the code that handles the attrs classes.

@tristanlatr
Copy link
Contributor Author

@adiroiban

@tristanlatr tristanlatr changed the title Create attrs extension Refactor to create attrs extension instead of having the code inside our astbuilder May 25, 2022
@tristanlatr tristanlatr requested a review from glyph June 11, 2022 17:52
Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

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

Sorry. I will not have time to review this.

I think that is best to merge this PR.

It is great to see more code using the extension mechansim.
It can be used as an example or documentation of what the extension can do.

At the same time, it helps validates that the extension public API is useful.

Thanks!

Copy link
Member

@glyph glyph left a comment

Choose a reason for hiding this comment

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

This seems like a good refactoring. Like Adi I'm not sure I can give this a thorough review; it seems like a lot of similar code is moving around, so it's hard to see if there was much in the way of changes. But overall: using extension interfaces for extensions is a good thing :)

pydoctor/astbuilder.py Outdated Show resolved Hide resolved
@tristanlatr tristanlatr linked an issue Jul 13, 2022 that may be closed by this pull request
@tristanlatr tristanlatr merged commit 6ca1650 into master Jul 14, 2022
@tristanlatr tristanlatr deleted the create-attrs-extension branch July 14, 2022 13:00
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.

Create an extension for dataclass based classes
3 participants