Skip to content

Commit d053139

Browse files
authored
Merge pull request #25 from nocarryr/project-updates
Project updates
2 parents 9d14db2 + 71d8075 commit d053139

16 files changed

Lines changed: 3201 additions & 181 deletions

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@ on:
99
jobs:
1010
test:
1111

12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]
16+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v5
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
2022
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v6
2224
with:
2325
python-version: ${{ matrix.python-version }}
24-
- name: Install base dependencies
26+
- name: Install Project
2527
run: |
26-
python -m pip install --upgrade pip setuptools wheel
27-
pip install -r requirements-dev.txt
28-
pip install -e .
29-
pip install -e sphinx-plugin
28+
uv sync --frozen --group test --group doc
29+
uv pip install -e sphinx-plugin
3030
- name: Test python-dispatch
3131
run: |
32-
py.test --cov --cov-config=.coveragerc tests pydispatch doc README.md
32+
uv run pytest --cov --cov-config=.coveragerc tests pydispatch doc README.md
3333
- name: Test python-dispatch-sphinx
3434
run: |
35-
py.test --cov --cov-append --cov-config=sphinx-plugin/.coveragerc sphinx-plugin/tests
35+
uv run pytest --cov --cov-append --cov-config=sphinx-plugin/.coveragerc sphinx-plugin/tests
3636
- name: Upload to Coveralls
37-
run: coveralls --service=github
37+
run: uv run coveralls --service=github
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}

.github/workflows/dist-test.yml

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,58 +19,74 @@ jobs:
1919
build:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v2
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v2
22+
- uses: actions/checkout@v5
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
25+
- name: Set up Python
26+
uses: actions/setup-python@v6
2527
with:
26-
python-version: 3.8
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip setuptools wheel
28+
python-version: 3.11
3029
- name: Build pydispatch dists
31-
run: python setup.py sdist bdist_wheel
30+
run: uv build
3231
- name: Build pydispatch_sphinx dists
33-
run: python setup.py sdist --dist-dir=$DISTDIR bdist_wheel --dist-dir=$DISTDIR
32+
run: uv build --out-dir $DISTDIR
3433
working-directory: ${{ github.workspace }}/sphinx-plugin
3534
env:
3635
DISTDIR: ${{ github.workspace }}/dist-sphinx
36+
- name: Export pydispatch lockfile
37+
run: uv export --frozen --no-emit-project --only-group test -o requirements.txt
38+
- name: Export pydispatch_sphinx lockfile
39+
run: uv export --frozen --no-emit-project --only-group test -o requirements.txt
40+
working-directory: ${{ github.workspace }}/sphinx-plugin
3741
- name: Upload artifacts
38-
uses: actions/upload-artifact@v2
42+
uses: actions/upload-artifact@v5
3943
with:
4044
name: 'dists'
4145
path: 'dist/*'
4246
- name: Upload sphinx artifacts
43-
uses: actions/upload-artifact@v2
47+
uses: actions/upload-artifact@v5
4448
with:
4549
name: 'dists-sphinx'
4650
path: 'dist-sphinx/*'
51+
- name: Upload lockfiles
52+
uses: actions/upload-artifact@v5
53+
with:
54+
name: 'lockfiles'
55+
path: |
56+
requirements.txt
57+
sphinx-plugin/requirements.txt
4758
4859
test:
4960
needs: build
50-
runs-on: ubuntu-20.04
61+
runs-on: ubuntu-latest
5162
strategy:
5263
matrix:
53-
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]
64+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
5465
dist-type: [sdist, wheel]
5566
fail-fast: false
5667

5768
steps:
58-
- uses: actions/checkout@v2
69+
- uses: actions/checkout@v5
5970
- name: Set up Python ${{ matrix.python-version }}
60-
uses: actions/setup-python@v4
71+
uses: actions/setup-python@v6
6172
with:
6273
python-version: ${{ matrix.python-version }}
74+
- name: Download lockfiles
75+
uses: actions/download-artifact@v5
76+
with:
77+
name: 'lockfiles'
78+
path: .
6379
- name: Install dependencies
6480
run: |
65-
python -m pip install --upgrade pip setuptools wheel
66-
pip install -r requirements-dev.txt
81+
pip install -r requirements.txt
82+
pip install -r sphinx-plugin/requirements.txt
6783
- name: Download artifacts
68-
uses: actions/download-artifact@v2
84+
uses: actions/download-artifact@v5
6985
with:
7086
name: 'dists'
7187
path: dist
7288
- name: Download sphinx artifacts
73-
uses: actions/download-artifact@v2
89+
uses: actions/download-artifact@v5
7490
with:
7591
name: 'dists-sphinx'
7692
path: dist
@@ -94,21 +110,21 @@ jobs:
94110
if: ${{ success() && (github.event.inputs.allow_deploy == 'true' || github.event.inputs.allow_sphinx_deploy == 'true') }}
95111
runs-on: ubuntu-latest
96112
steps:
97-
- uses: actions/checkout@v2
98-
- name: Set up Python ${{ matrix.python-version }}
99-
uses: actions/setup-python@v2
113+
- uses: actions/checkout@v5
114+
- name: Set up Python
115+
uses: actions/setup-python@v6
100116
with:
101-
python-version: 3.8
117+
python-version: 3.11
102118
- name: Install dependencies
103119
run: |
104120
python -m pip install --upgrade pip setuptools wheel twine
105121
- name: Download artifacts
106-
uses: actions/download-artifact@v2
122+
uses: actions/download-artifact@v5
107123
with:
108124
name: 'dists'
109125
path: dist
110126
- name: Download sphinx artifacts
111-
uses: actions/download-artifact@v2
127+
uses: actions/download-artifact@v5
112128
with:
113129
name: 'dists-sphinx'
114130
path: dist-sphinx

