Skip to content

👌 IMPROVE: Add RendererProtocol typing #126

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

Merged
merged 14 commits into from
Apr 30, 2021

Conversation

hukkin
Copy link
Contributor

@hukkin hukkin commented Feb 22, 2021

Closes #121

@codecov
Copy link

codecov bot commented Feb 22, 2021

Codecov Report

Merging #126 (f9615ec) into master (99ebfac) will decrease coverage by 0.02%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
- Coverage   96.10%   96.08%   -0.03%     
==========================================
  Files          60       60              
  Lines        3234     3242       +8     
==========================================
+ Hits         3108     3115       +7     
- Misses        126      127       +1     
Flag Coverage Δ
pytests 96.08% <90.90%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
markdown_it/renderer.py 99.13% <90.00%> (-0.87%) ⬇️
markdown_it/main.py 89.23% <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 99ebfac...f9615ec. Read the comment docs.

Comment on lines 21 to 24
if sys.version_info < (3, 8):
from typing_extensions import Protocol
else:
from typing import Protocol
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if sys.version_info < (3, 8):
from typing_extensions import Protocol
else:
from typing import Protocol
try:
from typing import Protocol
except ImportError:
from typing_extensions import Protocol

I've literally just has an issue where sys.version_info was not reliable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed. Please let me know what the issue was. I'm very interested.

Copy link
Member

Choose a reason for hiding this comment

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

It actually turned out to be an issue with importing of importlib_metadata instead of importlib-metadata in a Conda environment 😒 (see python/importlib_metadata#308 and executablebooks/MyST-NB#321), which actually illustrates my "worry" in #154 (comment)

But anyhow, I think this approach is still slightly "safer"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, so conda not doing the name normalization if I understand correctly? Good to know, thanks! I don't use Conda so no need to change any of my personal projects 👍

Copy link
Member

Choose a reason for hiding this comment

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

yeh seems to be the case 😬

Copy link
Member

@chrisjsewell chrisjsewell Apr 30, 2021

Choose a reason for hiding this comment

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

despite that it is generally very good; particularly in resolving/enforcing dependency versions and/or if you are using non-python dependencies

@chrisjsewell chrisjsewell changed the title 👌 IMPROVE: Add renderer protocol 👌 IMPROVE: Add RendererProtocol typing Apr 30, 2021
@chrisjsewell chrisjsewell merged commit 15ba9b6 into executablebooks:master Apr 30, 2021
@chrisjsewell
Copy link
Member

ok thats it; v1 is getting released (after doing another beta test). You can propose other changes, but I will probably ignore you 😜

@hukkin
Copy link
Contributor Author

hukkin commented Apr 30, 2021

The only thing I think would still be great is the AttrDict / entities PR and changing entities import path for consistency with upstream (and removal of stutter).

These are breaking changes so will not be fun doing after v1.

Although breaking, these aren't that major changes so feel free to ignore 😄

@chrisjsewell
Copy link
Member

These are breaking changes so will not be fun doing after v1.

Well I've already been enforcing deprecation path ways for breaking changes since 0.6 (like plugin removal), so I'd still have looked to do that even if it was not v1.

and yeh its just such a minimally used thing to let it hold up the release

@hukkin hukkin deleted the renderer-protocol branch May 1, 2021 00:53
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.

Add an abstract renderer class
3 participants