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
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,41 @@ on:
push:
branches: [master]
pull_request:
branches:
- '**'
branches: ['**']
workflow_call:

jobs:
run_tests:
name: Tests
name: ${{ matrix.toxenv }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.12']
toxenv: [python, quality]
toxenv: [py312, quality]

steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt
- name: Setup uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
python-version: "${{ matrix.python-version }}"

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

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
GITHUB_TOKEN: 'token'
run: tox
run: uv run --locked tox -e ${{ matrix.toxenv }}

- name: Run Coverage
if: matrix.python-version == '3.12' && matrix.toxenv=='python'
if: matrix.python-version == '3.12' && matrix.toxenv == 'py312'
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.class
*.pyc
*.egg-info/*
**/*.egg-info/*

# Mobile Tools for Java (J2ME)
.mtj.tmp/
Expand Down
8 changes: 3 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
include CHANGELOG.rst
include LICENSE.txt
include README.rst
include requirements/base.in
recursive-include repo_health *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py
recursive-include repo_health_dashboard *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py
recursive-include scripts *.py
include requirements/constraints.txt
recursive-include src/repo_health *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py
recursive-include src/repo_health_dashboard *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg *.py
recursive-include src/scripts *.py
41 changes: 8 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean diff-cover docs help quality requirements test upgrade
.PHONY: clean diff_cover docs help quality requirements test upgrade


.DEFAULT_GOAL := help
Expand All @@ -18,49 +18,24 @@ clean: ## remove generated byte code, coverage reports, and build artifacts
rm -fr build/
rm -fr dist/
rm -fr *.egg-info

coverage erase

docs: ## generate Sphinx HTML documentation, including API docs
tox -v -e docs
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)

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 "$(@)"
echo "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@)

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files satisfying requirements/*.in
sed 's/Django<4.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
pip install -qr requirements/pip-tools.txt
$(PIP_COMPILE) --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in
$(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
# 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 the edx_lint-managed uv constraints and the uv.lock file
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

requirements: ## install development environment requirements
pip install -qr requirements/pip.txt
pip install -qr requirements/pip-tools.txt
pip-sync requirements/dev.txt requirements/private.*
uv sync --group dev

test: clean ## run tests in the current virtualenv
tox
tox -e py312

diff_cover: test ## find diff lines that need test coverage
diff-cover coverage.xml
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The following describes the repo health pipeline that currently uses ``edx-repo-

.. _org-repo-health-report: https://tools-edx-jenkins.edx.org/job/RepoHealth/job/org-repo-health-report/
.. _org-repo-health-report job definition: https://github.com/edx/jenkins-job-dsl-internal/blob/master/jobs/tools-edx-jenkins.edx.org/createRepoHealthJobs.groovy
.. _repo_health_dashboard script: https://github.com/openedx/edx-repo-health/blob/master/repo_health_dashboard/repo_health_dashboard.py
.. _repo_health_dashboard script: https://github.com/openedx/edx-repo-health/blob/master/src/repo_health_dashboard/repo_health_dashboard.py
.. _repo-health-data: https://github.com/openedx/repo-health-data
.. _Repo Health Dashboard: https://docs.google.com/spreadsheets/d/1VCxNVq-niT-uv5BFmsYPF21r6I2-IQ-GJbidF0zUPBc/edit#gid=921158295

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath("../repo_health"))
sys.path.insert(0, os.path.abspath("../src/repo_health"))
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down
4 changes: 2 additions & 2 deletions docs/dashboard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `repo_health_dashboard`_ script is meant to aggregate data from runs of `pyt
repos. It aggregates the data from yaml outputs, flattens it, and outputs it in csv form.


.. _repo_health_dashboard: https://github.com/openedx/edx-repo-health/blob/master/repo_health_dashboard/repo_health_dashboard.py
.. _repo_health_dashboard: https://github.com/openedx/edx-repo-health/blob/master/src/repo_health_dashboard/repo_health_dashboard.py
.. _pytest-repo-health: https://github.com/openedx/pytest-repo-health

How to use
Expand All @@ -31,5 +31,5 @@ Options:

see example: `configuration.yaml`_

.. _configuration.yaml: https://github.com/openedx/edx-repo-health/blob/master/repo_health_dashboard/configuration.yaml
.. _configuration.yaml: https://github.com/openedx/edx-repo-health/blob/master/src/repo_health_dashboard/configuration.yaml

133 changes: 133 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
[build-system]
requires = ["setuptools", "setuptools-scm>8.1"]
build-backend = "setuptools.build_meta"

[project]
name = "edx-repo-health"
dynamic = ["version"]
description = "A set of checks of the health of repositories."
readme = "README.rst"
license = "Apache-2.0"
license-files = ["LICENSE.txt"]
requires-python = ">=3.12"
authors = [
{ name = "edX", email = "oscm@edx.org" },
]
keywords = ["Django", "edx"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"dockerfile",
"github-py @ git+https://github.com/ShineyDev/github.py.git@8e3514010eb35a91e012f2935f48138b3c35cef6",
"gspread<5.12.0",
"pytest-asyncio",
"pytest-repo-health",
"pyyaml",
"toml",
]

[project.urls]
Homepage = "https://github.com/openedx/edx-repo-health"

[project.scripts]
repo_health_dashboard = "repo_health_dashboard.repo_health_dashboard:main"
run_checks = "scripts.run_checks:main"

[tool.setuptools_scm]
version_scheme = "only-version"
local_scheme = "no-local-version"
fallback_version = "0.0.0.dev0"

[tool.setuptools.packages.find]
where = ["src"]
include = ["repo_health*", "repo_health_dashboard*", "scripts*"]
exclude = ["*.tests", "*.tests.*"]

[tool.setuptools.package-data]
"repo_health_dashboard" = ["*.yaml"]

[tool.setuptools.exclude-package-data]
"*" = ["tests*", "*.tests*"]

[tool.coverage.run]
source_pkgs = ["repo_health"]
omit = ["*/tests/*", "*/__pycache__/*"]

[tool.coverage.report]
show_missing = true
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.coverage.html]
directory = "htmlcov"

[dependency-groups]
test-base = [
"pytest-cov",
"responses",
]
test = [{include-group = "test-base"}]
quality = [
{include-group = "test"},
"django",
"edx-lint",
"isort",
"pycodestyle",
"pydocstyle",
]
doc = [
{include-group = "test"},
"build",
"doc8",
"readme-renderer",
"sphinx",
"sphinx-book-theme",
"twine",
]
ci = ["tox", "tox-uv>=1"]
dev = [
{include-group = "quality"},
{include-group = "doc"},
{include-group = "ci"},
"diff-cover",
"rich",
]

[tool.edx_lint]
uv_constraints = [
"cachetools==5.5.2",
"gspread<5.12.0",
"pytest<8.1.0",
"setuptools==70.3.0",
]

[tool.uv]
package = true
default-groups = []
# DO NOT EDIT constraint-dependencies DIRECTLY.
# This list is managed by `edx_lint write_uv_constraints`
# and will be overwritten the next time `make upgrade` is run.
# - GLOBAL constraints: edit edx_lint/files/common_constraints.txt
# - REPO-SPECIFIC constraints: edit [tool.edx_lint].uv_constraints in this file
constraint-dependencies = [
"Django<6.0",
"elasticsearch<7.14.0",
"social-auth-app-django<6.0.0",
"social-auth-core<5.0.0",
"pip<=26.2.2",
"cachetools==5.5.2",
"gspread<5.12.0",
"pytest<8.1.0",
"setuptools==70.3.0",
]
10 changes: 0 additions & 10 deletions requirements/base.in

This file was deleted.

Loading
Loading