Skip to content

Commit

Permalink
Python 3.10 support (#271)
Browse files Browse the repository at this point in the history
* preupdate python310 matrix

* update dev requirement

* adding new dockerfile based on previous docker output. updating manylinux2010

* manylinux 3.10rc2 set up and ready

* adjust target image. ensure that build.sh for azsdk version of manylinux1 aligns with build.ps1 for the same.

* update target version of python 3.10

* disabling all but 310 to ensure we don't choke the agent pull. revert this before merge

* updated installer script to actually pull down 3.10. updated client yml as well

* attempt kinda upgrade

* change the target package

* we can't find libffi

* update pytest asyncio dep

* fix async test

* drop manylinux1 3.10

* update livetest, changelog and bump version

* move folder

* update to 3.10

* uncomment linux

* specify to 3.10.0

* try reset max precached version

* specify version

* update name

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
  • Loading branch information
yunhaoling and scbedd authored Oct 5, 2021
1 parent ca81956 commit 9155d57
Show file tree
Hide file tree
Showing 20 changed files with 520 additions and 16 deletions.
29 changes: 21 additions & 8 deletions .azure-pipelines/client.test.live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ variables:
PythonVersion37: '3.7'
PythonVersion38: '3.8'
PythonVersion39: '3.9'
PythonVersion310: '3.10.0'
GetPip: 'https://bootstrap.pypa.io/get-pip.py'

jobs:
Expand Down Expand Up @@ -36,6 +37,9 @@ jobs:
x64 Python 3.9:
PythonArchitecture: 'x64'
PythonVersion: '$(PythonVersion39)'
x64 Python 3.10:
PythonArchitecture: 'x64'
PythonVersion: '$(PythonVersion310)'
x86 Python 2.7:
PythonArchitecture: 'x86'
PythonVersion: '$(PythonVersion27)'
Expand All @@ -52,6 +56,9 @@ jobs:
x86 Python 3.9:
PythonArchitecture: 'x86'
PythonVersion: '$(PythonVersion39)'
x86 Python 3.10:
PythonArchitecture: 'x86'
PythonVersion: '$(PythonVersion310)'

steps:
- template: /.azure-pipelines/use-python-version.yml
Expand Down Expand Up @@ -143,6 +150,9 @@ jobs:
Python 3.9:
PythonBin: 'python3'
PythonVersion: '$(PythonVersion39)'
Python 3.10:
PythonBin: 'python3'
PythonVersion: '$(PythonVersion310)'

variables:
MacOSXDeploymentTarget: '10.9'
Expand All @@ -152,6 +162,7 @@ jobs:
PythonVersion37: '3.7.6'
PythonVersion38: '3.8.2'
PythonVersion39: '3.9.0'
PythonVersion310: '3.10.0'

steps:
- task: DownloadPipelineArtifact@1
Expand Down Expand Up @@ -255,6 +266,8 @@ jobs:
PythonVersion: '$(PythonVersion38)'
Python 3.9:
PythonVersion: '$(PythonVersion39)'
Python 3.10:
PythonVersion: '$(PythonVersion310)'

steps:
- template: /.azure-pipelines/use-python-version.yml
Expand Down Expand Up @@ -323,14 +336,14 @@ jobs:
EventHub x64 Python 2.7:
PythonVersion: '$(PythonVersion27)'
SDK: 'EventHub'
EventHub x64 Python 3.8:
PythonVersion: '$(PythonVersion38)'
EventHub x64 Python 3.10:
PythonVersion: '$(PythonVersion310)'
SDK: 'EventHub'
ServiceBus x64 Python 2.7:
PythonVersion: '$(PythonVersion27)'
SDK: 'ServiceBus'
ServiceBus x64 Python 3.8:
PythonVersion: '$(PythonVersion38)'
ServiceBus x64 Python 3.10:
PythonVersion: '$(PythonVersion310)'
SDK: 'ServiceBus'
variables:
PythonArchitecture: 'x64'
Expand Down Expand Up @@ -379,14 +392,14 @@ jobs:
EventHub Python 3.7:
PythonVersion: '$(PythonVersion37)'
SDK: 'EventHub'
EventHub Python 3.9:
PythonVersion: '$(PythonVersion39)'
EventHub Python 3.10:
PythonVersion: '$(PythonVersion310)'
SDK: 'EventHub'
ServiceBus Python 3.7:
PythonVersion: '$(PythonVersion37)'
SDK: 'ServiceBus'
ServiceBus Python 3.9:
PythonVersion: '$(PythonVersion39)'
ServiceBus Python 3.10:
PythonVersion: '$(PythonVersion310)'
SDK: 'ServiceBus'
variables:
OSArch: 'Linux'
Expand Down
17 changes: 17 additions & 0 deletions .azure-pipelines/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ variables:
PythonVersion37: '3.7'
PythonVersion38: '3.8'
PythonVersion39: '3.9'
PythonVersion310: '3.10.0'
GetPip: 'https://bootstrap.pypa.io/get-pip.py'

jobs:
Expand Down Expand Up @@ -67,6 +68,9 @@ jobs:
Python 3.9:
PythonBin: 'python3'
PythonVersion: '$(PythonVersion39)'
Python 3.10:
PythonBin: 'python3'
PythonVersion: '$(PythonVersion310)'

variables:
MacOSXDeploymentTarget: '10.9'
Expand All @@ -76,6 +80,7 @@ jobs:
PythonVersion37: '3.7.6'
PythonVersion38: '3.8.2'
PythonVersion39: '3.9.0'
PythonVersion310: '3.10.0'

steps:
- task: DownloadPipelineArtifact@1
Expand Down Expand Up @@ -168,6 +173,9 @@ jobs:
x64 Python 3.9:
PythonArchitecture: 'x64'
PythonVersion: '$(PythonVersion39)'
x64 Python 3.10:
PythonArchitecture: 'x64'
PythonVersion: '$(PythonVersion310)'
x86 Python 2.7:
PythonArchitecture: 'x86'
PythonVersion: '$(PythonVersion27)'
Expand All @@ -184,6 +192,9 @@ jobs:
x86 Python 3.9:
PythonArchitecture: 'x86'
PythonVersion: '$(PythonVersion39)'
x86 Python 3.10:
PythonArchitecture: 'x86'
PythonVersion: '$(PythonVersion310)'

steps:
- template: /.azure-pipelines/use-python-version.yml
Expand Down Expand Up @@ -254,6 +265,8 @@ jobs:
PythonVersion: '$(PythonVersion38)'
Python 3.9:
PythonVersion: '$(PythonVersion39)'
Python 3.10:
PythonVersion: '$(PythonVersion310)'

steps:
- template: /.azure-pipelines/use-python-version.yml
Expand Down Expand Up @@ -357,6 +370,10 @@ jobs:
ContainerImage: 'manylinux2010_crypto_x64'
PythonVersion: 'cp39-cp39'
Platform: 'manylinux2010_x86_64'
Python310-manylinux2010:
ContainerImage: 'manylinux2010_crypto_x64'
PythonVersion: 'cp310-cp310'
Platform: 'manylinux2010_x86_64'

steps:
- task: Docker@1
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/install_python_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def get_installer_url(requested_version, requested_arch, version_manifest):
)

