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

Validate README format #769

Open
remram44 opened this issue Jan 2, 2019 · 7 comments
Open

Validate README format #769

remram44 opened this issue Jan 2, 2019 · 7 comments
Labels
kind/feature Feature requests/implementations
Milestone

Comments

@remram44
Copy link
Contributor

remram44 commented Jan 2, 2019

It seems that poetry doesn't validate the README markup. Furthermore, because no setup.py file is present in a poetry project, I cannot use readme_renderer (which is usually invoke via python setup.py check -r -s).

It would be nice to have a way to invoke such setup check routines, or better yet, have poetry validate the README itself.

Related: #761

A temporary workaround is to use python -m readme_renderer README.rst >/dev/null to check.

@remram44
Copy link
Contributor Author

remram44 commented Jan 2, 2019

It seems that readme_renderer updated their instructions to use twine check to check the README files inside the dist/*, however it is awkward to have to install twine if you already have poetry publish...

@webknjaz
Copy link

webknjaz commented Jan 6, 2019

Yep, setup.py check is deprecated and is not recommended.
I think twine is there because it's a publishing tool and most folks would want to do such check before publishing.

@dazza-codes
Copy link
Contributor

dazza-codes commented Feb 26, 2019

poetry check could implement the twine check dist/* to ensure that a package will publish when it's correct and issue suitable errors to help fix it when it's not. (This and similar publishing issues might be related - searching issues for twine check finds a few other issues related to publishing failures).

WRT the README, in a setup.py file it is often added to the long_description with an associated content type, but poetry is not adding the content type, e.g.

Checking distribution dist/jupiter_style-0.1.1-py3-none-any.whl: Passed
Checking distribution dist/jupiter_style-0.1.1.tar.gz: warning: `long_description_content_type` missing.  defaulting to `text/x-rst`.
warning: `long_description` missing.

@stale
Copy link

stale bot commented Nov 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 13, 2019
@remram44
Copy link
Contributor Author

I'm still interested in this!

@sdispater sdispater added kind/feature Feature requests/implementations and removed stale labels Nov 13, 2019
@sdispater sdispater added this to the Future milestone Nov 13, 2019
@brettcannon
Copy link

twine check also flags wheels if you have a Markdown README:

Checking dist/release_often-0.1.0-py3-none-any.whl: FAILED
  `long_description` has syntax errors in markup and would not be rendered on PyPI.
  warning: `long_description_content_type` missing.  defaulting to `text/x-rst`.
Checking dist/release_often-0.1.0.tar.gz: PASSED, with warnings
  warning: `long_description_content_type` missing.  defaulting to `text/x-rst`.
  warning: `long_description` missing.

brettcannon added a commit to brettcannon/release-often that referenced this issue Mar 29, 2020
Turns out Poetry doesn't set the content type for the long description.

python-poetry/poetry#769
brettcannon added a commit to brettcannon/release-often that referenced this issue Mar 29, 2020
Turns out Poetry doesn't set the content type for the long description.

python-poetry/poetry#769
@dineshr93
Copy link

dineshr93 commented Aug 18, 2022

I am getting this error while poetry publish after README.rst file is added


 UploadError

  HTTP Error 400: The description failed to render for 'text/x-rst'. See https://pypi.org/help/#description-content-type for more information.

  at ~\.poetry\lib\poetry\publishing\uploader.py:216 in _upload
      212│                     self._register(session, url)
      213│                 except HTTPError as e:
      214│                     raise UploadError(e)
      215│
    → 216│             raise UploadError(e)
      217│
      218│     def _do_upload(
      219│         self, session, url, dry_run=False
      220│     ):  # type: (requests.Session, str, Optional[bool]) -> None

Update:

My error got resolved when I replaced README**.rst** file to README**.md**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

No branches or pull requests

6 participants