-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fix Release Pipeline for distutils #598
Changes from all commits
4ea58b8
e29951c
2fcd519
c2cbc42
b81bd19
800b2b3
ee7cb4c
8f31f34
20f816f
ec21fc3
bacfe15
7d7ee40
db16297
ecba0e2
54d4b9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0. | ||
|
||
import codecs | ||
import distutils.ccompiler | ||
import glob | ||
import os | ||
import os.path | ||
|
@@ -78,6 +76,7 @@ def determine_generator_args(): | |
if sys.platform == 'win32': | ||
try: | ||
# See which compiler python picks | ||
import distutils.ccompiler | ||
compiler = distutils.ccompiler.new_compiler() | ||
compiler.initialize() | ||
|
||
|
@@ -305,8 +304,12 @@ def run(self): | |
class bdist_wheel_abi3(bdist_wheel): | ||
def get_tag(self): | ||
python, abi, plat = super().get_tag() | ||
if python.startswith("cp") and sys.version_info >= (3, 11): | ||
# on CPython, our wheels are abi3 and compatible back to 3.11 | ||
# on CPython, our wheels are abi3 and compatible back to 3.11 | ||
if python.startswith("cp") and sys.version_info >= (3, 13): | ||
# 3.13 deprecates PyWeakref_GetObject(), adds alternative | ||
return "cp313", "abi3", plat | ||
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. worth to mention that cp313 has a different abi3 (Not sure if it's right wording.)? 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. Thanks, we already mention it at https://github.com/awslabs/aws-crt-python/blob/main/setup.py#L408. I will add a comment here as well. |
||
elif python.startswith("cp") and sys.version_info >= (3, 11): | ||
# 3.11 is the first stable ABI that has everything we need | ||
return "cp311", "abi3", plat | ||
|
||
return python, abi, plat | ||
|
@@ -326,6 +329,11 @@ def awscrt_ext(): | |
libraries.reverse() | ||
|
||
if sys.platform == 'win32': | ||
# distutils is deprecated in Python 3.10 and removed in 3.12. However, it still works because Python defines a compatibility interface as long as setuptools is installed. | ||
# We don't have an official alternative for distutils.ccompiler as of September 2024. See: https://github.com/pypa/setuptools/issues/2806 | ||
# Once that issue is resolved, we can migrate to the official solution. | ||
# For now, restrict distutils to Windows only, where it's needed. | ||
import distutils.ccompiler | ||
Comment on lines
331
to
+336
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. Can we move the import to the beginning of the file instead? So that we don't need to have two place to import the package? 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. If we move the import to the beginning of the file, it will be imported everywhere. Because this is only required on Windows and is deprecated, I have restricted it to Windows. 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. I mean move the
to the top of the file 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. Sorry, missed it in this PR. I have created #599 to fix this. |
||
# the windows apis being used under the hood. Since we're static linking we have to follow the entire chain down | ||
libraries += ['Secur32', 'Crypt32', 'Advapi32', 'NCrypt', 'BCrypt', 'Kernel32', 'Ws2_32', 'Shlwapi'] | ||
# Ensure that debug info is in the obj files, and that it is linked into the .pyd so that | ||
|
@@ -374,7 +382,7 @@ def awscrt_ext(): | |
# rare cases where that didn't happen, so let's be explicit. | ||
extra_link_args += ['-pthread'] | ||
|
||
if distutils.ccompiler.get_default_compiler() != 'msvc': | ||
if sys.platform != 'win32' or distutils.ccompiler.get_default_compiler() != 'msvc': | ||
extra_compile_args += ['-Wno-strict-aliasing', '-std=gnu99'] | ||
|
||
# treat warnings as errors in development mode | ||
|
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.
(debatable) Move those to a
prepare-manylinux.sh
.So that have one source instead of copy/paste to 4 places?
And we will remove manylinux1 sometime soon, so it's fine that not invoking it from manylinux1?
More future prove?
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 see any prepare-manylinux.sh script. Do you mean creating a new one? I think it's fine for now, since it's just two lines of code, and the rest of the code is different per platform. This is also ABI compatible wheel so we don't expect to do this often.
manylinux1 doesn't support Python 3.13, I believe, so we don't need to add it there.