浏览代码

Bumping python versions in GitHub workflows and pyproject.toml

* Updated the python-version in .github/workflows/disperse.yml
* Updated the python-version in .github/workflows/pythontest.yml
* Updated the python-version in .github/workflows/docs.yml
* Updated the python-version in .github/workflows/python-distributions.yml
* Updated the requires-python field in pyproject.toml to ['3.13', '3.12', '3.11', '3.10', '3.9']
Jelmer Vernooij 4 月之前
父节点
当前提交
98e1d88f05
共有 5 个文件被更改,包括 185 次插入180 次删除
  1. 3 4
      .github/workflows/disperse.yml
  2. 13 14
      .github/workflows/docs.yml
  3. 114 114
      .github/workflows/python-distributions.yml
  4. 50 46
      .github/workflows/pythontest.yml
  5. 5 2
      pyproject.toml

+ 3 - 4
.github/workflows/disperse.yml

@@ -1,9 +1,8 @@
----
 name: Disperse configuration
 
 "on":
   push:
-    branches: [ main, master ]
+    branches: [main, master]
 
 jobs:
   build:
@@ -11,5 +10,5 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-      - uses: actions/checkout@v4
-      - uses: jelmer/action-disperse-validate@v1
+    - uses: actions/checkout@v4
+    - uses: jelmer/action-disperse-validate@v1

+ 13 - 14
.github/workflows/docs.yml

@@ -1,26 +1,25 @@
-
 name: API Docs
 
 on:
   push:
-    branches: [ main, master ]
+    branches: [main, master]
   pull_request:
   schedule:
-    - cron: "0 6 * * *" # Daily 6AM UTC build
+  - cron: "0 6 * * *"   # Daily 6AM UTC build
 
 jobs:
   test:
     runs-on: ubuntu-latest
 
     steps:
-      - uses: actions/checkout@v4
-      - name: Set up Python
-        uses: actions/setup-python@v5
-        with:
-          python-version: "3.10"
-      - name: Install pydoctor
-        run: |
-          sudo apt-get update && sudo apt -y install -y pydoctor python3-pip
-          pip3 install pydoctor
-      - name: Generate docs
-        run: make apidocs
+    - uses: actions/checkout@v4
+    - name: Set up Python
+      uses: actions/setup-python@v5
+      with:
+        python-version: "3.10"
+    - name: Install pydoctor
+      run: |
+        sudo apt-get update && sudo apt -y install -y pydoctor python3-pip
+        pip3 install pydoctor
+    - name: Generate docs
+      run: make apidocs

+ 114 - 114
.github/workflows/python-distributions.yml

@@ -2,12 +2,12 @@ name: Build Python distributions
 
 on:
   push:
-    branches: [ main, master ]
+    branches: [main, master]
     tags:
-      - 'dulwich-*'
+    - 'dulwich-*'
   pull_request:
   schedule:
-    - cron: "0 6 * * *" # Daily 6AM UTC build
+  - cron: "0 6 * * *"   # Daily 6AM UTC build
 
 jobs:
   define-matrix:
@@ -16,43 +16,43 @@ jobs:
       matrix: ${{ steps.merged-identifiers.outputs.merged-identifiers }}
 
     steps:
-      - uses: actions/checkout@v4
-      - uses: actions/setup-python@v5
-        with:
-          python-version: 3.x
-          cache: pip
-      - name: Install jq
-        run: sudo apt-get update && sudo apt-get install -y jq
-      - name: Install cibuildwheel
-        run: pip install cibuildwheel
-      - name: Find build identifiers using cibuildwheel --print-build-identifiers
-        id: all-build-identifiers
-        run: |
-          echo "linux=$(cibuildwheel --platform linux --print-build-identifiers | tr '\n' ' ')" >> $GITHUB_OUTPUT
-          echo "macos=$(cibuildwheel --platform macos --print-build-identifiers | tr '\n' ' ')" >> $GITHUB_OUTPUT
-          echo "windows=$(cibuildwheel --platform windows --print-build-identifiers | tr '\n' ' ')" >> $GITHUB_OUTPUT
-      - name: Select build identifiers
-        id: select-build-identifiers
-        run: |
-          if [[ "$GITHUB_REF" = "refs/heads/main" ]] || [[ "$GITHUB_REF" = "refs/heads/master" ]] || [[ "$GITHUB_REF" = "refs/tags/"* ]]; then
-            echo 'linux=${{ steps.all-build-identifiers.outputs.linux }}' >> $GITHUB_OUTPUT
-            echo 'windows=${{ steps.all-build-identifiers.outputs.windows }}' >> $GITHUB_OUTPUT
-            echo 'macos=${{ steps.all-build-identifiers.outputs.macos }}' >> $GITHUB_OUTPUT
-          else
-            echo "linux=$(echo -n '${{ steps.all-build-identifiers.outputs.linux }}' | awk '{print $NF}')" >> $GITHUB_OUTPUT
-            echo "macos=$(echo -n '${{ steps.all-build-identifiers.outputs.macos }}' | awk '{print $NF}')" >> $GITHUB_OUTPUT
-            echo "windows=$(echo -n '${{ steps.all-build-identifiers.outputs.windows }}' | awk '{print $NF}')" >> $GITHUB_OUTPUT
-          fi
-      - name: Output build identifiers
-        id: json-identifiers
-        run: |
-          echo "linux=$(echo -n '${{ steps.select-build-identifiers.outputs.linux }}' | jq -R -s -c 'split(" ") | map(select(length > 0)) | [.[] | {os: "ubuntu-latest", "build-identifier": .}]')" >> $GITHUB_OUTPUT
-          echo "macos=$(echo -n '${{ steps.select-build-identifiers.outputs.macos }}' | jq -R -s -c 'split(" ") | map(select(length > 0)) | [.[] | {os: "macos-latest", "build-identifier": .}]')" >> $GITHUB_OUTPUT
-          echo "windows=$(echo -n '${{ steps.select-build-identifiers.outputs.windows }}' | jq -R -s -c 'split(" ") | map(select(length > 0)) | [.[] | {os: "windows-latest", "build-identifier": .}]')" >> $GITHUB_OUTPUT
-      - name: Merge build identifiers
-        id: merged-identifiers
-        run: |
-          echo merged-identifiers=$(echo -n '${{ steps.json-identifiers.outputs.linux }} ${{ steps.json-identifiers.outputs.macos }} ${{ steps.json-identifiers.outputs.windows }}' | jq -c -s 'add') >> $GITHUB_OUTPUT
+    - uses: actions/checkout@v4
+    - uses: actions/setup-python@v5
+      with:
+        python-version: 3.x
+        cache: pip
+    - name: Install jq
+      run: sudo apt-get update && sudo apt-get install -y jq
+    - name: Install cibuildwheel
+      run: pip install cibuildwheel
+    - name: Find build identifiers using cibuildwheel --print-build-identifiers
+      id: all-build-identifiers
+      run: |
+        echo "linux=$(cibuildwheel --platform linux --print-build-identifiers | tr '\n' ' ')" >> $GITHUB_OUTPUT
+        echo "macos=$(cibuildwheel --platform macos --print-build-identifiers | tr '\n' ' ')" >> $GITHUB_OUTPUT
+        echo "windows=$(cibuildwheel --platform windows --print-build-identifiers | tr '\n' ' ')" >> $GITHUB_OUTPUT
+    - name: Select build identifiers
+      id: select-build-identifiers
+      run: |
+        if [[ "$GITHUB_REF" = "refs/heads/main" ]] || [[ "$GITHUB_REF" = "refs/heads/master" ]] || [[ "$GITHUB_REF" = "refs/tags/"* ]]; then
+          echo 'linux=${{ steps.all-build-identifiers.outputs.linux }}' >> $GITHUB_OUTPUT
+          echo 'windows=${{ steps.all-build-identifiers.outputs.windows }}' >> $GITHUB_OUTPUT
+          echo 'macos=${{ steps.all-build-identifiers.outputs.macos }}' >> $GITHUB_OUTPUT
+        else
+          echo "linux=$(echo -n '${{ steps.all-build-identifiers.outputs.linux }}' | awk '{print $NF}')" >> $GITHUB_OUTPUT
+          echo "macos=$(echo -n '${{ steps.all-build-identifiers.outputs.macos }}' | awk '{print $NF}')" >> $GITHUB_OUTPUT
+          echo "windows=$(echo -n '${{ steps.all-build-identifiers.outputs.windows }}' | awk '{print $NF}')" >> $GITHUB_OUTPUT
+        fi
+    - name: Output build identifiers
+      id: json-identifiers
+      run: |
+        echo "linux=$(echo -n '${{ steps.select-build-identifiers.outputs.linux }}' | jq -R -s -c 'split(" ") | map(select(length > 0)) | [.[] | {os: "ubuntu-latest", "build-identifier": .}]')" >> $GITHUB_OUTPUT
+        echo "macos=$(echo -n '${{ steps.select-build-identifiers.outputs.macos }}' | jq -R -s -c 'split(" ") | map(select(length > 0)) | [.[] | {os: "macos-latest", "build-identifier": .}]')" >> $GITHUB_OUTPUT
+        echo "windows=$(echo -n '${{ steps.select-build-identifiers.outputs.windows }}' | jq -R -s -c 'split(" ") | map(select(length > 0)) | [.[] | {os: "windows-latest", "build-identifier": .}]')" >> $GITHUB_OUTPUT
+    - name: Merge build identifiers
+      id: merged-identifiers
+      run: |
+        echo merged-identifiers=$(echo -n '${{ steps.json-identifiers.outputs.linux }} ${{ steps.json-identifiers.outputs.macos }} ${{ steps.json-identifiers.outputs.windows }}' | jq -c -s 'add') >> $GITHUB_OUTPUT
 
   build-wheels:
     runs-on: ${{ matrix.os }}
