You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: support bazel (rules_python) as a PEP-517 backend #1103
Probably very low priority, but having support for pyproject.toml would be awesome. Maybe for the first pass rules_python can support parsing [project] and other fields as metadata
Relevant Rules
py_wheel
Description
A clear and concise description of the problem or missing capability...
Describe the solution you'd like
An example pyproject.toml:
[build-system]
requires= ["setuptools>=65", "setuptools_scm[toml]>=7", "wheel"]
build-backend="setuptools.build_meta"
[project]
name="my_project"description="description"readme= { file="README.md", content-type="text/markdown" } # P1?requires-python=">=3.8"version="0.0.1"classifiers= [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
I can contribute the implementation upstream if this makes sense. I believe we already have tomli available so it should be relatively straightforward for implementation.
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!
The PEP describe the current generation of Python packaging system. A lot of these components help streamline Python project, and a lot of Python packages has adopted this (i.e numpy, scipy, pandas, and so on).
This makes it for a repo that setup pyproject.toml to set up adoption with bazel. We are evaluating bazel as build tool to make it consistent across our multiple projects.
I think I understand what you’re asking for. Are you asking for support of specifying the third-party dependencies of the project? Then the issue description isn’t clear.
The only table in PEP-621 that would be relevant for consumption via the rules would be the dependencies table. Possibly requires_python.
The current mechanism for consuming third-party dependencies in the rules would be pip_parse or compile_pip_requirements. py_wheel is for building wheels.
Right, sorry for not making it clear. I think in terms of implementation rules_python will need to be able to parse requires_python and build_system in order to compile the wheel. Python specific build system such as hatch, flit, pdm has PEP517-compatible format designed for packaging.
I believe the currently limitation for rules_python is that it depends on setuptools iirc. So in order to support pyproject, rules_python might need to add build to support parsing this pyproject.toml
additionally, all of the metadata can be used with distribution and wheel metadata generation.
I don't think this is specifically for parsing third-party dependencies.
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!
Activity
github-actions commentedon Aug 26, 2023
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!
aarnphm commentedon Aug 27, 2023
Any update on this?
cc @rickeylev
groodt commentedon Aug 27, 2023
Can you describe why this would be useful?
When a wheel is built and distributed (via PyPI or alternative artifact repositories) the pyproject.toml file is not leveraged by package installers.
aarnphm commentedon Aug 27, 2023
https://peps.python.org/pep-0621/
The PEP describe the current generation of Python packaging system. A lot of these components help streamline Python project, and a lot of Python packages has adopted this (i.e numpy, scipy, pandas, and so on).
This makes it for a repo that setup pyproject.toml to set up adoption with bazel. We are evaluating bazel as build tool to make it consistent across our multiple projects.
groodt commentedon Aug 27, 2023
I think I understand what you’re asking for. Are you asking for support of specifying the third-party dependencies of the project? Then the issue description isn’t clear.
The only table in PEP-621 that would be relevant for consumption via the rules would be the
dependenciestable. Possiblyrequires_python.The current mechanism for consuming third-party dependencies in the rules would be
pip_parseorcompile_pip_requirements.py_wheelis for building wheels.aarnphm commentedon Aug 27, 2023
Right, sorry for not making it clear. I think in terms of implementation rules_python will need to be able to parse
requires_pythonandbuild_systemin order to compile the wheel. Python specific build system such as hatch, flit, pdm has PEP517-compatible format designed for packaging.I believe the currently limitation for rules_python is that it depends on setuptools iirc. So in order to support pyproject, rules_python might need to add
buildto support parsing this pyproject.tomladditionally, all of the metadata can be used with distribution and wheel metadata generation.
I don't think this is specifically for parsing third-party dependencies.
groodt commentedon Aug 27, 2023
Got it. So you want bazel to be usable as a PEP-517 compatible build backend?
[-]feat(wheel): support pyproject.toml[/-][+]feat: support bazel (rules_python) as a PEP-517 backend[/+]github-actions commentedon May 18, 2024
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!
github-actions commentedon Jun 17, 2024
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"
aignas commentedon Dec 7, 2024
I think @nicholasjng has created something of interest to address this ticket https://github.com/nicholasjng/bazelbuild