Skip to content

Commit df61d71

Browse files
authored
BREAKING: switch to uv, namespace package and Python 3.10+ (#57)
1 parent 84be4af commit df61d71

27 files changed

+1674
-2802
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
pyannote/pipeline/_version.py export-subst
21
doc/source/conf.py export-subst

.github/FUNDING.yml

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

.github/workflows/doc.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Documentation
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
15+
fetch-depth: 0
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v5
18+
with:
19+
enable-cache: true
20+
cache-dependency-glob: uv.lock
21+
22+
- name: Install the project
23+
run: uv sync --extra doc
24+
25+
- name: Build documentation
26+
run: |
27+
make --directory=doc html
28+
touch ./doc/build/html/.nojekyll
29+
- name: Deploy
30+
uses: peaceiris/actions-gh-pages@v3
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: ./doc/build/html

.github/workflows/pypi.yml

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

.github/workflows/publish.yml renamed to .github/workflows/release.yml

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ jobs:
1111
- uses: actions/checkout@v4
1212
with:
1313
persist-credentials: false
14+
fetch-depth: 0
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v5
17+
with:
18+
enable-cache: true
19+
cache-dependency-glob: uv.lock
1420
- name: Set up Python
1521
uses: actions/setup-python@v5
1622
with:
17-
python-version: "3.x"
18-
- name: Install pypa/build
19-
run: >-
20-
python3 -m
21-
pip install
22-
build
23-
--user
24-
- name: Build a binary wheel and a source tarball
25-
run: python3 -m build
23+
python-version-file: ".python-version"
24+
- name: Build
25+
run: uv build
2626
- name: Store the distribution packages
2727
uses: actions/upload-artifact@v4
2828
with:
@@ -38,18 +38,22 @@ jobs:
3838
runs-on: ubuntu-latest
3939
environment:
4040
name: pypi
41-
url: https://pypi.org/p/pyannote.pipeline
4241
permissions:
43-
id-token: write # IMPORTANT: mandatory for trusted publishing
44-
42+
id-token: write
4543
steps:
4644
- name: Download all the dists
4745
uses: actions/download-artifact@v4
4846
with:
4947
name: python-package-distributions
5048
path: dist/
49+
- name: Install uv
50+
uses: astral-sh/setup-uv@v5
51+
with:
52+
enable-cache: true
53+
cache-dependency-glob: uv.lock
5154
- name: Publish distribution 📦 to PyPI
52-
uses: pypa/gh-action-pypi-publish@release/v1
55+
run: uv publish --trusted-publishing always --publish-url https://upload.pypi.org/legacy/
56+
5357

5458
github-release:
5559
name: >-
@@ -94,26 +98,28 @@ jobs:
9498
"$GITHUB_REF_NAME" dist/**
9599
--repo "$GITHUB_REPOSITORY"
96100
97-
publish-to-testpypi:
98-
name: Publish Python 🐍 distribution 📦 to TestPyPI
99-
needs:
100-
- build
101-
runs-on: ubuntu-latest
102-
103-
environment:
104-
name: testpypi
105-
url: https://test.pypi.org/p/pyannote.pipeline
106-
107-
permissions:
108-
id-token: write # IMPORTANT: mandatory for trusted publishing
109-
110-
steps:
111-
- name: Download all the dists
112-
uses: actions/download-artifact@v4
113-
with:
114-
name: python-package-distributions
115-
path: dist/
116-
- name: Publish distribution 📦 to TestPyPI
117-
uses: pypa/gh-action-pypi-publish@release/v1
118-
with:
119-
repository-url: https://test.pypi.org/legacy/
101+
# publish-to-testpypi:
102+
# name: Publish Python 🐍 distribution 📦 to TestPyPI
103+
# needs:
104+
# - build
105+
# runs-on: ubuntu-latest
106+
#
107+
# environment:
108+
# name: testpypi
109+
#
110+
# permissions:
111+
# id-token: write # IMPORTANT: mandatory for trusted publishing
112+
#
113+
# steps:
114+
# - name: Download all the dists
115+
# uses: actions/download-artifact@v4
116+
# with:
117+
# name: python-package-distributions
118+
# path: dist/
119+
# - name: Install uv
120+
# uses: astral-sh/setup-uv@v5
121+
# with:
122+
# enable-cache: true
123+
# cache-dependency-glob: uv.lock
124+
# - name: Publish distribution 📦 to PyPI
125+
# run: uv publish --trusted-publishing always --publish-url https://test.pypi.org/legacy/

.github/workflows/test.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@ name: Test
22

33
on:
44
pull_request:
5-
branches:
5+
branches:
66
- develop
77
push:
8-
branches:
8+
branches:
99
- develop
1010
- master
1111
- release/*
1212

13-
jobs:
14-
build:
1513

14+
jobs:
15+
test:
16+
name: Test
1617
runs-on: ubuntu-latest
1718
strategy:
18-
max-parallel: 4
1919
matrix:
20-
python-version: [3.8]
21-
20+
python-version:
21+
- "3.10"
22+
- "3.11"
23+
- "3.12"
24+
env:
25+
UV_PYTHON: ${{ matrix.python-version }}
2226
steps:
23-
- uses: actions/checkout@v2
24-
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v2
26-
with:
27-
python-version: ${{ matrix.python-version }}
28-
- name: Install from source
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install .
32-
- name: Test with pytest
33-
run: |
34-
pip install pytest
35-
pytest tests/
27+
- uses: actions/checkout@v4
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v5
31+
32+
- name: Install the project
33+
run: uv sync --extra test
34+
35+
- name: Run tests
36+
run: uv run pytest tests

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

MANIFEST.in

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

doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ BUILDDIR = build
1010

1111
# Put it first so that "make" without argument is like "make help".
1212
help:
13-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
uv run --extra doc $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1414

1515
.PHONY: help Makefile
1616

1717
# Catch-all target: route all unknown targets to Sphinx using the new
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
uv run --extra doc $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

doc/source/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
Changelog
33
#########
44

5+
Unreleased
6+
~~~~~~~~~~
7+
8+
- BREAKING: drop support to `Python` < 3.10
9+
- BREAKING: switch to native namespace package
10+
- BREAKING: remove `pyannote.pipeline.blocks` submodule
11+
- setup: switch to `uv`
12+
513
Version 3.1.2 (2025-02-07)
614
~~~~~~~~~~~~~~~~~~~~~~~~~~
715

doc/source/conf.py

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
"sphinx.ext.mathjax",
4343
"sphinx.ext.viewcode",
4444
"sphinx.ext.githubpages",
45-
"matplotlib.sphinxext.plot_directive",
46-
"IPython.sphinxext.ipython_directive",
4745
]
4846

4947

@@ -68,15 +66,15 @@
6866
# You can specify multiple suffix as a list of string:
6967
#
7068
# source_suffix = ['.rst', '.md']
71-
source_suffix = ".rst"
69+
source_suffix = {".rst": "restructuredtext"}
7270

7371
# The master toctree document.
7472
master_doc = "index"
7573

7674
# General information about the project.
77-
project = u"pyannote.pipeline"
78-
copyright = u"2018, CNRS"
79-
author = u"Hervé Bredin"
75+
project = "pyannote.pipeline"
76+
copyright = "2017, CNRS"
77+
author = "Hervé Bredin"
8078

8179
# The version info for the project you're documenting, acts as replacement for
8280
# |version| and |release|, also used in various other places throughout the
@@ -94,7 +92,7 @@
9492
#
9593
# This is also used if you do content translation via gettext catalogs.
9694
# Usually you set "language" from the command line for these cases.
97-
language = None
95+
language = "en"
9896

9997
# List of patterns, relative to source directory, that match files and
10098
# directories to ignore when looking for source files.
@@ -113,10 +111,7 @@
113111
# The theme to use for HTML and HTML Help pages. See the documentation for
114112
# a list of builtin themes.
115113
#
116-
import sphinx_rtd_theme
117-
118114
html_theme = "sphinx_rtd_theme"
119-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
120115

121116
# Theme options are theme-specific and customize the look and feel of a theme
122117
# further. For a list of options available for each theme, see the
@@ -133,7 +128,7 @@
133128
# -- Options for HTMLHelp output ------------------------------------------
134129

135130
# Output file base name for HTML help builder.
136-
htmlhelp_basename = "pyannotecoredoc"
131+
htmlhelp_basename = "pyannotepipelinedoc"
137132

138133

139134
# -- Options for LaTeX output ---------------------------------------------
@@ -160,8 +155,8 @@
160155
(
161156
master_doc,
162157
"pyannotepipeline.tex",
163-
u"pyannote.pipeline Documentation",
164-
u"Hervé Bredin",
158+
"pyannote.pipeline Documentation",
159+
"Hervé Bredin",
165160
"manual",
166161
),
167162
]
@@ -172,7 +167,7 @@
172167
# One entry per manual page. List of tuples
173168
# (source start file, name, description, authors, manual section).
174169
man_pages = [
175-
(master_doc, "pyannotepipeline", u"pyannote.pipeline Documentation", [author], 1)
170+
(master_doc, "pyannotepipeline", "pyannote.pipeline Documentation", [author], 1)
176171
]
177172

178173

@@ -185,7 +180,7 @@
185180
(
186181
master_doc,
187182
"pyannotepipeline",
188-
u"pyannote.pipeline Documentation",
183+
"pyannote.pipeline Documentation",
189184
author,
190185
"pyannotepipeline",
191186
"One line description of project.",
@@ -194,7 +189,8 @@
194189
]
195190

196191
# Example configuration for intersphinx: refer to the Python standard library.
197-
intersphinx_mapping = {"https://docs.python.org/": None}
198-
199-
200-
ipython_savefig_dir = "../../build/html/_static"
192+
intersphinx_mapping = {
193+
"python": ("https://docs.python.org/", None),
194+
"pyannote.core": ("https://pyannote.github.io/pyannote-core", None),
195+
"pyannote.database": ("https://pyannote.github.io/pyannote-database", None),
196+
}

pyannote/__init__.py

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

0 commit comments

Comments
 (0)