Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/check-consistent-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
git fetch origin "$BASE_SHA"

# The ^"? is because git may quote weird file paths
if git diff --name-only "$BASE_SHA" | grep -P '^"?((requirements/)|(scripts/.*?/requirements/))'; then
if git diff --name-only "$BASE_SHA" | grep -P '^"?((requirements/)|(scripts/.*?/requirements/)|(pyproject\.toml)|(uv\.lock))'; then
echo "RELEVANT=true" >> "$GITHUB_ENV"
fi

Expand All @@ -48,6 +48,15 @@ jobs:
with:
python-version: '3.12'

- name: install system requirements
if: ${{ env.RELEVANT == 'true' }}
run: |
sudo apt-get update && sudo apt-get install libmysqlclient-dev libxmlsec1-dev

- name: Install uv
if: ${{ env.RELEVANT == 'true' }}
uses: astral-sh/setup-uv@v7

- name: "Recompile requirements"
if: ${{ env.RELEVANT == 'true' }}
run: |
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/check_python_dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Temporarily disabled: `find_python_dependencies` (from edx-repo-tools) only
# knows how to scan pip-compile's requirements/edx/{base,testing}.txt for
# undocumented git-hosted dependencies. Those files were removed when this
# repo switched to pyproject.toml + uv (see
# https://github.com/openedx/public-engineering/issues/543). Re-enable once
# edx-repo-tools can scan pyproject.toml/uv.lock instead — tracked at
# https://github.com/openedx/repo-tools/issues/725.
name: Check Python Dependencies

on:
pull_request:
merge_group:
workflow_dispatch:

jobs:
check_dependencies:
runs-on: ubuntu-latest
if: false

strategy:
matrix:
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/ci-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,13 @@ jobs:
- name: Install system requirements
run: sudo apt update && sudo apt install -y libxmlsec1-dev

- name: Install pip
run: make pre-requirements

- name: Get pip cache dir
id: pip-cache-dir
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache pip dependencies
id: cache-dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install python dependencies
run: make dev-requirements
run: |
make dev-requirements
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: Static code analysis
run: make check-types
12 changes: 11 additions & 1 deletion .github/workflows/compile-python-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
with:
python-version: "3.12"

- name: install system requirements
run: |
sudo apt-get update && sudo apt-get install libmysqlclient-dev libxmlsec1-dev

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Run make compile-requirements
env:
PACKAGE: "${{ inputs.package }}"
Expand All @@ -48,7 +55,10 @@ jobs:
with:
branch: "${{ github.triggering_actor }}/compile-python-deps"
branch-suffix: short-commit-hash
add-paths: requirements
add-paths: |
requirements
pyproject.toml
uv.lock
commit-message: |
feat: Recompile Python dependencies

Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache pip dependencies
id: cache-dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/base.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install Required Python Dependencies
run: |
make base-requirements
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: Install npm
run: npm ci
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/lint-imports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,13 @@ jobs:
- name: Install system requirements
run: sudo apt update && sudo apt install -y libxmlsec1-dev

- name: Install pip
run: make pre-requirements

- name: Get pip cache dir
id: pip-cache-dir
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache pip dependencies
id: cache-dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install python dependencies
run: make dev-requirements
run: |
make dev-requirements
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

# As long there are sub-projects[1] in openedx-platform, we analyze each
# project separately here, in order to make import-linting errors easier
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/migrations-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,21 @@ jobs:
sudo apt-get update
make ubuntu-requirements

- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache pip dependencies
id: cache-dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install Python dependencies
run: |
make dev-requirements
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
if [[ "${{ matrix.django-version }}" != "pinned" ]]; then
pip install "django~=${{ matrix.django-version }}.0"
pip check # fail if this test-reqs/Django combination is broken
uv pip install "django~=${{ matrix.django-version }}.0"
uv pip check # fail if this test-reqs/Django combination is broken
fi

- name: list installed package versions
run: |
sudo pip freeze
uv pip freeze

- name: Run Tests
env:
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/pylint-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,18 @@ jobs:
with:
python-version: 3.12

- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache pip dependencies
id: cache-dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install required Python dependencies
run: |
# dev-requirements is needed because the linter will otherwise
# trip over some dev-only things like django-debug-toolbar
# (import debug_toolbar) that aren't in testing.txt.
# (import debug_toolbar) that aren't in the testing group.
make dev-requirements
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
# After all requirements are installed, check that they're consistent with each other
pip check
uv pip check

- name: Run quality tests
run: |
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,21 @@ jobs:
- name: Setup npm
run: npm i -g npm@8.5.x

- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache pip dependencies
id: cache-dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/testing.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install Required Python Dependencies
env:
PIP_SRC: ${{ runner.temp }}
run: |
make test-requirements
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: Install npm
env:
PIP_SRC: ${{ runner.temp }}
run: npm ci

- name: Install python packages
env:
PIP_SRC: ${{ runner.temp }}
run: |
pip install -e .

- name: Run Quality Tests
env:
PIP_SRC: ${{ runner.temp }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ jobs:
with:
python-version: "${{ matrix.python-version }}"

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install semgrep
run: |
make pre-requirements
pip-sync requirements/edx/semgrep.txt
uv sync --only-group semgrep --frozen
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: Run semgrep
env:
Expand Down
30 changes: 5 additions & 25 deletions .github/workflows/static-assets-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,13 @@ jobs:
- name: Setup npm
run: npm i -g npm@${{ matrix.npm-version }}

- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache pip dependencies
id: cache-dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install Limited Python Deps for Build
- name: Install Python Deps for Build and Collection
run: |
# Install pip-tools.txt first to pin setuptools<82 before installing
# assets.txt. setuptools 82+ removed pkg_resources, which pyfilesystem2
# (fs) still uses for namespace package declarations. The constraints.txt
# pin covers full installs, but this step only installs assets.txt so we
# pre-install pip-tools.txt to ensure setuptools 81.x is in place.
# See: https://github.com/PyFilesystem/pyfilesystem2/issues/577
pip install -r requirements/pip-tools.txt
pip install -r requirements/edx/assets.txt
uv sync --group assets --frozen
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: Add node_modules bin to $Path
run: echo $GITHUB_WORKSPACE/node_modules/.bin >> $GITHUB_PATH
Expand All @@ -97,10 +81,6 @@ jobs:
npm clean-install
npm run build

- name: Install Full Python Deps for Collection
run: |
pip install -r requirements/edx/base.txt -e .

- name: Check Assets Collection
env:
LMS_CFG: lms/envs/minimal.yml
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: install requirements
run: |
make test-requirements
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
if [[ "${{ matrix.django-version }}" != "pinned" ]]; then
pip install "django~=${{ matrix.django-version }}.0"
pip check # fail if this test-reqs/Django combination is broken
uv pip install "django~=${{ matrix.django-version }}.0"
uv pip check # fail if this test-reqs/Django combination is broken
fi

- name: list installed package versions
run: |
pip freeze
uv pip freeze

- name: set settings path
shell: bash
Expand Down Expand Up @@ -172,9 +176,13 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install libxmlsec1-dev

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: install requirements
run: |
make test-requirements
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

- name: collect tests from all modules
shell: bash
Expand Down Expand Up @@ -307,7 +315,7 @@ jobs:

- name: Install Python dependencies
run: |
pip install -r requirements/edx/coverage.txt
pip install coverage diff-cover

- name: Run coverage
run: |
Expand Down
Loading
Loading