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
6 changes: 0 additions & 6 deletions .coveragerc

This file was deleted.

17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,31 @@ on:
pull_request:
branches:
- '**'
workflow_call:
jobs:
run_tests:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
python-version: ['3.12']
toxenv: [django42, django52, quality]
name: ${{ matrix.toxenv }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Python setup
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
- name: Setup uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Install Requirements
run: |
pip install -r requirements/pip.txt
pip install -r requirements/ci.txt
- name: Install CI dependencies
run: uv sync --group ci

- name: Run Tests
run: tox -e ${{ matrix.toxenv }}
run: uv run tox -e ${{ matrix.toxenv }}

- name: Upload coverage to CodeCov
if: matrix.python-version == '3.12' && matrix.toxenv == 'django42'
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/pypi-publish.yml

This file was deleted.

71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Semantic Release

on:
push:
branches:
- master

jobs:
run_tests:
uses: ./.github/workflows/ci.yml
secrets: inherit
permissions:
contents: read

release:
needs: run_tests
if: github.ref_name == 'master'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-release
cancel-in-progress: false

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.ref_name }}

- name: Reset to triggered commit
run: git reset --hard ${{ github.sha }}

- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@350c48fcb3ffcdfd2e0a235206bc2ecea6b69df0 # v10.5.3
with:
git_committer_name: "github-actions[bot]"
git_committer_email: "github-actions[bot]@users.noreply.github.com"
changelog: "true"

- name: Upload dist artifacts
if: steps.release.outputs.released == 'true'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: dist
path: dist/

outputs:
released: ${{ steps.release.outputs.released }}
version: ${{ steps.release.outputs.version }}

publish_to_pypi:
needs: release
if: needs.release.outputs.released == 'true'
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- name: Download dist artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Change history for XBlock SDK

These are notable changes in XBlock.

.. changelog-insertion-marker

0.13.0 - 2025-04-08
-------------------
* upgraded to Ubuntu 24.04 and Python 3.12
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ include AUTHORS
include CHANGELOG.rst
include LICENSE.txt
include README.rst
include requirements/base.in
include requirements/test.in
include requirements/test.txt
include requirements/constraints.txt
38 changes: 8 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,52 +44,30 @@ clean: ## remove generated byte code, coverage reports, and build artifacts
rm -f .coverage

coverage: clean ## generate and view HTML coverage report
pip install -qr requirements/local.txt --exists-action w ## Install sample xblocks
pytest --cov-report html
$(BROWSER) htmlcov/index.html

COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)"

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -qr requirements/pip-tools.txt
pip install -qr requirements/pip.txt
# Make sure to compile files after any other files they include!
pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -qr requirements/pip.txt
pip install -qr requirements/pip-tools.txt
pip-compile --rebuild --upgrade -o requirements/base.txt requirements/base.in
pip-compile --rebuild --upgrade -o requirements/test.txt requirements/test.in
pip-compile --rebuild --upgrade -o requirements/quality.txt requirements/quality.in
pip-compile --rebuild --upgrade -o requirements/ci.txt requirements/ci.in
pip-compile --rebuild --upgrade -o requirements/dev.txt requirements/test.in requirements/quality.in
# Let tox control the Django version for tests
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt
upgrade: ## update uv.lock and regenerate uv constraint-dependencies
uv run --with edx-lint edx_lint write_uv_constraints pyproject.toml
uv lock --upgrade

quality: ## check coding style with pycodestyle and pylint
tox -e quality
uv run tox -e quality

requirements: ## install development environment requirements
pip install -qr requirements/dev.txt --exists-action w
pip install -qr requirements/local.txt --exists-action w
uv sync --group dev

install: requirements

test: clean ## run tests in the current virtualenv
pip install -qr requirements/local.txt --exists-action w ## Install sample xblocks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local dependency group is missing in the pyproject.toml
its also missing here while testing.
Is this intentional?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed intentional on the dependency-group side: the old requirements/local.txt only did -e . (installing the package itself), and [tool.uv] package = true in pyproject.toml means every uv sync already installs this package in editable mode -- so there's no need for a separate "local" group.

But the Makefile line itself (now at line 47, shifted since your comment) is a live bug, not just a stale reference: requirements/local.txt no longer exists in this PR at all (confirmed -- the whole requirements/ dir is deleted), so make coverage fails outright today.

Suggested change
pip install -qr requirements/local.txt --exists-action w ## Install sample xblocks

(deletes just that one pip install line -- pytest --cov-report html right below already runs against whatever's installed via uv sync, no separate install step needed.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The local group is intentionally absent. The old requirements/local.txt only contained -e . (install the package in editable mode), which is now
handled automatically by package = true in [tool.uv] — every uv sync call installs the package in editable mode without a separate group.

pytest
uv run pytest

diff_cover: test
diff-cover coverage.xml

test-all: ## run tests on every supported Python/Django combination
tox -e quality
tox
uv run tox -e quality
uv run tox

validate: quality test ## run tests and quality checks

Expand Down
Loading
Loading