-
Notifications
You must be signed in to change notification settings - Fork 22.3k
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
torch: Stop using _nt_quote_args from distutils #48618
Conversation
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.
@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
aae7935
to
b469eca
Compare
@@ -400,7 +418,7 @@ def unix_cuda_flags(cflags): | |||
# overriding the option if the user explicitly passed it. | |||
_ccbin = os.getenv("CC") | |||
if ( | |||
_ccbin is not None | |||
_ccbin is not None |
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.
I guess there was an extra whitespace here. 🤷
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.
Do we have a Flake8 lint for trailing whitespace?
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.
I don't believe we do, but we probably should
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.
@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
💊 CI failures summary and remediationsAs of commit b944c06 (more details on the Dr. CI page):
1 job timed out:
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 22 times. |
@seemethere |
torch/utils/cpp_extension.py
Outdated
for i, arg in enumerate(args): | ||
if ' ' in arg: | ||
args[i] = '"%s"' % arg | ||
return args |
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.
Since it's our own function that is expected to work only in python-3.6.2 or newer, why not use list comprehensions and f-strings?
for i, arg in enumerate(args): | |
if ' ' in arg: | |
args[i] = '"%s"' % arg | |
return args | |
return [f'"{arg}"' if ' ' in arg else arg for arg in args] |
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 a direct lift and shift of the original function, wanted to keep it as close to the original as possible to avoid any backwards compat issues
True, I was trying to get the path of least resistance to make this work and lifting and shifting the function out of stdlib seemed like the most backwards compatible solution |
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.
@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
7d134d2
to
5221777
Compare
They removed the specific function in Python 3.9 so we should just remake the function here and use our own instead of relying on hidden functions from the stdlib Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
5221777
to
b944c06
Compare
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.
@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@seemethere merged this pull request in 780f2b9. |
Summary: They removed the specific function in Python 3.9 so we should just remake the function here and use our own instead of relying on hidden functions from the stdlib Signed-off-by: Eli Uriegas <eliuriegas@fb.com> Fixes pytorch#48617 Pull Request resolved: pytorch#48618 Reviewed By: samestep Differential Revision: D25230281 Pulled By: seemethere fbshipit-source-id: 57216af40a4ae4dc8bafcf40d2eb3ba793b9b6e2 (cherry picked from commit 780f2b9) Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
) Summary: They removed the specific function in Python 3.9 so we should just remake the function here and use our own instead of relying on hidden functions from the stdlib Signed-off-by: Eli Uriegas <eliuriegas@fb.com> Fixes #48617 Pull Request resolved: #48618 Reviewed By: samestep Differential Revision: D25230281 Pulled By: seemethere fbshipit-source-id: 57216af40a4ae4dc8bafcf40d2eb3ba793b9b6e2 (cherry picked from commit 780f2b9) Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Summary: They removed the specific function in Python 3.9 so we should just remake the function here and use our own instead of relying on hidden functions from the stdlib Signed-off-by: Eli Uriegas <eliuriegas@fb.com> Fixes pytorch#48617 Pull Request resolved: pytorch#48618 Reviewed By: samestep Differential Revision: D25230281 Pulled By: seemethere fbshipit-source-id: 57216af40a4ae4dc8bafcf40d2eb3ba793b9b6e2
They removed the specific function in Python 3.9 so we should just
remake the function here and use our own instead of relying on hidden
functions from the stdlib
Signed-off-by: Eli Uriegas eliuriegas@fb.com
Fixes #48617