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

Add GH workflow to check that the python package README does not contain relative paths #730

Open
reyammer opened this issue Sep 26, 2024 · 3 comments · May be fixed by #739
Open

Add GH workflow to check that the python package README does not contain relative paths #730

reyammer opened this issue Sep 26, 2024 · 3 comments · May be fixed by #739
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@reyammer
Copy link
Collaborator

reyammer commented Sep 26, 2024

./python/README.md is what is rendered at https://pypi.org/project/magika/. Thus, we need to make sure that links to files within this repo are absolute link (with the full https://github.com/...) rather than relative links. Also check that such links are valid links.

@reyammer reyammer added documentation Improvements or additions to documentation good first issue Good for newcomers labels Sep 26, 2024
@brokoli777
Copy link

Hello! I am just starting out in open-source and would like to contribute to this in coming days as part of Hacktoberfest. This is what I am planning on doing:

  • The workflow should run when ./python/README.md is modified.
  • Use Regex to find links within markdown file.
  • Use Regex to check if absolute link.
  • Use requests module to check if the link is valid.
  • If any links are invalid, it will print out the errors and workflow fails.

I am planning to put the script the workflow runs under ./python/scripts.

@reyammer
Copy link
Collaborator Author

All makes sense, thank you!

The only unclear bit for me is whether we should have a new workflow for this, or, my current preference, whether we should add such check as part of the existing build_python_package.py script, so that, no matter what, we would never build a package with a broken readme?

Other comments:

  • "check that the link is valid": checking for status_code == 200 should be enough?
  • it's important that the script collects all invalid links, prints them all, and only then fails (rather than failing at the first invalid hit), so that we just need one run of the workflow to find all problems.

@brokoli777
Copy link

I think adding it to an existing script instead of making a new workflow just for it makes sense. I agree with the other comments you mentioned and will try to implement it like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants