Skip to content

Commit df48b79

Browse files
authored
Merge branch 'main' into patch-1
2 parents 750e4b0 + fc332d9 commit df48b79

40 files changed

+1754
-312
lines changed

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,32 @@ repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
33
rev: v4.4.0
44
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-merge-conflict
8+
- id: check-symlinks
9+
- id: check-yaml
10+
- id: end-of-file-fixer
11+
- id: mixed-line-ending
512
- id: trailing-whitespace
13+
14+
- repo: https://github.com/codespell-project/codespell
15+
rev: v2.2.6
16+
hooks:
17+
- id: codespell
18+
args: ["-L", "ned"]
19+
20+
- repo: local
21+
hooks:
22+
- id: disallow-caps
23+
name: Disallow improper capitalization
24+
language: pygrep
25+
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
26+
exclude: .pre-commit-config.yaml
27+
28+
- repo: https://github.com/pre-commit/pygrep-hooks
29+
rev: v1.10.0
30+
hooks:
31+
- id: rst-backticks
32+
- id: rst-directive-colons
33+
- id: rst-inline-touching-normal

noxfile.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# http://creativecommons.org/licenses/by-sa/3.0.
55

66
import shutil
7-
import nox
87

8+
import nox
99

1010
nox.options.sessions = []
1111

@@ -20,7 +20,7 @@ def translation(session):
2020
session.run(
2121
"sphinx-build",
2222
"-b", "gettext", # build gettext-style message catalogs (.pot file)
23-
"-d", ".nox/.doctrees/", # path to put the cache
23+
"-d", session.cache_dir / ".doctrees", # path to put the cache
2424
"source/", # where the rst files are located
2525
target_dir, # where to put the .pot file
2626
)
@@ -33,13 +33,9 @@ def build(session, autobuild=False):
3333
"""
3434
session.install("-r", "requirements.txt")
3535

36-
target_build_dir = "build"
37-
38-
shutil.rmtree(target_build_dir, ignore_errors=True)
39-
4036
if autobuild:
4137
command = "sphinx-autobuild"
42-
extra_args = "-H", "0.0.0.0"
38+
extra_args = "--host", "0.0.0.0"
4339
else:
4440
# NOTE: This branch adds options that are unsupported by autobuild
4541
command = "sphinx-build"
@@ -52,11 +48,12 @@ def build(session, autobuild=False):
5248
command, *extra_args,
5349
"-j", "auto", # parallelize the build
5450
"-b", "html", # use HTML builder
51+
"-d", session.cache_dir / ".doctrees", # path to put the cache
5552
"-n", # nitpicky warn about all missing references
5653
"-W", # Treat warnings as errors.
5754
*session.posargs,
5855
"source", # where the rst files are located
59-
target_build_dir, # where to put the html output
56+
"build", # where to put the html output
6057
)
6158

6259

@@ -78,6 +75,7 @@ def linkcheck(session):
7875
session.run(
7976
"sphinx-build",
8077
"-b", "linkcheck", # use linkcheck builder
78+
"-d", session.cache_dir / ".doctrees", # path to put the cache
8179
"--color",
8280
"-n", "-W", "--keep-going", # be strict
8381
"source", # where the rst files are located

requirements.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
sphinx==4.5.0
2-
sphinx-autobuild==0.7.1
3-
sphinx-inline-tabs==2021.4.11b9
4-
python-docs-theme==2023.9
5-
sphinx-copybutton==0.5.0
6-
pypa-docs-theme @ git+https://github.com/pypa/pypa-docs-theme.git
1+
furo==2023.9.10
2+
sphinx==7.2.6
3+
sphinx-autobuild==2021.3.14
4+
sphinx-inline-tabs==2023.4.21
5+
sphinx-copybutton==0.5.2
76
sphinx-toolbox==3.5.0

source/assets/py.png

695 Bytes
Loading

source/conf.py

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
#
8989
# This is also used if you do content translation via gettext catalogs.
9090
# Usually you set "language" from the command line for these cases.
91-
language = None
91+
language = 'en'
9292

9393
locale_dirs = ['../locales']
9494

@@ -133,7 +133,7 @@
133133
# show_authors = False
134134

135135
# The name of the Pygments (syntax highlighting) style to use.
136-
pygments_style = 'sphinx'
136+
#pygments_style = 'sphinx'
137137

138138
# A list of ignored prefixes for module index sorting.
139139
# modindex_common_prefix = []
@@ -150,16 +150,14 @@
150150
# The theme to use for HTML and HTML Help pages. See the documentation for
151151
# a list of builtin themes.
152152
#
153-
html_theme = 'pypa_theme'
153+
html_theme = 'furo'
154154

155155
# Theme options are theme-specific and customize the look and feel of a theme
156156
# further. For a list of options available for each theme, see the
157157
# documentation.
158158
html_theme_options = {
159-
'collapsiblesidebar': True,
160-
'externalrefs': True,
161-
'navigation_depth': 2,
162-
'issues_url': github_repo_issues_url,
159+
"sidebar_hide_name": True,
160+
# 'issues_url': github_repo_issues_url, # FIXME: support this in furo?
163161
}
164162

165163
# Add any paths that contain custom themes here, relative to this directory.
@@ -183,7 +181,7 @@
183181
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
184182
# pixels large.
185183
#
186-
# html_favicon = None
184+
html_favicon = 'assets/py.png'
187185

188186
# Add any paths that contain custom static files (such as style sheets) here,
189187
# relative to this directory. They are copied after the builtin static files,
@@ -211,10 +209,10 @@
211209
#
212210

213211
# Custom sidebar templates, filenames relative to this file.
214-
html_sidebars = {
215-
'**': ['globaltoc.html', 'relations.html'],
216-
'index': ['globaltoc.html']
217-
}
212+
# html_sidebars = {
213+
# '**': ['globaltoc.html', 'relations.html'],
214+
# 'index': ['globaltoc.html']
215+
# }
218216

219217
# Additional templates that should be rendered to pages, maps page names to
220218
# template names.
@@ -379,11 +377,11 @@
379377

380378
# -- Options for extlinks extension ---------------------------------------
381379
extlinks = {
382-
'issue': (f'{github_repo_issues_url}/%s', '#'), # noqa: WPS323
383-
'pr': (f'{github_repo_url}/pull/%s', 'PR #'), # noqa: WPS323
384-
'commit': (f'{github_repo_url}/commit/%s', ''), # noqa: WPS323
385-
'gh': (f'{github_url}/%s', 'GitHub: '), # noqa: WPS323
386-
'user': (f'{github_sponsors_url}/%s', '@'), # noqa: WPS323
380+
'issue': (f'{github_repo_issues_url}/%s', '#%s'), # noqa: WPS323
381+
'pr': (f'{github_repo_url}/pull/%s', 'PR #%s'), # noqa: WPS323
382+
'commit': (f'{github_repo_url}/commit/%s', '%s'), # noqa: WPS323
383+
'gh': (f'{github_url}/%s', 'GitHub: %s'), # noqa: WPS323
384+
'user': (f'{github_sponsors_url}/%s', '@%s'), # noqa: WPS323
387385
}
388386

389387
linkcheck_ignore = [

source/contribute.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ Documentation types
3232
===================
3333

3434
This project consists of four distinct documentation types with specific
35-
purposes. When proposing new additions to the project please pick the
35+
purposes. The project aspires to follow the `Diátaxis process`_
36+
for creating quality documentation. When proposing new additions to the project please pick the
3637
appropriate documentation type.
3738

39+
.. _Diátaxis process: https://diataxis.fr/
40+
3841
Tutorials
3942
---------
4043

@@ -75,15 +78,15 @@ We use `Weblate`_ to manage translations of this project.
7578
Please visit the `packaging.python.org`_ project on Weblate to contribute.
7679

7780
If you are experiencing issues while you are working on translations,
78-
please open an issue on `Github`_.
81+
please open an issue on `GitHub`_.
7982

8083
.. tip::
8184

8285
Any translations of this project should follow `reStructuredText syntax`_.
8386

8487
.. _Weblate: https://weblate.org/
8588
.. _packaging.python.org: https://hosted.weblate.org/projects/pypa/packaging-python-org/
86-
.. _Github: https://github.com/pypa/packaging.python.org/issues
89+
.. _GitHub: https://github.com/pypa/packaging.python.org/issues
8790
.. _reStructuredText syntax: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
8891

8992
Adding a language

source/discussions/deploying-python-applications.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ Deploying Python applications
66
:Page Status: Incomplete
77
:Last Reviewed: 2021-8-24
88

9-
.. contents:: Contents
10-
:local:
11-
129

1310
Overview
1411
========
@@ -73,7 +70,7 @@ directory, independent of any other Python installation on the computer.
7370

7471
A big advantage of Pynsist is that the Windows packages can be built on Linux.
7572
There are several examples for different kinds of programs (console, GUI) in
76-
the `documentation <pynsist:index>`. The tool is released
73+
the :any:`documentation <pynsist:index>`. The tool is released
7774
under the MIT-licence.
7875

7976
Application bundles

source/discussions/install-requires-vs-requirements.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
install_requires vs requirements files
55
======================================
66

7-
.. contents:: Contents
8-
:local:
9-
107

118
install_requires
129
----------------

source/flow.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@ For example, here is a table for using :ref:`hatch`:
8282
requires = ["hatchling"]
8383
build-backend = "hatchling.build"
8484
85-
With such a table in the :file:`pyproject.toml` file, a "frontend" tool like
86-
:ref:`build` can run your chosen build tool's "backend" to create the build
87-
artifacts. Your build tool may also provide its own frontend. An install tool
85+
With such a table in the :file:`pyproject.toml` file,
86+
a ":term:`frontend <Build Frontend>`" tool like
87+
:ref:`build` can run your chosen
88+
build tool's ":term:`backend <Build Backend>`"
89+
to create the build artifacts.
90+
Your build tool may also provide its own frontend. An install tool
8891
like :ref:`pip` also acts as a frontend when it runs your build tool's backend
8992
to install from a source distribution.
9093

source/glossary.rst

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,36 @@ Glossary
1212
extensions.
1313

1414

15+
Build Backend
16+
17+
A library that takes a source tree or
18+
:term:`source distribution <Source Distribution (or "sdist")>`
19+
and builds a source distribution or :term:`wheel <Wheel>` from it.
20+
The build is delegated to the backend by a
21+
:term:`frontend <Build Frontend>`.
22+
All backends offer a standardized interface.
23+
24+
Examples of build backends are
25+
:ref:`flit's flit-core <flit>`,
26+
:ref:`hatch's hatchling <hatch>`,
27+
:ref:`maturin`,
28+
:ref:`meson-python`,
29+
:ref:`scikit-build-core`,
30+
and :ref:`setuptools`.
31+
32+
33+
Build Frontend
34+
35+
A tool that users might run
36+
that takes arbitrary source trees or
37+
:term:`source distributions <Source Distribution (or "sdist")>`
38+
and builds source distributions or :term:`wheels <Wheel>` from them.
39+
The actual building is delegated to each source tree's
40+
:term:`build backend <Build Backend>`.
41+
42+
Examples of build frontends are :ref:`pip` and :ref:`build`.
43+
44+
1545
Built Distribution
1646

1747
A :term:`Distribution <Distribution Package>` format containing files
@@ -222,11 +252,10 @@ Glossary
222252
Version Specifier
223253

224254
The version component of a :term:`Requirement Specifier`. For example,
225-
the ">=1.3" portion of "foo>=1.3". :pep:`440` contains
226-
a :pep:`full specification
227-
<440#version-specifiers>` of the
228-
specifiers that Python packaging currently supports. Support for PEP440
229-
was implemented in :ref:`setuptools` v8.0 and :ref:`pip` v6.0.
255+
the ">=1.3" portion of "foo>=1.3". Read the :ref:`Version specifier specification
256+
<version-specifiers>` for a full description of the
257+
specifiers that Python packaging currently supports. Support for this
258+
specification was implemented in :ref:`setuptools` v8.0 and :ref:`pip` v6.0.
230259

231260
Virtual Environment
232261

0 commit comments

Comments
 (0)