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: support pyproject.toml in compile_pip_requirements #1519

Merged
merged 7 commits into from
Nov 3, 2023

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Oct 27, 2023

With this PR we can also use pyproject.toml in addition
to requirements.in which helps in making the requirements
in a more structured form. For example, we could parse the
toml itself and create aliases in the hub repos only for the
packages outlined in the pyproject.toml file. The same for
gazelle, we could restrict gazelle_python.yaml contents
to only the dependencies listed in pyproject.toml.

Examples can be migrated once we agree on the interface.

Summary:

  • feat: support pyproject.toml in compile_pip_requirements
  • chore: use pyproject.toml for sphinx doc requirements

@aignas aignas marked this pull request as draft October 27, 2023 07:38
@aignas aignas force-pushed the feat/pyproject-toml-support branch from 8454c1c to dff8198 Compare November 1, 2023 00:17
@aignas aignas marked this pull request as ready for review November 1, 2023 03:42
@aignas aignas requested a review from f0rmiga as a code owner November 1, 2023 03:42
Copy link
Collaborator

@groodt groodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I think in the description, could be worth clarifying that it's support PEP-621 project.dependencies https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#declaring-project-metadata only. It shouldn't imply support of any other TOML tables that may exist, or tool specific tables such as tool.black or tool.poetry etc

@rickeylev
Copy link
Collaborator

LGTM. I pushed a small update to the src arg doc.

The only comment, more question, I have is: should src default to requirements.in or pyproject.toml? If I understand correctly, toml files are the newer, better way?

@aignas aignas force-pushed the feat/pyproject-toml-support branch from e31955a to b746642 Compare November 2, 2023 04:35
@aignas
Copy link
Collaborator Author

aignas commented Nov 2, 2023

I have changed the code to default to pyproject.toml as I agree that people who are new to rules_python should use by default new standards, but that may cause issues for older users who were relying on default behaviour.

If you are OK with the changes, explanation, feel free to merge it during your working hours.

@rickeylev rickeylev added this pull request to the merge queue Nov 3, 2023
Merged via the queue into bazelbuild:main with commit cb56a0f Nov 3, 2023
3 checks passed
@aignas aignas deleted the feat/pyproject-toml-support branch May 13, 2024 06:48
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