pypa / readme_renderer

Safely render long_description/README files in Warehouse
Apache License 2.0
157 stars 88 forks source link

Add command to check a file #127

Closed merwok closed 5 years ago

merwok commented 5 years ago

I would like an entry-point to check a reST or markdown file.

(I’ve heard about twine check but it doesn’t work for me due to flit-tox mismatch.)

di commented 5 years ago

@merwok Can you go into more detail about what you mean by "flit-tox mismatch"?

di commented 5 years ago

More details:

merwok commented 5 years ago

I am using the recent PEP 517 integration in tox, so tox reads my build-deps in pyproject.toml and uses flit to install my project. This works well, even for a Python2.7 test env! (I do need to change my lint/test commands to run against the installed project rather than the files in the repo root, but that’s not a new issue.)

Now twine check wants a path/to/dists argument.

Idea 1: check .tox/dist, but that only contains the sdist, and I run into https://github.com/takluyver/flit/issues/216

Idea 2: run pip wheel (as done by other projects), but I don’t have a setup.py anymore

Idea 3: run flit build, but I don’t want the files created in repo-root/dist (https://github.com/takluyver/flit/issues/217)

Idea 4: run a new command render-readme README.md and remove the flit/twine layers!

One important con of my request is that twine check validates that the description file is correctly read into wheel/sdist artifacts. render-readme would be similar to a unit test whereas twine check is akin to an integration test and gives us 100% confidence that the PyPI page will be correct.

di commented 5 years ago

I think we'll want to find a way you can use twine check here. My plan for this command is to eventually bring in additional metadata validation, so you'll probably want to use that instead of directly invoking readme-renderer.

I think that just fixing https://github.com/takluyver/flit/issues/216 and assuming that the sdist metadata matches any built distribution metadata should suffice, what do you think?

merwok commented 5 years ago

Ideally I would not use the top-level dist directory to create and check the dists (idea 3, takluyver/flit#217), but in the meantime I’ll take twine check dist/*.

Feel free to close, at least I got the opportunity to detangle the various issues and this provides a record of the discussion with links.

di commented 5 years ago

Great. Closing as I don't think there's anything readme_renderer needs to do here.