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

Allow old packages to default to setup.py-based build #5076

Merged
merged 5 commits into from
Apr 10, 2024

Conversation

joecummings
Copy link
Contributor

@joecummings joecummings commented Apr 10, 2024

It was brought up here that various workflows may still be reliant on the old way of installing python packages (invoking setup.py directly).

While these workflows should enable their packages to work with build eventually, they should have ample time to do so. Therefore, this change established a default for the build command on Linux workflows. Therefore, newer packages can start to specify python -m build --wheel, without disrupting the other workflows reliant on Nova.

Copy link

vercel bot commented Apr 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
torchci ⬜️ Ignored (Inspect) Visit Preview Apr 10, 2024 2:49pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 10, 2024
@joecummings joecummings marked this pull request as ready for review April 10, 2024 02:56
joecummings added a commit to pytorch/torchtune that referenced this pull request Apr 10, 2024
Currently using pytorch/test-infra#5076 ref, will need to set to main once it merges
@@ -168,20 +173,33 @@ jobs:
repository: ${{ inputs.repository }}
script: ${{ inputs.pre-script }}
- name: Install python build dependency
Copy link
Contributor

@atalman atalman Apr 10, 2024

Choose a reason for hiding this comment

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

nit: should we refactor it like this ?

- name: Build the wheel (python-build-package)
	if: ${{ inputs.build-platform == 'python-build-package' }}
	run: |
	set -euxo pipefail
          # shellcheck disable=SC1090
          source "${BUILD_ENV_FILE}"
          # shellcheck disable=SC2086
          ${CONDA_RUN} python -m pip install build
	 export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')"
	${CONDA_RUN} python -m build --wheel

- name: Build the wheel (setup-py)
        if: ${{ inputs.build-platform == 'setup-py' }} 
        working-directory: ${{ inputs.repository }}
        shell: bash -l {0}
        run: |
          set -euxo pipefail
          source "${BUILD_ENV_FILE}"
          ${CONDA_RUN} python setup.py clean
	export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')"
	${CONDA_RUN} python setup.py bdist_wheel

and remove old Build the wheel (bdist_wheel)

@joecummings joecummings merged commit 751efc1 into main Apr 10, 2024
34 checks passed
@joecummings joecummings deleted the default-build-command branch April 10, 2024 15:05
atalman pushed a commit that referenced this pull request Oct 1, 2024
This PR enable the build of M1 wheels to rely on `python -m build`
instead of `python setup.py`. The default is still `python setup.py`.
This is the same as #5071 and
#5076 that were landed for
linux wheels.

We need this for torchcodec to support M1 wheels
pytorch/torchcodec#230

CC @scotts @atalman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants