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

feat(manager): add inline script metadata (PEP 723) support #31266

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mkniewallner
Copy link
Contributor

Changes

Add support for Python inline script metadata, also known as PEP 723.

Context

Closes #27889.

Both the regex and the transformation from commented out TOML to actual TOML have been adapted from the Python reference version. Per the recommendation in the linked discussion, since virtually any Python file can contain such metadata, to avoid slowing down Renovate, fileMatch defaults to an empty array.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

Just a note that I initially wanted to add a section similar to pip-compile to mention that we have an empty fileMatch by default, but I then realised there already is code in place to generate a default section for this case, as can be seen here.

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Changes tested in https://github.com/mkniewallner/renovate-pep723, where:

@mkniewallner mkniewallner marked this pull request as ready for review September 7, 2024 21:52
lib/modules/manager/pep723/extract.ts Show resolved Hide resolved
lib/modules/manager/pep723/extract.ts Outdated Show resolved Hide resolved
lib/modules/manager/pep723/schema.ts Show resolved Hide resolved
lib/modules/manager/pep723/schema.ts Show resolved Hide resolved
lib/modules/manager/pep723/extract.ts Outdated Show resolved Hide resolved
lib/modules/manager/pep723/extract.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/pep723/extract.ts Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

3 participants