From 063e7944c2409e3e447570c450269fcf7c230c3f Mon Sep 17 00:00:00 2001 From: Tobias Macey Date: Wed, 29 Apr 2026 09:22:48 -0400 Subject: [PATCH 1/2] Configure bump-my-version for Concourse release pipeline - Add bump-my-version configuration to pyproject.toml with CalVer format - Track version in pyproject.toml [project] section - Track version in uv.lock - Replace test_semantic_version with test_bump_my_version_format Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- main/settings.py | 7 +------ main/settings_test.py | 17 +++++++++++------ pyproject.toml | 35 ++++++++++++++++++++++++++++++++++- uv.lock | 21 ++++----------------- 4 files changed, 50 insertions(+), 30 deletions(-) diff --git a/main/settings.py b/main/settings.py index 5205a798d6..402f9bcf11 100644 --- a/main/settings.py +++ b/main/settings.py @@ -37,7 +37,7 @@ from main.sentry import init_sentry from openapi.settings_spectacular import open_spectacular_settings -VERSION = "1.149.1" +VERSION = "2026.4.16.1" log = logging.getLogger() @@ -1203,11 +1203,6 @@ default="/home", description="The suffix (with leading slash) to append to a course URL.", ) -OL_OPENEDX_COURSE_OUTLINE_URL = get_string( - name="OL_OPENEDX_COURSE_OUTLINE_URL", - default="/api/ol-course-outline/v0/{course_id}/", - description="Path template for Open edX course outline plugin endpoint.", -) OPENEDX_BASE_REDIRECT_URL = get_string( name="OPENEDX_BASE_REDIRECT_URL", diff --git a/main/settings_test.py b/main/settings_test.py index 6c1186ac0d..6dacfddff7 100644 --- a/main/settings_test.py +++ b/main/settings_test.py @@ -5,8 +5,10 @@ import sys from types import SimpleNamespace +import re +import tomllib + import pytest -import semantic_version from django.core import mail from django.core.exceptions import ImproperlyConfigured from mitol.common import envs @@ -161,8 +163,11 @@ def test_db_ssl_enable(monkeypatch, settings_sandbox): assert settings_vars["DATABASES"]["default"]["OPTIONS"] == {"sslmode": "require"} -def test_semantic_version(settings): - """ - Verify that we have a semantic compatible version. - """ - semantic_version.Version(settings.VERSION) +def test_bump_my_version_format(settings): + """Verify that VERSION matches the bump-my-version calver format.""" + with open("pyproject.toml", "rb") as f: # noqa: PTH123 + pyproject = tomllib.load(f) + version_pattern = pyproject["tool"]["bumpversion"]["parse"] + package_version = pyproject["project"]["version"] + assert settings.VERSION == package_version + assert re.fullmatch(version_pattern, settings.VERSION) diff --git a/pyproject.toml b/pyproject.toml index b2dd16f35c..bfa211ed9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mitxonline" -version = "0.69.1" +version = "2026.4.16.1" description = "MITx Online" authors = [{ name = "MIT ODL" }] requires-python = "~=3.11.0" @@ -251,3 +251,36 @@ fixture-parentheses = false "*_test.py" = ["ARG001", "E501", "S101", "PLR2004"] "test_*.py" = ["ARG001", "E501", "S101", "PLR2004"] "**/migrations/**" = ["ARG001", "D101", "D100"] + +[tool.bumpversion] +commit = false +tag = false +parse = "(?P(?:[1-9][0-9]{3})\\.(?:1[0-2]|[1-9])\\.(?:3[0-1]|[12][0-9]|[1-9]))\\.(?P\\d+)" +serialize = ["{release}.{build}"] + +[tool.bumpversion.parts.release] +calver_format = "{YYYY}.{MM}.{DD}" + +[tool.bumpversion.parts.build] +first_value = "1" + +[[tool.bumpversion.files]] +filename = "main/settings.py" +search = 'VERSION = "{current_version}"' +replace = 'VERSION = "{new_version}"' + +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = 'version = "{current_version}"' +replace = 'version = "{new_version}"' + +[[tool.bumpversion.files]] +filename = "uv.lock" +search = """ +name = "mitxonline" +version = "{current_version}" +source = {{ virtual = "." }}""" +replace = """ +name = "mitxonline" +version = "{new_version}" +source = {{ virtual = "." }}""" diff --git a/uv.lock b/uv.lock index 048100565f..c1ab4fd85d 100644 --- a/uv.lock +++ b/uv.lock @@ -79,15 +79,14 @@ wheels = [ [[package]] name = "authlib" -version = "1.7.0" +version = "1.6.9" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cryptography" }, - { name = "joserfc" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/d9/82/4d0603f30c1b4629b1f091bb266b0d7986434891d6940a8c87f8098db24e/authlib-1.7.0.tar.gz", hash = "sha256:b3e326c9aa9cc3ea95fe7d89fd880722d3608da4d00e8a27e061e64b48d801d5", size = 175890, upload-time = "2026-04-18T11:00:28.559Z" } +sdist = { url = "https://files.pythonhosted.org/packages/af/98/00d3dd826d46959ad8e32af2dbb2398868fd9fd0683c26e56d0789bd0e68/authlib-1.6.9.tar.gz", hash = "sha256:d8f2421e7e5980cc1ddb4e32d3f5fa659cfaf60d8eaf3281ebed192e4ab74f04", size = 165134, upload-time = "2026-03-02T07:44:01.998Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ca/48/c954218b2a250e23f178f10167c4173fecb5a75d2c206f0a67ba58006c26/authlib-1.7.0-py2.py3-none-any.whl", hash = "sha256:e36817afb02f6f0b6bf55f150782499ddd6ddf44b402bb055d3263cc65ac9ae0", size = 258779, upload-time = "2026-04-18T11:00:26.64Z" }, + { url = "https://files.pythonhosted.org/packages/53/23/b65f568ed0c22f1efacb744d2db1a33c8068f384b8c9b482b52ebdbc3ef6/authlib-1.6.9-py2.py3-none-any.whl", hash = "sha256:f08b4c14e08f0861dc18a32357b33fbcfd2ea86cfe3fe149484b4d764c4a0ac3", size = 244197, upload-time = "2026-03-02T07:44:00.307Z" }, ] [[package]] @@ -1532,18 +1531,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/14/2f/967ba146e6d58cf6a652da73885f52fc68001525b4197effc174321d70b4/jmespath-1.1.0-py3-none-any.whl", hash = "sha256:a5663118de4908c91729bea0acadca56526eb2698e83de10cd116ae0f4e97c64", size = 20419, upload-time = "2026-01-22T16:35:24.919Z" }, ] -[[package]] -name = "joserfc" -version = "1.6.4" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cryptography" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/de/c6/de8fdbdfa75c8ca04fead38a82d573df8a82906e984c349d58665f459558/joserfc-1.6.4.tar.gz", hash = "sha256:34ce5f499bfcc5e9ad4cc75077f9278ab3227b71da9aaf28f9ab705f8a560d3c", size = 231866, upload-time = "2026-04-13T13:15:40.632Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b6/f7/210b27752e972edb36d239315b08d3eb6b14824cc4a590da2337d195260b/joserfc-1.6.4-py3-none-any.whl", hash = "sha256:3e4a22b509b41908989237a045e25c8308d5fd47ab96bdae2dd8057c6451003a", size = 70464, upload-time = "2026-04-13T13:15:39.259Z" }, -] - [[package]] name = "jsonschema" version = "4.26.0" @@ -1947,7 +1934,7 @@ wheels = [ [[package]] name = "mitxonline" -version = "0.69.1" +version = "2026.4.16.1" source = { virtual = "." } dependencies = [ { name = "authlib" }, From e46e2746f48b12d977f9e90e2b532571ee4dda5f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 13:25:06 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- main/settings_test.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main/settings_test.py b/main/settings_test.py index 6dacfddff7..6281b36150 100644 --- a/main/settings_test.py +++ b/main/settings_test.py @@ -2,13 +2,12 @@ Validate that our settings functions work """ +import re import sys from types import SimpleNamespace -import re -import tomllib - import pytest +import tomllib from django.core import mail from django.core.exceptions import ImproperlyConfigured from mitol.common import envs @@ -169,5 +168,5 @@ def test_bump_my_version_format(settings): pyproject = tomllib.load(f) version_pattern = pyproject["tool"]["bumpversion"]["parse"] package_version = pyproject["project"]["version"] - assert settings.VERSION == package_version + assert package_version == settings.VERSION assert re.fullmatch(version_pattern, settings.VERSION)