Skip to content
Merged
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
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
source = image

omit =
*/dist/*
*/containerimage_py.egg-info/*
*/doc/*
*/examples/*
*/tests/*
*/__pycache__/*
*/.pytest_cache/*
*/.git/*
*/.github/*
*/.tox/*

[html]
directory = test-results/coverage
4 changes: 2 additions & 2 deletions .github/workflows/doc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: doc
name: Doc

on: [push, pull_request, workflow_dispatch]

Expand All @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python3 -m pip install sphinx sphinx_rtd_theme myst_parser
make doc-dependencies
- name: Documentation build
run: |
make doc
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
push:
branches: '**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
# Install the python interpreters for running the test matrix
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9 -y
sudo apt install python3.9-distutils -y
sudo apt install python3.10 -y
sudo apt install python3.11 -y
sudo apt install python3.12 -y
sudo apt install python3.13 -y

# Install the python dependencies for running the tests
make test-dependencies

- name: Unit Test Matrix
run: |
# Run the unit test matrix
make test
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ dist

# PyTest
.pytest_cache
coverage.json
.coverage

# Sphinx
doc/sphinx
doc/sphinx

# Tox
.tox
24 changes: 22 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
.PHONY: doc

PYTHON ?= /usr/bin/python3

#########
# Testing recipes
#
# Install the required dependencies for the test recipe
test-dependencies:
$(PYTHON) -m pip install -r requirements.test.txt

# Execute the unit tests locally and in CI
test:
$(PYTHON) -m pytest -vv
$(PYTHON) -m tox

#######
# Build recipes
#
# Install the required dependencies for the build recipe
build-dependencies:
$(PYTHON) -m pip install -r requirements.build.txt

# Build the python distribution locally and in CI
build:
$(PYTHON) -m build

#####
# Doc recipes
#
# Install the required dependencies for the doc recipe
doc-dependencies:
$(PYTHON) -m pip install -r requirements.doc.txt

# Build the python docs locally and in CI
doc:
$(PYTHON) -m sphinx.ext.apidoc -o ./doc/source/image . "tests/*"
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ Homepage = "https://github.com/whatsacomputertho/containerimage-py"
Issues = "https://github.com/whatsacomputertho/containerimage-py/issues"

[project.optional-dependencies]
test = ["pytest-mock"]
test = ["tox","pytest","pytest-mock","pytest-cov"]
build = ["build"]
doc = ["sphinx","sphinx_rtd_theme"]
1 change: 1 addition & 0 deletions requirements.build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
3 changes: 3 additions & 0 deletions requirements.doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx
sphinx_rtd_theme
myst_parser
1 change: 1 addition & 0 deletions requirements.test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tox
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tox]
envlist = py39,py310,py311,py312,py313
[testenv]
# dependencies required for testing the module
deps =
pytest
pytest-mock
pytest-cov
# the command used to run the tests for the given python version
commands = pytest -vv --cov --cov-config=.coveragerc --cov-report=term --cov-report=json
Loading