Skip to content

Commit d14f7b8

Browse files
authored
Merge pull request #340 from openedx/bmcril/upgrade_to_uv
build: Upgrade requirements to uv
2 parents 8d05760 + e8097fc commit d14f7b8

18 files changed

Lines changed: 2142 additions & 320 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Upgrade Python Requirements
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 1"
6+
workflow_dispatch:
7+
inputs:
8+
branch:
9+
description: "Target branch against which to create requirements PR"
10+
required: true
11+
# If copying this template manually, you must provide your default branch name
12+
# in quotes, such as 'master'
13+
default: "main"
14+
15+
jobs:
16+
call-upgrade-python-requirements-workflow:
17+
uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master
18+
with:
19+
# If copying manually, also provide your default branch name in quotes here
20+
branch: ${{ github.event.inputs.branch || 'main' }}
21+
# optional parameters below; fill in if you'd like github or email notifications
22+
# user_reviewers: ""
23+
# team_reviewers: "axim-engineering"
24+
# email_address: "aximimprovements@axim.org"
25+
# send_success_notification: false
26+
secrets:
27+
requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
28+
requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}
29+
edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }}
30+
edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ docs/_build
33
.DS_Store
44
source/.DS_Store
55
.idea/
6-
.python-version
6+
.python-version
7+
.venv/
8+
*.pyc
9+
__pycache__/

.readthedocs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ build:
2121
# Optionally set the version of Python and requirements required to build your docs
2222
python:
2323
install:
24-
- requirements: requirements/docs.txt
24+
- method: pip
25+
path: .

Makefile

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,22 @@ help:
1313
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1414
@awk -F ':.*?## ' '/^[a-zA-Z]/ && NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
1515

16-
.PHONY: help Makefile upgrade requirements
17-
18-
# Define PIP_COMPILE_OPTS=-v to get more information during make upgrade.
19-
PIP_COMPILE = pip-compile --upgrade $(PIP_COMPILE_OPTS)
20-
21-
upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
22-
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
23-
pip install -r requirements/pip-tools.txt
24-
# Make sure to compile files after any other files they include!
25-
$(PIP_COMPILE) --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
26-
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in
27-
pip install -r requirements/pip-tools.txt
28-
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in
29-
$(PIP_COMPILE) -o requirements/docs.txt requirements/docs.in
30-
31-
requirements:
32-
pip install -r requirements/pip-tools.txt
33-
pip-sync requirements/base.txt
34-
35-
serve_docs:
36-
sphinx-autobuild -W docs/ docs/_build/html/
37-
38-
# Emulate the build step on RTD to flush out errors ahead pushing
39-
check_docs:
40-
sphinx-build -T -E -W --keep-going docs/ docs/_build/html
16+
.PHONY: help Makefile upgrade requirements install
17+
18+
sync-constraints: ## download and sync common_constraints.txt to pyproject.toml
19+
uv run python sync_constraints.py
20+
21+
upgrade: sync-constraints
22+
uv lock --upgrade
23+
24+
requirements: ## install dependencies using uv
25+
uv sync
26+
27+
serve_docs: ## serve documentation locally with auto-reload
28+
uv run sphinx-autobuild -W docs/ docs/_build/html/
29+
30+
check_docs: ## emulate the build step on RTD to flush out errors ahead pushing
31+
uv run sphinx-build -T -E -W --keep-going docs/ docs/_build/html
4132

4233
# Catch-all target: route all unknown targets to Sphinx using the new
4334
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

33
Learner analytics for Open edX!
44

5+
## Development Setup
6+
7+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management. To get started:
8+
9+
```bash
10+
# Install uv if you haven't already
11+
curl -LsSf https://astral.sh/uv/install.sh | sh
12+
13+
# Install dependencies
14+
make install
15+
16+
# Serve documentation locally
17+
make serve_docs
18+
19+
# Check documentation builds correctly
20+
make check_docs
21+
22+
# Upgrade dependencies
23+
make upgrade
24+
```
25+
526
## What is Aspects?
627

728
Aspects is an optional implementation of analytics for the Open edX LMS. It is the combined solution of Cairn by Overhang.io and the OARS project developed by Axim Collaborative with a huge amount of help from the Open edX community. Primarily it is intended to be a "batteries included" set of configurations and plugins to combine 3rd party tools into a powerful and flexible system for learner analytics.

pyproject.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[project]
2+
name = "openedx-aspects"
3+
version = "3.0.0"
4+
description = "Learner analytics documentation for Open edX"
5+
readme = "README.md"
6+
requires-python = ">=3.8"
7+
license = {text = "AGPL-3.0"}
8+
authors = [
9+
{name = "Axim Collaborative", email = "oscm@axim.org"},
10+
]
11+
classifiers = [
12+
"Development Status :: 5 - Production/Stable",
13+
"Intended Audience :: Developers",
14+
"License :: OSI Approved :: GNU Affero General Public License v3",
15+
"Operating System :: OS Independent",
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.8",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
]
23+
24+
dependencies = [
25+
"sphinx",
26+
"sphinx-book-theme",
27+
"sphinx-autobuild",
28+
"sphinx-copybutton",
29+
"sphinxcontrib-mermaid",
30+
"sphinxcontrib-contentui",
31+
]
32+
33+
[project.urls]
34+
Homepage = "https://docs.openedx.org/projects/openedx-aspects"
35+
Documentation = "https://docs.openedx.org/projects/openedx-aspects"
36+
Repository = "https://github.com/openedx/openedx-aspects"
37+
"Issue Tracker" = "https://github.com/openedx/openedx-aspects/issues"
38+
39+
[tool.uv]
40+
constraint-dependencies = [
41+
# Downloaded from edx-lint common_constraints.txt
42+
# DO NOT EDIT - Use 'python sync_constraints.py' to update
43+
"Django<6.0",
44+
"elasticsearch<7.14.0",
45+
# Local constraint
46+
"greenlet>3.0.1", # playwright and sqlalchemy requirements conflict for greenlet<=3.0.1
47+
]
48+
# Common constraints from edx-lint
49+
override-dependencies = [
50+
"Django<6.0", # using LTS django version
51+
"elasticsearch<7.14.0", # 7.14.0+ contains breaking changes
52+
]

requirements/base.in

Lines changed: 0 additions & 12 deletions
This file was deleted.

requirements/base.txt

Lines changed: 0 additions & 109 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# A central location for most common version constraints
2+
# (across edx repos) for pip-installation.
3+
#
4+
# Similar to other constraint files this file doesn't install any packages.
5+
# It specifies version constraints that will be applied if a package is needed.
6+
# When pinning something here, please provide an explanation of why it is a good
7+
# idea to pin this package across all edx repos, Ideally, link to other information
8+
# that will help people in the future to remove the pin when possible.
9+
# Writing an issue against the offending project and linking to it here is good.
10+
#
11+
# Note: Changes to this file will automatically be used by other repos, referencing
12+
# this file from Github directly. It does not require packaging in edx-lint.
13+
14+
# using LTS django version
15+
Django<6.0
16+
17+
# elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process.
18+
# elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html
19+
# See https://github.com/openedx/edx-platform/issues/35126 for more info
20+
elasticsearch<7.14.0

requirements/constraints.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)