.readthedocs.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
version: 2
22

3-
python:
4-
version: "3.8"
5-
install:
6-
- requirements: doc/requirements.txt
7-
- method: pip
8-
path: .
9-
- method: pip
10-
path: sphinx-plugin
3+
build:
4+
os: ubuntu-24.04
5+
tools:
6+
python: "3.11"
7+
jobs:
8+
create_environment:
9+
- asdf plugin add uv
10+
- asdf install uv latest
11+
- asdf global uv latest
12+
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --group doc
13+
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv pip install -e sphinx-plugin
14+
install:
15+
- "true"
16+
1117
sphinx:
1218
configuration: doc/source/conf.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# python-dispatch
22
Lightweight event handling for Python
33

4-
[![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)
4+
[![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)
55

66
## Description
77
This is an implementation of the "Observer Pattern" with inspiration from the

doc/requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
2+
[project]
3+
name = "python-dispatch"
4+
version = "0.2.2"
5+
description = "Lightweight Event Handling Library for Python"
6+
authors = [
7+
{ name = "Matthew Reid", email = "matt@nomadic-recording.com" }
8+
]
9+
readme = "README.md"
10+
license = "MIT"
11+
keywords = ["event", "properties", "dispatch"]
12+
requires-python = ">=3.8"
13+
classifiers = [
14+
"Development Status :: 3 - Alpha",
15+
"Intended Audience :: Developers",
16+
"Operating System :: OS Independent",
17+
"Programming Language :: Python",
18+
"Topic :: Software Development",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
26+
"Topic :: Software Development :: Libraries",
27+
"Topic :: Software Development :: Libraries :: Python Modules"
28+
]
29+
dependencies = [
30+
"importlib-metadata; python_version < '3.8'"
31+
]
32+
33+
34+
[project.urls]
35+
Documentation = "https://python-dispatch.readthedocs.io/"
36+
Source = "https://github.com/nocarryr/python-dispatch"
37+
Download = "https://pypi.org/project/python-dispatch/"
38+
Tracker = "https://github.com/nocarryr/python-dispatch/issues"
39+
40+
41+
[build-system]
42+
requires = ["uv_build>=0.9.16,<0.10.0"]
43+
build-backend = "uv_build"
44+
45+
[tool.uv.build-backend]
46+
module-root = ""
47+
module-name = "pydispatch"
48+
49+
[tool.uv.sources]
50+
python-dispatch-sphinx = { path = "sphinx-plugin", package = false }
51+
52+
53+
[tool.pytest.ini_options]
54+
testpaths = ["tests", "doc", "pydispatch"]
55+
addopts = "--doctest-modules --doctest-glob='*.rst' --doctest-glob='*.md'"
56+
doctest_plus = "enabled"
57+
asyncio_mode = "auto"
58+
59+
60+
[dependency-groups]
61+
doc = [
62+
"furo>=2022.4.7",
63+
"m2r2>=0.3.2",
64+
"setuptools>=60.2.0",
65+
"sphinx<5.0.0",
66+
"sphinx-panels>=0.6.0",
67+
"sphinx-rst-builder>=0.0.3",
68+
"sphinx-rtd-theme>=1.3.0",
69+
]
70+
test = [
71+
{include-group = "doc"},
72+
"coveralls>=3.3.1",
73+
"pytest>=7.0.1",
74+
"pytest-asyncio>=0.16.0",
75+
"pytest-cov>=4.0.0",
76+
"pytest-doctestplus>=0.9.0",
77+
"tomli; python_version < '3.11'",
78+
]
79+
80+
dev = [
81+
{include-group = "test"},
82+
"python-dispatch-sphinx",
83+
]

requirements-dev.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 52 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)