-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add PEP517 compatible build backend #3991
Open
joeyearsley
wants to merge
9
commits into
horovod:master
Choose a base branch
from
joeyearsley:PEP517
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+233
−93
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
860068b
Add PEP517 compatible build backend
40d6435
autopep8
898882a
Update changelog
dc91266
Update __init__.py
6a83773
Update build in tests
c498fe5
Update env vars
a7e3322
Use PEP517 everywhere
EnricoMi edfd990
Allow for full package definition
EnricoMi 7c6a96a
Do not use build isolation in test images
EnricoMi File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import os | ||
import sys | ||
import sysconfig | ||
from packaging import version | ||
from importlib import metadata | ||
from setuptools import build_meta as _orig | ||
|
||
prepare_metadata_for_build_wheel = _orig.__legacy__.prepare_metadata_for_build_wheel | ||
build_wheel = _orig.__legacy__.build_wheel | ||
build_sdist = _orig.__legacy__.build_sdist | ||
get_requires_for_build_sdist = _orig.__legacy__.get_requires_for_build_sdist | ||
|
||
|
||
def get_requires_for_build_wheel(self, config_settings=None): | ||
""" | ||
Custom backend to enable PEP517, utilises env variables to define which extra build | ||
packages we should be installing into the isolated build env. | ||
These should match the users expected versions installed outside the isolated environment or it will | ||
cause library mismatch failures. | ||
""" | ||
new_pkgs = [] | ||
MXNET = "mxnet" | ||
key_pkg_map = {'HOROVOD_WITH_MXNET': MXNET, | ||
'HOROVOD_WITH_PYTORCH': 'torch', | ||
'HOROVOD_WITH_TENSORFLOW': 'tensorflow'} | ||
for key in key_pkg_map.keys(): | ||
try: | ||
version_string = os.environ[key] | ||
try: | ||
version.Version(version_string) | ||
new_pkgs.append(f"{key_pkg_map[key]}=={version_string}") | ||
except version.InvalidVersion: | ||
new_pkgs.append(f"{version_string}") | ||
if key_pkg_map[key] == MXNET: | ||
# MxNet has np.bool everywhere which is removed in newer | ||
# versions... | ||
new_pkgs.append("numpy==1.20.3") | ||
except BaseException: | ||
# Pass for now, elsewhere will alert the user has built this wrong. | ||
... | ||
|
||
return _orig.__legacy__.get_requires_for_build_wheel( | ||
config_settings) + new_pkgs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from horovod.runner import run | ||
|
||
__version__ = '0.28.1' | ||
__version__ = '0.29.0' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't bump the version, this is done during next release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a breaking change, as Horovod can still be installed via the old HOROVOD_WITH_*=1 vars using
--no-build-isolation
, right?Can we somehow imply the
--no-build-isolation
when those HOROVOD_WITH_* vars are1
? Otherwise this may be considered a breaking change...