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
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_call:

jobs:
run_tests:
name: ${{ matrix.toxenv }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.12"]
toxenv: [quality, docs, py]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
enable-cache: true
python-version: "${{ matrix.python-version }}"
- run: uv sync --group ci
- run: uv run tox -e ${{ matrix.toxenv }}
- if: matrix.toxenv == 'py' && matrix.python-version == '3.12'
uses: codecov/codecov-action@e53489f4d376d79066609109e7a95a29eb3740b1 # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
16 changes: 10 additions & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
include CHANGELOG.rst
include LICENSE.txt
include README.rst
include requirements/base.in
recursive-include repo_tools_data_schema *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py
include requirements/constraints.txt
# Exclude development, test, and documentation folders
prune .github
prune docs
prune tests

# Exclude root level configuration and build files
exclude Makefile
exclude conftest.py
exclude .gitignore
exclude tox.ini
42 changes: 12 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean help quality requirements selfcheck upgrade
.PHONY: clean docs help quality requirements selfcheck upgrade

.DEFAULT_GOAL := help

Expand All @@ -16,40 +16,22 @@ clean: ## remove generated byte code, coverage reports, and build artifacts
rm -fr dist/
rm -fr *.egg-info

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

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 -r requirements/pip-tools.txt
# Make sure to compile files after any other files they include!
$(PIP_COMPILE) --allow-unsafe -o requirements/pip.txt requirements/pip.in
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -r 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 python dependencies
uv run --with edx-lint edx_lint write_uv_constraints pyproject.toml
uv lock --upgrade

docs: ## validate RST files
doc8 README.rst CHANGELOG.rst

quality: ## check coding style with pycodestyle and pylint
pylint repo_tools_data_schema *.py
pycodestyle repo_tools_data_schema *.py
isort --check-only --diff repo_tools_data_schema *.py
pylint repo_tools_data_schema
pycodestyle repo_tools_data_schema
isort --check-only --diff repo_tools_data_schema
make selfcheck

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

test: ## run the few tests we have
pytest
Expand Down
105 changes: 105 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "repo-tools-data-schema"
version = "2.0"
description = "Schema for repo-tools-data"
requires-python = ">=3.12"
license = "Apache-2.0"
license-files = ["LICENSE*"]
authors = [
{name = "Open edX Project", email = "oscm@openedx.org"},
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
]
keywords = ["Python", "edx"]
readme = "README.rst"

dependencies = [
"PyYAML",
"schema",
]

[project.urls]
Homepage = "https://github.com/openedx/repo-tools-data-schema"
Repository = "https://github.com/openedx/repo-tools-data-schema"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
exclude = ["tests*", "*.tests", "*.tests.*"]

[tool.setuptools.package-data]
"*" = [
"*.html",
"*.png",
"*.gif",
"*.js",
"*.css",
"*.jpg",
"*.jpeg",
"*.svg",
]

[tool.uv]
package = true
constraint-dependencies = [
"Django<6.0",
"elasticsearch<7.14.0",
]

[tool.edx_lint]
uv_constraints = []

[dependency-groups]
test = [
"pytest-cov",
]
quality = [
{include-group = "test"},
"edx-lint",
"isort",
"pycodestyle",
]
doc = [
{include-group = "test"},
"doc8",
"readme-renderer",
"Sphinx",
"sphinx-book-theme",
]
ci = [
"tox",
"tox-uv",
]
dev = [
{include-group = "quality"},
{include-group = "ci"},
"diff-cover",
]

[tool.doc8]
max-line-length = 120

[tool.isort]
include_trailing_comma = true
indent = " "
line_length = 120
multi_line_output = 3

[tool.pytest.ini_options]
addopts = "--cov=repo_tools_data_schema --cov-report=xml"

[tool.coverage.run]
source = ["repo_tools_data_schema"]

[tool.coverage.report]

7 changes: 6 additions & 1 deletion repo_tools_data_schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Schema for repo-tools-data.
"""

__version__ = '2.0'
from importlib.metadata import PackageNotFoundError, version

from .repo_tools_data_schema import validate_orgs, validate_salesforce_export

try:
__version__ = version("repo-tools-data-schema")
except PackageNotFoundError:
__version__ = "unknown"
5 changes: 0 additions & 5 deletions requirements/base.in

This file was deleted.

10 changes: 0 additions & 10 deletions requirements/base.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements/ci.in

This file was deleted.

34 changes: 0 additions & 34 deletions requirements/ci.txt

This file was deleted.

31 changes: 0 additions & 31 deletions requirements/common_constraints.txt

This file was deleted.

11 changes: 0 additions & 11 deletions requirements/constraints.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements/dev.in

This file was deleted.

Loading
Loading