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

twine check fails when badges have a scale factor ... #304

Open
kif opened this issue May 7, 2024 · 3 comments
Open

twine check fails when badges have a scale factor ... #304

kif opened this issue May 7, 2024 · 3 comments

Comments

@kif
Copy link

kif commented May 7, 2024

As reported in:
pypa/twine#1102
twine check fails when parsing the readme file contains badges. If one of the badge has a scale factor, the readme_renderer fails claiming it is not allowed to access to the internet.

@miketheman
Copy link
Member

Please provide a concrete reference to a readme that contains the problematic behavior - it's unclear from the linked issue which conditions lead to the problem.

kif added a commit to silx-kit/pyFAI that referenced this issue Jul 8, 2024
@bocklund
Copy link

From https://github.com/PhasesResearchLab/ESPEI

python -m readme_renderer -f rst README.rst (.txt extension added for the upload to GitHub to work)

Gives output:

<string>:37: (WARNING/2) Cannot scale image!
  Could not get size from "docs/_static/cu-mg-mcmc-phase-diagram.png":
  Reading external files disabled.

README.rst

@miketheman
Copy link
Member

Thanks for the error message, that points out a warning from docutils.

We have disabled the ability to read external files, which prevents docutils from trying to load images to scale these. See:

# Prevent local files from being included into the rendered output.
# This is a security concern because people can insert files
# that are part of the system, such as /etc/passwd.
"file_insertion_enabled": False,

I haven't looked too hard yet for what alternatives might be avilable, or if there's a way to only allow images, but now there's a reason.

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