Skip to content
Draft
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.

45 changes: 25 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,41 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:

jobs:
run_tests:
name: tests
name: ${{ matrix.toxenv }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.12' ]
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for pushing data to the
# python-coverage-comment-action branch, and for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
python-version: ["3.12"]
toxenv:
- py312
- quality
- mypy
- docs

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: setup python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0

- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
python-version: "${{ matrix.python-version }}"

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

- name: Install Dependencies
run: pip install -r requirements/ci.txt
- name: Run tox
run: uv run tox -e ${{ matrix.toxenv }}

- name: Run Tests
run: tox
- name: Upload coverage to Codecov
if: matrix.toxenv == 'py312'
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
11 changes: 9 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ version: 2
sphinx:
configuration: docs/conf.py

build:
os: "ubuntu-lts-latest"
tools:
python: "3.12"

python:
version: 3.12
install:
- requirements: requirements/doc.txt
- method: pip
path: .
extra_requirements:
- docs
4 changes: 1 addition & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
include CHANGELOG.rst
include LICENSE.txt
include README.rst
include requirements/base.in
include requirements/constraints.txt
recursive-include xapi-db-load *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.csv
recursive-include xapi_db_load *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.csv
46 changes: 16 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: clean compile_translations coverage diff_cover docs dummy_translations \
extract_translations fake_translations help \
quality requirements selfcheck test test-all upgrade validate
mypy quality requirements selfcheck test test-all upgrade validate

.DEFAULT_GOAL := help

Expand All @@ -26,52 +26,38 @@ coverage: clean ## generate and view HTML coverage report
$(BROWSER)htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
tox -e docs
uv run tox -e docs
$(BROWSER)docs/_build/html/index.html

# Define PIP_COMPILE_OPTS=-v to get more information during make upgrade.
PIP_COMPILE = pip-compile --upgrade $(PIP_COMPILE_OPTS)

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -r requirements/pip-tools.txt
pip install -qr requirements/pip.txt
# Make sure to compile files after any other files they include!
$(PIP_COMPILE) --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -qr requirements/pip.txt
pip install -r requirements/pip-tools.txt
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in
$(PIP_COMPILE) -o requirements/test.txt requirements/test.in
$(PIP_COMPILE) -o requirements/doc.txt requirements/doc.in
$(PIP_COMPILE) -o requirements/quality.txt requirements/quality.in
$(PIP_COMPILE) -o requirements/ci.txt requirements/ci.in
$(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in
upgrade: ## update the uv.lock file with the latest packages satisfying pyproject.toml
uv run --with edx-lint edx_lint write_uv_constraints pyproject.toml
uv lock --upgrade

quality: ## check coding style with pycodestyle and pylint
pylint xapi_db_load *.py
pycodestyle xapi_db_load *.py
pydocstyle xapi_db_load *.py
pylint --ignore=tests xapi_db_load
pycodestyle xapi_db_load
pydocstyle xapi_db_load
mypy xapi_db_load
isort --check-only --diff --recursive xapi_db_load *.py test_settings.py
python setup.py bdist_wheel
isort --check-only --diff xapi_db_load
python -m build
twine check dist/*
make selfcheck

mypy: ## run mypy type checking
uv run tox -e mypy

requirements: ## install development environment requirements
pip install -r requirements/pip.txt
pip install -r requirements/pip-tools.txt
pip-sync requirements/dev.txt requirements/private.*
uv sync --group dev
uv tool install tox --with tox-uv

test: clean ## run tests in the current virtualenv
pytest

diff_cover: test ## find diff lines that need test coverage
diff-cover coverage.xml

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

validate: quality test ## run tests and quality checks

Expand Down
23 changes: 3 additions & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,16 @@
serve to show the default.
"""
import os
import re
import sys
from datetime import datetime, UTC
from datetime import UTC, datetime
from importlib.metadata import version as get_version
from subprocess import check_call


def get_version(*file_paths):
"""
Extract the version string from the file.

Input:
- file_paths: relative path fragments to file with
version string
"""
filename = os.path.join(os.path.dirname(__file__), *file_paths)
version_file = open(filename, encoding="utf8").read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")


REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(REPO_ROOT)

VERSION = get_version("../xapi_db_load", "__init__.py")
VERSION = get_version("xapi-db-load")


# If extensions (or modules to document with autodoc) are in another directory,
Expand Down Expand Up @@ -187,7 +171,6 @@ def get_version(*file_paths):
"repository_url": "https://github.com/openedx/xapi-db-load",
"repository_branch": "main",
"path_to_docs": "docs/",
"logo_only": True,
"home_page_in_toc": True,
"use_repository_button": True,
"use_issues_button": True,
Expand Down
35 changes: 0 additions & 35 deletions docs/xapi_db_load.backends.rst
Original file line number Diff line number Diff line change
@@ -1,41 +1,6 @@
xapi\_db\_load.backends package
===============================

Submodules
----------

xapi\_db\_load.backends.citus\_lake module
------------------------------------------

.. automodule:: xapi_db_load.backends.citus_lake
:members:
:undoc-members:
:show-inheritance:

xapi\_db\_load.backends.clickhouse\_lake module
-----------------------------------------------

.. automodule:: xapi_db_load.backends.clickhouse_lake
:members:
:undoc-members:
:show-inheritance:

xapi\_db\_load.backends.mongo\_lake module
------------------------------------------

.. automodule:: xapi_db_load.backends.mongo_lake
:members:
:undoc-members:
:show-inheritance:

xapi\_db\_load.backends.ralph\_lrs module
-----------------------------------------

.. automodule:: xapi_db_load.backends.ralph_lrs
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

Expand Down
11 changes: 3 additions & 8 deletions docs/xapi_db_load.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Subpackages
:maxdepth: 4

xapi_db_load.backends
xapi_db_load.fixtures
xapi_db_load.tests
xapi_db_load.ui
xapi_db_load.xapi

Submodules
Expand All @@ -21,14 +24,6 @@ xapi\_db\_load.course\_configs module
:undoc-members:
:show-inheritance:

xapi\_db\_load.generate\_load module
------------------------------------

.. automodule:: xapi_db_load.generate_load
:members:
:undoc-members:
:show-inheritance:

xapi\_db\_load.main module
--------------------------

Expand Down
19 changes: 0 additions & 19 deletions openedx.yaml

This file was deleted.

27 changes: 24 additions & 3 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# SERIOUSLY.
#
# ------------------------------
# Generated by edx-lint version: 5.3.0
# Generated by edx-lint version: 6.1.0
# ------------------------------
[MASTER]
ignore = migrations
Expand Down Expand Up @@ -259,6 +259,7 @@ enable =
useless-suppression,
disable =
bad-indentation,
broad-exception-raised,
consider-using-f-string,
duplicate-code,
file-ignored,
Expand Down Expand Up @@ -288,6 +289,26 @@ disable =
logging-fstring-interpolation,
consider-using-with,
bad-option-value,
abstract-method,
arguments-differ,
missing-class-docstring,
attribute-defined-outside-init,
unused-argument,
unused-variable,
line-too-long,
broad-exception-caught,
super-with-arguments,
too-many-positional-arguments,
redefined-builtin,
use-implicit-booleaness-not-len,
consider-using-sys-exit,
consider-using-generator,
use-a-generator,
chained-comparison,
consider-using-in,
import-outside-toplevel,
use-list-literal,
consider-using-enumerate,

[REPORTS]
output-format = text
Expand Down Expand Up @@ -382,6 +403,6 @@ ext-import-graph =
int-import-graph =

[EXCEPTIONS]
overgeneral-exceptions = Exception
overgeneral-exceptions = builtins.Exception

# 48c3d6307c06374a19e66f30d8c6cdcbd3421ae3
# 4973a70539efa69f38de8a39d9d0181f6a74e953
20 changes: 20 additions & 0 deletions pylintrc_tweaks
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,23 @@ load-plugins = edx_lint.pylint,pylint_celery
disable+ =
consider-using-with,
bad-option-value,
abstract-method,
arguments-differ,
missing-class-docstring,
attribute-defined-outside-init,
unused-argument,
unused-variable,
line-too-long,
broad-exception-caught,
super-with-arguments,
too-many-positional-arguments,
redefined-builtin,
use-implicit-booleaness-not-len,
consider-using-sys-exit,
consider-using-generator,
use-a-generator,
chained-comparison,
consider-using-in,
import-outside-toplevel,
use-list-literal,
consider-using-enumerate,
Loading