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
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: daily
- package-ecosystem: "uv" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: daily
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Codecov
on:
pull_request:
paths:
- 'my_pkg/**' # todo: change my_pkg to the name of the package
- 'tests/**'
- '.github/workflows/codecov.yml'
push:
branches:
- main
workflow_dispatch:
jobs:
upload-coverage-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- run: uv python install 3.11
- run: make
- run: make coverage
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish docs GH Pages
on:
pull_request: # todo: remove this after testing
release:
types: [ published ]
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

jobs:

create-docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv python install 3.11

- run: make
- run: make doc

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
keep_files: true
7 changes: 1 addition & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ repos:
- id: trailing-whitespace
- id: no-commit-to-branch
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
rev: v0.11.4
hooks:
- id: ruff-format
args: [ --preview, --config=pyproject.toml ]
- id: ruff
args: [ --preview, --fix,--unsafe-fixes, --config=pyproject.toml ]

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.13
hooks:
- id: uv-lock
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the "docs/" directory with Sphinx

sphinx:
configuration: docs/source/conf.py
# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Set the OS, Python version, and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.12"
jobs:
post_install:
- pip install uv
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras --group docs --link-mode=copy
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ check:
uv run pre-commit run --all-files

coverage:
uv run pytest --cov=ml_orchestrator --cov-report=xml
uv run pytest --cov=my_pkg --cov-report=xml # todo: change my_pkg to the actual package name

mypy:
uv tool run mypy . --config-file pyproject.toml
uv tool run mypy my_pkg --config-file pyproject.toml # todo: chanege my_pkg to the actual package name

doc:
uv run sphinx-build -M html docs/source docs/build/
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
45 changes: 45 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import os
import sys
from importlib.metadata import version

sys.path.insert(0, os.path.abspath("../../"))
# sys.path.insert(0, os.path.abspath("./")) # in conf.py


project = "python-template" # todo: change this to your project name
version = version("my-pkg") # todo: change my-pkg to your package name
release = version

copyright = "2025, DanielAvdar" # noqa todo: change this to your name
author = "DanielAvdar" # todo: change this to your name

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.autodoc", # Core extension for pulling docstrings
"sphinx.ext.napoleon", # Support for Google and NumPy style docstrings
"sphinx.ext.viewcode", # Add links to source code
"sphinx.ext.githubpages", # If deploying to GitHub Pages
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
]

templates_path = ["_templates"]
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
master_doc = "index"
html_static_path = ["_static"]
16 changes: 16 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. python-template documentation master file, created by
sphinx-quickstart on Wed Apr 9 13:29:29 2025.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

python-template documentation
=============================

Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.


.. toctree::
:maxdepth: 2
:caption: Contents:
3 changes: 3 additions & 0 deletions my_pkg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from importlib.metadata import version

__version__ = version("my-pkg")
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ dev = [
"mypy==1.13.0",
"pytest-parametrization>=2022",
"ruff>=0.8.2",
"sybil[pytest]",
"sphinx>=8.2.0; python_version >= '3.11'",
"sphinx>=7.0.0; python_version < '3.11'",
"sphinx-rtd-theme>=3.0.2",
]

[tool.hatch.build.targets.sdist]
Expand Down Expand Up @@ -63,8 +67,3 @@ check_untyped_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
strict_optional = false


[[tool.mypy.overrides]]
module = "tests.*"
ignore_errors = true
2 changes: 2 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
def test_init():
from my_pkg import __version__ # noqa todo: change my_pkg to your package name

assert True
Loading