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
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ on:
jobs:
test:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install base dependencies
- name: Install Project
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements-dev.txt
pip install -e .
pip install -e sphinx-plugin
uv sync --frozen --group test --group doc
uv pip install -e sphinx-plugin
- name: Test python-dispatch
run: |
py.test --cov --cov-config=.coveragerc tests pydispatch doc README.md
uv run pytest --cov --cov-config=.coveragerc tests pydispatch doc README.md
- name: Test python-dispatch-sphinx
run: |
py.test --cov --cov-append --cov-config=sphinx-plugin/.coveragerc sphinx-plugin/tests
uv run pytest --cov --cov-append --cov-config=sphinx-plugin/.coveragerc sphinx-plugin/tests
- name: Upload to Coveralls
run: coveralls --service=github
run: uv run coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}
Expand Down
66 changes: 41 additions & 25 deletions .github/workflows/dist-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,58 +19,74 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python-version: 3.11
- name: Build pydispatch dists
run: python setup.py sdist bdist_wheel
run: uv build
- name: Build pydispatch_sphinx dists
run: python setup.py sdist --dist-dir=$DISTDIR bdist_wheel --dist-dir=$DISTDIR
run: uv build --out-dir $DISTDIR
working-directory: ${{ github.workspace }}/sphinx-plugin
env:
DISTDIR: ${{ github.workspace }}/dist-sphinx
- name: Export pydispatch lockfile
run: uv export --frozen --no-emit-project --only-group test -o requirements.txt
- name: Export pydispatch_sphinx lockfile
run: uv export --frozen --no-emit-project --only-group test -o requirements.txt
working-directory: ${{ github.workspace }}/sphinx-plugin
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v5
with:
name: 'dists'
path: 'dist/*'
- name: Upload sphinx artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v5
with:
name: 'dists-sphinx'
path: 'dist-sphinx/*'
- name: Upload lockfiles
uses: actions/upload-artifact@v5
with:
name: 'lockfiles'
path: |
requirements.txt
sphinx-plugin/requirements.txt

test:
needs: build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
dist-type: [sdist, wheel]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Download lockfiles
uses: actions/download-artifact@v5
with:
name: 'lockfiles'
path: .
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements-dev.txt
pip install -r requirements.txt
pip install -r sphinx-plugin/requirements.txt
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v5
with:
name: 'dists'
path: dist
- name: Download sphinx artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v5
with:
name: 'dists-sphinx'
path: dist
Expand All @@ -94,21 +110,21 @@ jobs:
if: ${{ success() && (github.event.inputs.allow_deploy == 'true' || github.event.inputs.allow_sphinx_deploy == 'true') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.8
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v5
with:
name: 'dists'
path: dist
- name: Download sphinx artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v5
with:
name: 'dists-sphinx'
path: dist-sphinx
Expand Down
22 changes: 14 additions & 8 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
version: 2

python:
version: "3.8"
install:
- requirements: doc/requirements.txt
- method: pip
path: .
- method: pip
path: sphinx-plugin
build:
os: ubuntu-24.04
tools:
python: "3.11"
jobs:
create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --group doc
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv pip install -e sphinx-plugin
install:
- "true"

sphinx:
configuration: doc/source/conf.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# python-dispatch
Lightweight event handling for Python

[![Build Status](https://travis-ci.org/nocarryr/python-dispatch.svg?branch=master)](https://travis-ci.org/nocarryr/python-dispatch)[![Coverage Status](https://coveralls.io/repos/github/nocarryr/python-dispatch/badge.svg?branch=master)](https://coveralls.io/github/nocarryr/python-dispatch?branch=master)[![PyPI version](https://badge.fury.io/py/python-dispatch.svg)](https://badge.fury.io/py/python-dispatch)[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/nocarryr/python-dispatch/master/LICENSE.txt)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/nocarryr/python-dispatch/ci.yml)[![Coverage Status](https://coveralls.io/repos/github/nocarryr/python-dispatch/badge.svg?branch=master)](https://coveralls.io/github/nocarryr/python-dispatch?branch=master)[![PyPI version](https://badge.fury.io/py/python-dispatch.svg)](https://badge.fury.io/py/python-dispatch)[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/nocarryr/python-dispatch/master/LICENSE.txt)

## Description
This is an implementation of the "Observer Pattern" with inspiration from the
Expand Down
5 changes: 0 additions & 5 deletions doc/requirements.txt

This file was deleted.

83 changes: 83 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

[project]
name = "python-dispatch"
version = "0.2.2"
description = "Lightweight Event Handling Library for Python"
authors = [
{ name = "Matthew Reid", email = "matt@nomadic-recording.com" }
]
readme = "README.md"
license = "MIT"
keywords = ["event", "properties", "dispatch"]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules"
]
dependencies = [
"importlib-metadata; python_version < '3.8'"
]


[project.urls]
Documentation = "https://python-dispatch.readthedocs.io/"
Source = "https://github.com/nocarryr/python-dispatch"
Download = "https://pypi.org/project/python-dispatch/"
Tracker = "https://github.com/nocarryr/python-dispatch/issues"


[build-system]
requires = ["uv_build>=0.9.16,<0.10.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
module-root = ""
module-name = "pydispatch"

[tool.uv.sources]
python-dispatch-sphinx = { path = "sphinx-plugin", package = false }


[tool.pytest.ini_options]
testpaths = ["tests", "doc", "pydispatch"]
addopts = "--doctest-modules --doctest-glob='*.rst' --doctest-glob='*.md'"
doctest_plus = "enabled"
asyncio_mode = "auto"


[dependency-groups]
doc = [
"furo>=2022.4.7",
"m2r2>=0.3.2",
"setuptools>=60.2.0",
"sphinx<5.0.0",
"sphinx-panels>=0.6.0",
"sphinx-rst-builder>=0.0.3",
"sphinx-rtd-theme>=1.3.0",
]
test = [
{include-group = "doc"},
"coveralls>=3.3.1",
"pytest>=7.0.1",
"pytest-asyncio>=0.16.0",
"pytest-cov>=4.0.0",
"pytest-doctestplus>=0.9.0",
"tomli; python_version < '3.11'",
]

dev = [
{include-group = "test"},
"python-dispatch-sphinx",
]
7 changes: 0 additions & 7 deletions requirements-dev.txt

This file was deleted.

52 changes: 0 additions & 52 deletions setup.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

Loading