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

New command twine preview? #875

Closed
tillahoffmann opened this issue Feb 19, 2022 · 6 comments
Closed

New command twine preview? #875

tillahoffmann opened this issue Feb 19, 2022 · 6 comments

Comments

@tillahoffmann
Copy link

tillahoffmann commented Feb 19, 2022

Twine already renders the long description as part of the twine check command. Is there interest to add a twine preview command that saves the output to disc for inspection prior to pushing to pypi? Happy to submit a PR if yes.

Possible interface options:

  • new command twine preview or twine render.
  • optional flag --output [path] for twine check specifying where to save the rendered output.
@bhrutledge
Copy link
Contributor

Thanks for sharing the idea. Can you give more details about the motivation and value of this feature? For example, what problem are you trying to solve? What output are you expecting? HTML?

Two quick notes:

@sigmavirus24
Copy link
Member

--output for twine check would indicate to me that the printed results of check should be written to that file, not what we attempted to render (if, in fact, we attempted to render the long description).

twine preview doesn't seem to have many benefits over uploading to test.pypi.org because - if I remember correctly - the check that we can render something could still fail on PyPI/TestPyPI proper.

Still, I find myself asking the same question as @bhrutledge - What's the motivation?

Also worth noting that this is an example of https://xyproblem.info/

@tillahoffmann
Copy link
Author

Good point re-motivation: the output on PyPI is sometimes not quite as expected (e.g. because some directives are not supported). twine check can of course pick up those directives. However, developers are rewriting the long description to strip out such directives (see here for further details), and it's sometimes difficult to know what the rendered output will look like even when it technically passes the check. It would be useful to view the rendered output to check it before pushing to PyPI, leading to additional commits and versions pushed (see pypi/warehouse#2170 for additional discussion). Being able to render the output to HTML and inspect it before pushing to GitHub/PyPI could shorten the feedback loop.

@bhrutledge
Copy link
Contributor

the output on PyPI is sometimes not quite as expected
It would be useful to view the rendered output to check it before pushing to PyPI

As @sigmavirus24 suggested, I would solve this problem by publishing to TestPyPI. That doesn't address the feedback loop and additional commits, but it is the source of truth for rendering. I think anything else would be an approximation, and therefore not a complete solution to the problem.

Also, it looks like Readme Renderer has a command line interface that does what you're suggesting.

@bhrutledge
Copy link
Contributor

Also, if you're concerned about version numbers, I would take advantage of pre- and post-releases.

@sigmavirus24
Copy link
Member

Closing as the consensus seems to be that we won't accept this

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

No branches or pull requests

3 participants