-
Notifications
You must be signed in to change notification settings - Fork 89
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
Using --package fails when the code is in a src directory #289
Comments
@mauritsvanrees Looks like you're trying to use You'd either need to install the package into the environment, or omit the flag and pass the |
No, the package is not installed. This is a fresh checkout. For packages without a src-layout, it works. For example:
Huh? I am sure that worked earlier today. Now I am confused. Looks like I need to do more testing. Sorry. Passing the |
In It also looks like you're already performing a description validation by running I guess it comes down to "what kind of description are you trying to render, and why?" |
TLDR: I am working around it now, so if you don't see value in changing this (I could make a PR), then feel free to close this issue. Maybe I am using this tool in a way that is unintended. I am trying to render the PyPI long description of a package I am currently developing, to see if it renders nicely on PyPI. This seems to be why PR #271 was made, adding a So now I call
When I first do What I do now, is work around this small limitation in an own tool. I am using and developing Until now, what
Since the Python world is moving slowly away from We have fixed it for our use case in zestsoftware/zest.releaser#428 by doing the |
@mauritsvanrees Thanks for your in-depth explanation - that's very helpful! In regards to usage - the CLI is a little tricky, and was removed from documentation and more recently the The way In your example, are you performing an editable install of the package under development? $ pip install readme_renderer
...
$ pwd
/workspace/icalendar
$ pip install -e .
...
$ python -m readme_renderer --package icalendar | head -n 10
/workspace/icalendar/venc/lib/python3.11/site-packages/readme_renderer/markdown.py:44: UserWarning: Markdown renderers are not available. Install 'readme_renderer[md]' to enable Markdown rendering.
warnings.warn(_EXTRA_WARNING)
<p>The <a href="https://pypi.org/project/icalendar/" rel="nofollow">icalendar</a> package is a <a href="https://www.ietf.org/rfc/rfc5545.txt" rel="nofollow">RFC 5545</a> compatible parser/generator for iCalendar
files.</p>
<hr class="docutils">
<dl class="field-list simple">
<dt>Homepage<span class="colon">:</span></dt>
<dd><p><a href="https://icalendar.readthedocs.io" rel="nofollow">https://icalendar.readthedocs.io</a></p>
</dd>
<dt>Code<span class="colon">:</span></dt>
<dd><p><a href="/collective/icalendar" rel="nofollow">https://github.com/collective/icalendar</a></p>
</dd> When running the tool, it needs to be able to discover the package via name, so it if's outside the environment, it won't be able to discover it. If it's installed in editable mode, that means it would be added to the |
For example checkout
icalendar
and try to generate its readme:Then do
cd src
and the same command, and it works. There it finds (or creates) the egg-info directory.See also this report in
zest.releaser
where I found this problem.Maybe it makes sense to do
os.chdir("src")
if this directory exists? Or try that ifmetadata(args.input)
fails at first?The text was updated successfully, but these errors were encountered: