From 09e24a4bead8b19c3a49fc07888d0d09079ad60c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 16 Apr 2024 11:01:18 -0500 Subject: [PATCH] PYTHON-4346 Reinstate CODEOWNERS File and Add Static Check in CI (#1587) --- .github/CODEOWNERS | 2 + .github/workflows/release-python.yml | 1 - .github/workflows/test-python.yml | 76 ++++++++++++++++++++-------- 3 files changed, 56 insertions(+), 23 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..a9d726b96 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Global owner for repo +* @mongodb/dbx-python diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 1bf2160df..e0c0ae02b 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -8,7 +8,6 @@ on: - "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+" - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+" workflow_dispatch: - pull_request: concurrency: group: wheels-${{ github.ref }} diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index e9fb64336..fe5d530dc 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -15,13 +15,13 @@ defaults: jobs: - lint: + static: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.8" cache: 'pip' cache-dependency-path: 'pyproject.toml' - name: Install Python dependencies @@ -30,7 +30,21 @@ jobs: - name: Run linters run: | tox -m lint-manual + - name: Check Manifest + run: | tox -m manifest + - name: Run compilation + run: | + pip install -e . + python tools/fail_if_no_c.py + - name: Run typecheck + run: | + tox -m typecheck + - run: | + sudo apt-get install -y cppcheck + - run: | + cppcheck --force bson + cppcheck pymongo build: # supercharge/mongodb-github-action requires containers so we don't test other platforms @@ -81,26 +95,6 @@ jobs: run: | tox -m doc-test - typing: - name: Typing Tests - runs-on: ubuntu-latest - strategy: - matrix: - python: ["3.7", "3.11"] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "${{matrix.python}}" - cache: 'pip' - cache-dependency-path: 'pyproject.toml' - - name: Install dependencies - run: | - pip install -q tox - - name: Run typecheck - run: | - tox -m typecheck - docs: name: Docs Checks runs-on: ubuntu-latest @@ -122,6 +116,44 @@ jobs: run: | tox -m doc + linkcheck: + name: Link Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + cache: 'pip' + cache-dependency-path: 'pyproject.toml' + # Build docs on lowest supported Python for furo + python-version: '3.8' + - name: Install dependencies + run: | + pip install -q tox + - name: Build docs + run: | + tox -m linkcheck + + typing: + name: Typing Tests + runs-on: ubuntu-latest + strategy: + matrix: + python: ["3.7", "3.11"] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "${{matrix.python}}" + cache: 'pip' + cache-dependency-path: 'pyproject.toml' + - name: Install dependencies + run: | + pip install -q tox + - name: Run typecheck + run: | + tox -m typecheck + make_sdist: runs-on: ubuntu-latest name: "Make an sdist"