@@ -63,89 +63,89 @@ jobs:
       fail-fast: true
 
     steps:
-      - uses: actions/checkout@v4
-      - uses: actions/setup-python@v5
-        with:
-          cache: pip
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install setuptools wheel cibuildwheel setuptools-rust
-      - name: Set up QEMU
-        uses: docker/setup-qemu-action@v3
-        if: "matrix.os == 'ubuntu-latest'"
-      - name: Build wheels
-        run: python -m cibuildwheel --output-dir wheelhouse
-        env:
-          CIBW_BUILD: "${{ matrix.build-identifier }}*"
-      - name: Upload wheels
-        uses: actions/upload-artifact@v4
-        with:
-          name: artifact-${{ matrix.build-identifier }}
-          path: ./wheelhouse/*.whl
+    - uses: actions/checkout@v4
+    - uses: actions/setup-python@v5
+      with:
+        cache: pip
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install setuptools wheel cibuildwheel setuptools-rust
+    - name: Set up QEMU
+      uses: docker/setup-qemu-action@v3
+      if: "matrix.os == 'ubuntu-latest'"
+    - name: Build wheels
+      run: python -m cibuildwheel --output-dir wheelhouse
+      env:
+        CIBW_BUILD: "${{ matrix.build-identifier }}*"
+    - name: Upload wheels
+      uses: actions/upload-artifact@v4
+      with:
+        name: artifact-${{ matrix.build-identifier }}
+        path: ./wheelhouse/*.whl
 
   build-pure-wheels:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
-      - uses: actions/setup-python@v5
-        with:
-          cache: pip
-      - run: pip install build
-      - run: PURE=true python -m build --wheel
-      - name: Upload pure wheels
-        uses: actions/upload-artifact@v4
-        with:
-          name: artifact-pure
-          path: ./dist/*.whl
+    - uses: actions/checkout@v4
+    - uses: actions/setup-python@v5
+      with:
+        cache: pip
+    - run: pip install build
+    - run: PURE=true python -m build --wheel
+    - name: Upload pure wheels
+      uses: actions/upload-artifact@v4
+      with:
+        name: artifact-pure
+        path: ./dist/*.whl
 
   build-sdist:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
-      - uses: actions/setup-python@v5
-        with:
-          cache: pip
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install build
-      - name: Build sdist
-        run: python -m build --sdist
-      - name: Upload sdist
-        uses: actions/upload-artifact@v4
-        with:
-          name: artifact-source
-          path: ./dist/*.tar.gz
+    - uses: actions/checkout@v4
+    - uses: actions/setup-python@v5
+      with:
+        cache: pip
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install build
+    - name: Build sdist
+      run: python -m build --sdist
+    - name: Upload sdist
+      uses: actions/upload-artifact@v4
+      with:
+        name: artifact-source
+        path: ./dist/*.tar.gz
 
   test-sdist:
     needs:
-      - build-sdist
+    - build-sdist
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/setup-python@v5
-        with:
-          cache: pip
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install twine
-      - name: Download sdist
-        uses: actions/download-artifact@v4
-        with:
-          name: artifact-source
-          path: dist
-      - name: Test sdist
-        run: twine check dist/*
-      - name: Test installation from sdist
-        run: pip install dist/*.tar.gz
+    - uses: actions/setup-python@v5
+      with:
+        cache: pip
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install twine
+    - name: Download sdist
+      uses: actions/download-artifact@v4
+      with:
+        name: artifact-source
+        path: dist
+    - name: Test sdist
+      run: twine check dist/*
+    - name: Test installation from sdist
+      run: pip install dist/*.tar.gz
 
   publish:
     runs-on: ubuntu-latest
     needs:
-      - build-wheels
-      - build-sdist
-      - build-pure-wheels
+    - build-wheels
+    - build-sdist
+    - build-pure-wheels
     if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/dulwich-')
     permissions:
       id-token: write
@@ -153,11 +153,11 @@ jobs:
       name: pypi
       url: https://pypi.org/p/dulwich
     steps:
-      - name: Download distributions
-        uses: actions/download-artifact@v4
-        with:
-          merge-multiple: true
-          pattern: artifact-*
-          path: dist
-      - name: Publish package distributions to PyPI
-        uses: pypa/gh-action-pypi-publish@release/v1
+    - name: Download distributions
+      uses: actions/download-artifact@v4
+      with:
+        merge-multiple: true
+        pattern: artifact-*
+        path: dist
+    - name: Publish package distributions to PyPI
+      uses: pypa/gh-action-pypi-publish@release/v1

+ 50 - 46
.github/workflows/pythontest.yml

@@ -2,10 +2,10 @@ name: Python tests
 
 on:
   push:
-    branches: [ main, master ]
+    branches: [main, master]
   pull_request:
   schedule:
-    - cron: "0 6 * * *" # Daily 6AM UTC build
+  - cron: "0 6 * * *"   # Daily 6AM UTC build
 
 jobs:
   test:
@@ -14,50 +14,54 @@ jobs:
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
         python-version:
-          ["3.9", "3.10", "3.11", "3.12", "3.13"]
+        - '3.13'
+        - '3.12'
+        - '3.11'
+        - '3.10'
+        - '3.9'
       fail-fast: false
 
     steps:
-      - uses: actions/checkout@v4
-      - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v5
-        with:
-          python-version: ${{ matrix.python-version }}
-          allow-prereleases: true
-          cache: pip
-      - name: Install native dependencies (Ubuntu)
-        run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
-        if: "matrix.os == 'ubuntu-latest'"
-      - name: Install native dependencies (MacOS)
-        run: brew install swig gpgme
-        if: "matrix.os == 'macos-latest'"
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install --upgrade ".[fastimport,paramiko,https]"  setuptools-rust
-      - name: Install gpg on supported platforms
-        run: pip install --upgrade ".[pgp]"
-        if: "matrix.os != 'windows-latest' && matrix.python-version != 'pypy3'"
-      - name: Style checks
-        run: |
-          pip install ".[dev]"
-          python -m ruff check .
-          python -m ruff format --check .
-      - name: Typing checks
-        run: |
-          pip install --upgrade types-paramiko types-requests
-          python -m mypy dulwich
-        if: "matrix.python-version != 'pypy3'"
-      - name: Build
-        run: |
-          python setup.py build_ext -i
-        env:
-          RUSTFLAGS: "-D warnings"
-      - name: codespell
-        run: |
-          pip install --upgrade codespell
-          codespell --config .codespellrc .
-      - name: Coverage test suite run
-        run: |
-          pip install --upgrade coverage
-          python -m coverage run -p -m unittest tests.test_suite
+    - uses: actions/checkout@v4
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v5
+      with:
+        python-version: ${{ matrix.python-version }}
+        allow-prereleases: true
+        cache: pip
+    - name: Install native dependencies (Ubuntu)
+      run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
+      if: "matrix.os == 'ubuntu-latest'"
+    - name: Install native dependencies (MacOS)
+      run: brew install swig gpgme
+      if: "matrix.os == 'macos-latest'"
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install --upgrade ".[fastimport,paramiko,https]"  setuptools-rust
+    - name: Install gpg on supported platforms
+      run: pip install --upgrade ".[pgp]"
+      if: "matrix.os != 'windows-latest' && matrix.python-version != 'pypy3'"
+    - name: Style checks
+      run: |
+        pip install ".[dev]"
+        python -m ruff check .
+        python -m ruff format --check .
+    - name: Typing checks
+      run: |
+        pip install --upgrade types-paramiko types-requests
+        python -m mypy dulwich
+      if: "matrix.python-version != 'pypy3'"
+    - name: Build
+      run: |
+        python setup.py build_ext -i
+      env:
+        RUSTFLAGS: "-D warnings"
+    - name: codespell
+      run: |
+        pip install --upgrade codespell
+        codespell --config .codespellrc .
+    - name: Coverage test suite run
+      run: |
+        pip install --upgrade coverage
+        python -m coverage run -p -m unittest tests.test_suite

+ 5 - 2
pyproject.toml

@@ -17,8 +17,11 @@ classifiers = [
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
     "Programming Language :: Python :: 3.13",
-    "Programming Language :: Python :: Implementation :: CPython",
-    "Programming Language :: Python :: Implementation :: PyPy",
+    "Programming Language :: Python :: 3.13",
+    "Programming Language :: Python :: 3.12",
+    "Programming Language :: Python :: 3.11",
+    "Programming Language :: Python :: 3.10",
+    "Programming Language :: Python :: 3.9",
     "Operating System :: POSIX",
     "Operating System :: Microsoft :: Windows",
     "Topic :: Software Development :: Version Control",