-
Notifications
You must be signed in to change notification settings - Fork 62
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
Simplify longtest, which makes it support markdown #428
Conversation
Twine already depends on readme_renderer: https://github.com/pypa/twine/blob/main/setup.cfg#L39 So... we don't need to restrict it to our list of recommended packages. The advantage is that we can use readme_renderer[md] later on :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, this should be okay.
But I tried it and it failed:
(Pdb) print(html)
Traceback (most recent call last):
File "/Users/maurits/.pyenv/versions/3.11.4/lib/python3.11/importlib/metadata/__init__.py", line 563, in from_name
return next(cls.discover(name=name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/maurits/community/zest.releaser/lib/python3.11/site-packages/readme_renderer/__main__.py", line 62, in <module>
main()
File "/Users/maurits/community/zest.releaser/lib/python3.11/site-packages/readme_renderer/__main__.py", line 26, in main
message = metadata(args.input)
^^^^^^^^^^^^^^^^^^^^
File "/Users/maurits/.pyenv/versions/3.11.4/lib/python3.11/importlib/metadata/__init__.py", line 998, in metadata
return Distribution.from_name(distribution_name).metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/maurits/.pyenv/versions/3.11.4/lib/python3.11/importlib/metadata/__init__.py", line 565, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for Products.PlonePAS
So we would somehow need to build the package before calling this. Otherwise it will either fail, or it will show an outdated long description. Maybe run build
?
Co-authored-by: Maurits van Rees <maurits@vanrees.org>
I tried it out in the And the good thing is, if I edit the readme and run So why does this not work in my clone of Trying it with So: must be something specific in |
It fails when I try it with I have recent
Ah, version 40 has this in the changelog: "Add CLI option to render package README." So we should require this as minimum version. |
Yeah, the If I make a virtualenv, do a dev-install of plone.pas and add zest.releaser, then bin/longtest picks up the package just fine. |
(Otherwise the package rendering isn't available)
It seems to be this PR that changed their use of
In So a workaround/solution could be to do |
I am creating an issue there, will let it link here. |
So it is more importlib that cannot find the package metadata where pkg_resources can. |
Actually, I see that
If you first change directory, before calling pkg_resources, it works though:
|
Works fine in my local Products.PlonePAS dir now. |
This works now for me. It does seem that this still only works for projects that have a But this is no worse than what we had before. And it now works with Markdown, which is what we were mostly after. I will merge. Thanks! |
I have released 9.0.0a2 with the latest changes. |
yeah |
Fixes #363