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

Generate code #86

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

astrojuanlu
Copy link
Member

Work in progress. I plan to make small refactors and API changes to the library as I progress.

To begin with, the enumerations no longer use auto(), and I introduced an attrs hook to transform the fields with an enumeration type.

I now have to figure out what to do with the defaults, since the library annotations have been wrong since the beginning: name: int = attr.ib(default=None) is invalid, and it should have Optional[int] as type instead.

@codecov-io
Copy link

codecov-io commented Jan 2, 2021

Codecov Report

Merging #86 (a7f6276) into master (901dc71) will decrease coverage by 0.22%.
The diff coverage is 98.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #86      +/-   ##
==========================================
- Coverage   99.19%   98.97%   -0.23%     
==========================================
  Files          12       13       +1     
  Lines         749      778      +29     
==========================================
+ Hits          743      770      +27     
- Misses          6        8       +2     
Impacted Files Coverage Δ
src/czml3/base.py 93.93% <ø> (-0.66%) ⬇️
src/czml3/utils.py 100.00% <ø> (ø)
src/czml3/meta.py 90.47% <90.47%> (ø)
src/czml3/common.py 100.00% <100.00%> (ø)
src/czml3/enums.py 100.00% <100.00%> (ø)
src/czml3/examples/simple.py 100.00% <100.00%> (ø)
src/czml3/properties.py 100.00% <100.00%> (ø)

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 901dc71...a7f6276. Read the comment docs.

@astrojuanlu astrojuanlu force-pushed the generate-code branch 3 times, most recently from 0caa799 to 6416ee2 Compare January 2, 2021 16:58
@astrojuanlu astrojuanlu marked this pull request as ready for review January 2, 2021 17:12
Base automatically changed from master to main March 11, 2021 09:23
@astrojuanlu
Copy link
Member Author

From #89 (comment):

Just realized locally that PEP 563 -- Postponed Evaluation of Annotations breaks this approach. I'll have to rework it from scratch.
Closing.

@astrojuanlu astrojuanlu marked this pull request as draft March 21, 2021 10:10
@astrojuanlu astrojuanlu mentioned this pull request Mar 21, 2021
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.

None yet

2 participants