args = parser.parse_args()
max_precached_version = Version("3.9.0")
max_precached_version = Version("3.9.7")
try:
version_from_spec = Version(args.version_spec)
except InvalidVersion:
Expand Down
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ matrix:
- pytest
- python ./setup.py check -r -s
- pylint --extension-pkg-whitelist=uamqp.c_uamqp uamqp
- os: linux
python: "3.10"
env: UAMQP_ENV=LINUX310
script:
- pytest
- python ./setup.py check -r -s
- pylint --extension-pkg-whitelist=uamqp.c_uamqp uamqp
sudo: required
services:
- docker
Expand Down
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

1.4.3 (2021-10-05)
+++++++++++++++++++

- Added support for Python 3.10.

1.4.2 (2021-09-21)
+++++++++++++++++++

Expand Down
4 changes: 2 additions & 2 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ cython==0.29.21
setuptools>=27.1.2
wheel>=0.32.0
pytest==6.2.4; python_version >= '3.10'
pytest==5.4.1; python_version >= '3.6'
pytest==5.4.1; python_version >= '3.6' and python_version < '3.10'
pytest==4.6.9; python_version == '2.7'
pytest-asyncio==0.10.0; python_version >= '3.6'
pytest-asyncio==0.12.0; python_version >= '3.6'
docutils>=0.14
pygments>=2.2.0
pylint==2.3.1; python_version >= '3.4'
Expand Down
4 changes: 4 additions & 0 deletions install_python_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ PACKAGE_TYPE="macosx10.9"
if [[ "$PYTHONVERSION" =~ ^3.5 ]]; then
PACKAGE_TYPE="macosx10.6"
fi
if [[ "$PYTHONVERSION" =~ ^3.10 ]]; then
PACKAGE_TYPE="macos11"
fi


# Handle prerelease versions
PACKAGE_DIR="$PYTHONVERSION"
Expand Down
4 changes: 2 additions & 2 deletions samples/asynctests/test_loop_param_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ async def auth_async_loop():
with pytest.raises(ValueError) as e:
await auth_async.create_authenticator_async("fake_conn", loop=asyncio.get_event_loop())
assert "no longer supports loop" in e
loop = asyncio.get_event_loop()
loop.run_until_complete(auth_async_loop())

await auth_async_loop()
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ def build_cmake(self, ext):
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: MIT License'
],
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion uamqp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
pass # Async not supported.


__version__ = "1.4.2"
__version__ = "1.4.3"


_logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion utils/ManyLinux2010_64bit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM pyca/cryptography-manylinux2010:x86_64
FROM ghcr.io/pyca/cryptography-manylinux2010:x86_64

# Build cmake 3.11
RUN pushd /tmp && \
Expand Down
10 changes: 10 additions & 0 deletions utils/ManyLinux2010_64bit/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
param (
[string]
$TAG
)

az acr login --subscription "Azure SDK Engineering System" --name azuresdkimages
az acr build --subscription "Azure SDK Engineering System" -r azuresdkimages -t azuresdkimages.azurecr.io/manylinux2010_crypto_x64:$TAG .
docker pull azuresdkimages.azurecr.io/manylinux2010_crypto_x64:$TAG
docker tag azuresdkimages.azurecr.io/manylinux2010_crypto_x64:$TAG azuresdkimages.azurecr.io/manylinux2010_crypto_x64:latest
docker push azuresdkimages.azurecr.io/manylinux2010_crypto_x64:latest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM pyca/cryptography-manylinux1:x86_64
FROM quay.io/pypa/manylinux1_x86_64:latest

# Build cmake 3.11
RUN pushd /tmp && \
Expand All @@ -19,3 +19,7 @@ RUN pushd /tmp && \
make && \
make install && \
popd

# RUN apt-get install software-properties-common git --yes
# RUN add-apt-repository ppa:deadsnakes/ppa -y
# RUN apt install python3.10 -y
10 changes: 10 additions & 0 deletions utils/deprecated/ManyLinux1_64bit/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
param (
[string]
$TAG
)

az acr login --subscription "Azure SDK Engineering System" --name azuresdkimages || exit 1
az acr build --subscription "Azure SDK Engineering System" -r azuresdkimages -t azuresdkimages.azurecr.io/manylinux_crypto_x64:$TAG .
docker pull azuresdkimages.azurecr.io/manylinux_crypto_x64:$TAG
docker tag azuresdkimages.azurecr.io/manylinux_crypto_x64:$TAG azuresdkimages.azurecr.io/manylinux_crypto_x64:latest
docker push azuresdkimages.azurecr.io/manylinux_crypto_x64:latest
File renamed without changes.
23 changes: 23 additions & 0 deletions utils/deprecated/ManyLinux1_64bit_azsdk/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM azuresdkimages.azurecr.io/manylinux_crypto_x64:3.9

# download source
RUN yum install gcc openssl-devel bzip2-devel libffi libffi-dev libffi-devel -y \
&& curl -O https://www.python.org/ftp/python/3.10.0/Python-3.10.0rc2.tgz \
&& tar -xzf ./Python-3.10.0rc2.tgz

# copy file with necessary configurations for openssl
COPY Setup /root/Python-3.10.0rc2/Modules/Setup

ENV CFLAGS=-I/usr/lib64/libffi-3.0.5/include

# ensure none of the lineendings in the copied file were wrong. install python3.10
RUN ldconfig \
&& sed -i -e 's/\r$//' /root/Python-3.10.0rc2/Modules/Setup \
&& cd Python-3.10.0rc2 \
&& ./configure --enable-optimizations \
&& make altinstall

# ensure proper symlinks are in place as necessary for tooling
RUN mkdir -p /opt/python/cp310-cp310/bin \
&& ln -s /usr/local/bin/python3.10 /opt/python/cp310-cp310/bin/python \
&& ln -s /usr/local/bin/pip3.10 /opt/python/cp310-cp310/bin/pip
Loading

0 comments on commit 9155d57

Please sign in to comment.