From 4c0f884c046fff3b8e5cae9c1259c7e9d96f0573 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 30 Apr 2024 09:34:05 -0500 Subject: [PATCH 1/3] PYTHON-4409 Streamline Wheel Building (#1624) --- .github/workflows/release-python.yml | 116 +++++++-------------------- .github/workflows/test-python.yml | 1 + 2 files changed, 31 insertions(+), 86 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 0b7a47bd7..c17d4046e 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -20,7 +20,7 @@ defaults: jobs: build_wheels: - name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} + name: Build wheels for ${{ matrix.buildplat[1] }} runs-on: ${{ matrix.buildplat[0] }} strategy: # Ensure that a wheel builder finishes even if another fails @@ -29,27 +29,14 @@ jobs: # Github Actions doesn't support pairing matrix values together, let's improvise # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026 buildplat: - - [ubuntu-20.04, manylinux_x86_64] - - [ubuntu-20.04, manylinux_aarch64] - - [ubuntu-20.04, manylinux_ppc64le] - - [ubuntu-20.04, manylinux_s390x] - - [ubuntu-20.04, manylinux_i686] - - [windows-2019, win_amd64] - - [windows-2019, win32] - python: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"] - include: - - buildplat: [macos-11, macosx_*] - python: "cp37" - - buildplat: [macos-11, macosx_*] - python: "cp38" - - buildplat: [macos-11, macosx_*] - python: "cp39" - - buildplat: [macos-14, macosx_*] - python: "cp310" - - buildplat: [macos-14, macosx_*] - python: "cp311" - - buildplat: [macos-14, macosx_*] - python: "cp312" + - [ubuntu-20.04, "manylinux_x86_64", "cp3*-manylinux_x86_64"] + - [ubuntu-20.04, "manylinux_aarch64", "cp3*-manylinux_aarch64"] + - [ubuntu-20.04, "manylinux_ppc64le", "cp3*-manylinux_ppc64le"] + - [ubuntu-20.04, "manylinux_s390x", "cp3*-manylinux_s390x"] + - [ubuntu-20.04, "manylinux_i686", "cp3*-manylinux_i686"] + - [windows-2019, "win_amd6", "cp3*-win_amd64"] + - [windows-2019, "win32", "cp3*-win32"] + - [macos-14, "macos", "cp*-macosx_*"] steps: - name: Checkout pymongo @@ -57,15 +44,10 @@ jobs: with: fetch-depth: 0 - - name: Set up python version - run: | - export PYTHON_VERSION=$(sed 's/^cp3/3./' <<< ${{ matrix.python }} ) - echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV - - uses: actions/setup-python@v5 with: - python-version: ${{env.PYTHON_VERSION}} cache: 'pip' + python-version: 3.8 cache-dependency-path: 'pyproject.toml' allow-prereleases: true @@ -79,75 +61,37 @@ jobs: # Note: the default manylinux is manylinux2014 run: | python -m pip install -U pip - python -m pip install "cibuildwheel>=2.4,<3" + python -m pip install "cibuildwheel>=2.17,<3" - - name: Build wheel - if: ${{ matrix.buildplat[0] != 'macos-14' }} + - name: Build wheels env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - MACOS_TEST_SKIP: "*arm64" + CIBW_BUILD: ${{ matrix.buildplat[2] }} run: python -m cibuildwheel --output-dir wheelhouse - - name: Build wheel on M1 - if: ${{ matrix.buildplat[0] == 'macos-14' }} + - name: Build manylinux1 wheels + if: ${{ matrix.buildplat[1] == 'manylinux_x86_64' || matrix.buildplat[1] == 'manylinux_i686' }} env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_MANYLINUX_X86_64_IMAGE: manylinux1 + CIBW_MANYLINUX_I686_IMAGE: manylinux1 + CIBW_BUILD: "cp37-${{ matrix.buildplat[1] }} cp38-${{ matrix.buildplat[1] }} cp39-${{ matrix.buildplat[1] }}" run: python -m cibuildwheel --output-dir wheelhouse + - name: Assert all versions in wheelhouse + if: ${{ ! startsWith(matrix.buildplat[1], 'macos') }} + run: | + ls wheelhouse/*cp37*.whl + ls wheelhouse/*cp38*.whl + ls wheelhouse/*cp39*.whl + ls wheelhouse/*cp310*.whl + ls wheelhouse/*cp311*.whl + ls wheelhouse/*cp312*.whl + - uses: actions/upload-artifact@v4 with: - name: wheel-${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }} + name: wheel-${{ matrix.buildplat[1] }} path: ./wheelhouse/*.whl if-no-files-found: error - build_manylinux1_wheels: - runs-on: ubuntu-latest - strategy: - # Ensure that a wheel builder finishes even if another fails - fail-fast: false - matrix: - python: ["cp37", "cp38", "cp39"] - steps: - - name: Checkout pymongo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up python version - run: | - export PYTHON_VERSION=$(sed 's/^cp3/3./' <<< ${{ matrix.python }} ) - echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV - - - uses: actions/setup-python@v5 - with: - python-version: ${{env.PYTHON_VERSION}} - cache: 'pip' - cache-dependency-path: 'pyproject.toml' - allow-prereleases: true - - - name: Install cibuildwheel - run: | - python -m pip install -U pip - python -m pip install "cibuildwheel>=2.4,<3" - - - name: Build manylinux_x86_64 - env: - CIBW_BUILD: ${{ matrix.python }}-manylinux_x86_64 - CIBW_MANYLINUX_X86_64_IMAGE: manylinux1 - run: python -m cibuildwheel --output-dir wheelhouse - - - name: Build manylinux_i686 - env: - CIBW_BUILD: ${{ matrix.python }}-manylinux_i686 - CIBW_MANYLINUX_I686_IMAGE: manylinux1 - run: python -m cibuildwheel --output-dir wheelhouse - - - uses: actions/upload-artifact@v4 - with: - name: wheel-${{ matrix.python }}-manylinux1 - path: ./wheelhouse/*.whl - if-no-files-found: error - make_sdist: name: Make SDist runs-on: macos-13 @@ -180,7 +124,7 @@ jobs: collect_dist: runs-on: ubuntu-latest - needs: [build_wheels, build_manylinux1_wheels, make_sdist] + needs: [build_wheels, make_sdist] name: Download Wheels steps: - name: Download all workflow run artifacts diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 5df13b950..31dc018f2 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -2,6 +2,7 @@ name: Python Tests on: push: + branches: ["master", "v**"] pull_request: workflow_dispatch: From 08410399419a6e921b0f42eb663af91bce8c6c37 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 30 Apr 2024 09:37:37 -0500 Subject: [PATCH 2/3] PYTHON-4411 Prep for 4.7.1 Release (#1625) --- doc/changelog.rst | 17 +++++++++++++++++ pymongo/_version.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index 1b8257279..ff0374237 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -1,6 +1,23 @@ Changelog ========= +Changes in Version 4.7.1 +------------------------- + +Version 4.7.1 fixes a bug introduced in 4.7.0: + +- Fixed a bug where PyMongo would cause an ``AttributeError`` if ``dns.resolver`` was imported and referenced + after PyMongo was imported. +- Clarified the behavior of the ``TOKEN_RESOURCE`` auth mechanism property for ``MONGODB-OIDC``. + +Issues Resolved +............... + +See the `PyMongo 4.7.1 release notes in JIRA`_ for the list of resolved issues +in this release. + +.. _PyMongo 4.7.1 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=39680 + Changes in Version 4.7 ------------------------ diff --git a/pymongo/_version.py b/pymongo/_version.py index dc5c38c73..de8933e30 100644 --- a/pymongo/_version.py +++ b/pymongo/_version.py @@ -17,7 +17,7 @@ from __future__ import annotations from typing import Tuple, Union -version_tuple: Tuple[Union[int, str], ...] = (4, 8, 0, ".dev0") +version_tuple: Tuple[Union[int, str], ...] = (4, 7, 1) def get_version_string() -> str: From 4758f1fb46054e4b45f1cd5e8da586248a5517b1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 30 Apr 2024 09:39:49 -0500 Subject: [PATCH 3/3] BUMP 4.8.0.dev0 --- pymongo/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymongo/_version.py b/pymongo/_version.py index de8933e30..dc5c38c73 100644 --- a/pymongo/_version.py +++ b/pymongo/_version.py @@ -17,7 +17,7 @@ from __future__ import annotations from typing import Tuple, Union -version_tuple: Tuple[Union[int, str], ...] = (4, 7, 1) +version_tuple: Tuple[Union[int, str], ...] = (4, 8, 0, ".dev0") def get_version_string() -> str: