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

build: Improves python packaging infrastructure #414

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

Conversation

pranavm-nvidia
Copy link
Contributor

Updates the Python package to use build to package instead of the legacy bdist_wheel style. pyproject.toml is the single source of truth for the package.

Additionally, this change also move stub generation to setup.py so that it happens automatically when the wheels are generated. This way the stub files don't need to be maintained in the repo and manually updated.


if "--plat-name" in sys.argv:
Copy link
Contributor Author

@pranavm-nvidia pranavm-nvidia Nov 22, 2024

Choose a reason for hiding this comment

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

Doesn't seem like this was ever used. Not sure if it's needed in the new build flow


os.chdir(FLAGS.whl_dir)
print("=== Building wheel")
args = ["python3", "setup.py", "bdist_wheel"]
args = ["python3", "-m", "build"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how to make sure the build package is installed in the containers.

Copy link
Contributor

Choose a reason for hiding this comment

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

TODO: I need to double check this

Copy link
Contributor

Choose a reason for hiding this comment

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

Started pipeline: 21638660

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep will need to install this in build container too

/usr/bin/python3: No module named build
error: Building wheel failed failed

I believe that would go here for RHEL and Ubuntu builds:

Copy link
Contributor

@rmccorm4 rmccorm4 Dec 19, 2024

Choose a reason for hiding this comment

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

I will try this out - pipeline 21672308

@rmccorm4
Copy link
Contributor

Need to run CI

@rmccorm4 rmccorm4 changed the title Improves packaging infrastructure build: Improves python packaging infrastructure Dec 13, 2024
Updates the Python package to use `build` to package instead of the legacy
`bdist_wheel` style. `pyproject.toml` is the single source of truth for the
package.

Additionally, this change also move stub generation to `setup.py` so that
it happens automatically when the wheels are generated. This way the stub files
don't need to be maintained in the repo and manually updated.
Co-authored-by: Ryan McCormick <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants