Skip to content

Commit 30a96f6

Browse files
docs: fix up docs (#454)
* docs: fix up docs Signed-off-by: Henry Schreiner <[email protected]> * style: pre-commit fixes * chore: clean up a few things Signed-off-by: Henry Schreiner <[email protected]> --------- Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 89af5c4 commit 30a96f6

14 files changed

+87
-52
lines changed

.github/workflows/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
tags:
1818
- "*.*.*"
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
2024
env:
2125
USE_QEMU: ${{ fromJSON(github.event.inputs.use_qemu || 'false') || (github.event_name == 'schedule') || startsWith(github.ref, 'refs/tags/') }}
2226

.readthedocs.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
6+
sphinx:
7+
configuration: docs/conf.py
8+
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.12"
13+
14+
python:
15+
install:
16+
- requirements: docs/requirements-docs.txt

CONTRIBUTING.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Before you submit a pull request, check that it meets these guidelines:
103103
feature to the list in `README.rst`.
104104

105105
3. The pull request should work for Python 2.7, and 3.6+.
106-
Check `GitHub Actions https://github.com/scikit-build/cmake-python-distributions/actions/workflows/build.yml`_
106+
Check `GitHub Actions <https://github.com/scikit-build/cmake-python-distributions/actions/workflows/build.yml>`_
107107
and make sure that the tests pass for all supported Python versions.
108108

109109

HISTORY.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ History
55

66
cmake-python-distributions was initially developed in September 2016 by
77
Jean-Christophe Fillion-Robin to facilitate the distribution of project using
8-
`scikit-build <http://scikit-build.readthedocs.io/>`_ and depending on CMake.
8+
`scikit-build <https://scikit-build.readthedocs.io/>`_ and depending on CMake.

README.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
CMake Python Distributions
33
==========================
44

5-
`CMake <http://www.cmake.org>`_ is used to control the software compilation
5+
`CMake <https://cmake.org>`_ is used to control the software compilation
66
process using simple platform and compiler independent configuration files,
77
and generate native makefiles and workspaces that can be used in the
88
compiler environment of your choice.
@@ -74,22 +74,22 @@ The last version to provide ``manylinux1`` wheels was ``3.22.x``.
7474
Maintainers
7575
-----------
7676

77-
* `How to update CMake version? <http://cmake-python-distributions.readthedocs.io/en/latest/update_cmake_version.html>`_
77+
* `How to update CMake version? <https://cmake-python-distributions.readthedocs.io/en/latest/update_cmake_version.html>`_
7878

79-
* `How to make a release? <http://cmake-python-distributions.readthedocs.io/en/latest/make_a_release.html>`_
79+
* `How to make a release? <https://cmake-python-distributions.readthedocs.io/en/latest/make_a_release.html>`_
8080

8181
Miscellaneous
8282
-------------
8383

84-
* Documentation: http://cmake-python-distributions.readthedocs.io/en/latest/
84+
* Documentation: https://cmake-python-distributions.readthedocs.io/en/latest/
8585
* Source code: https://github.com/scikit-build/cmake-python-distributions
8686
* Mailing list: https://groups.google.com/forum/#!forum/scikit-build
8787

8888
License
8989
-------
9090

9191
This project is maintained by Jean-Christophe Fillion-Robin from Kitware Inc.
92-
It is covered by the `Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>`_.
92+
It is covered by the `Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`_.
9393

9494
CMake is distributed under the OSI-approved BSD 3-clause License.
95-
For more information about CMake, visit http://cmake.org
95+
For more information about CMake, visit https://cmake.org

docs/build_system.rst

+2-8
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
Understanding the Build-system
33
==============================
44

5-
CMakeLists.txt
6-
--------------
75

8-
.. _CMakeLists: https://github.com/scikit-build/cmake-python-distributions/blob/master/CMakeLists.txt
9-
10-
The build system is described by the `CMakeLists.txt <CMakeLists>`_ and is composed of few projects each responsible
6+
The build system is described by the ``CMakeLists.txt`` and is composed of few projects each responsible
117
for a specific task. Once configured, the `Outer Project` is responsible for driving the overall build
128
composed of multiple project called `external project`. Here is the list of `external project`:
139

@@ -16,8 +12,6 @@ composed of multiple project called `external project`. Here is the list of `ext
1612
* ``CMakeProject-build``
1713
* ``CMakePythonDistributions``: This corresponds to the `Inner Project` represented below.
1814

19-
.. _ ..CMakeLists\.txt: https://github.com/scikit-build/cmake-python-distributions/blob/master/CMakeLists.txt
20-
2115
The flow chart represented below illustrates which external projects are included based on the configure
2216
options and describes the role of each one:
2317

@@ -36,7 +30,7 @@ options and describes the role of each one:
3630
color = "#FFF0D7";
3731

3832
// properties
39-
configure [shape = beginpoint, label = "CMakeLists", description="See `CMakeLists.txt <CMakeLists>`_"];
33+
configure [shape = beginpoint, label = "CMakeLists", description="CMake configuration file"];
4034
ask_download [label ="Download source ?", shape = diamond, description = "If option ``CMakeProject_SOURCE_DIR`` is set, skip source download."];
4135
download_source [label ="Download Source archive", description = "External project downloading archives from https://cmake.org/files/."]
4236
reuse_source_dir [label ="Re-use source directory", description = "Empty external project."]

docs/building.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Building the CMake Python wheel
55
Overview
66
--------
77

8-
This project has been designed to work with `scikit-build <http://scikit-build.readthedocs.io/>`_.
8+
This project has been designed to work with `scikit-build <https://scikit-build.readthedocs.io/>`_.
99

1010
It provides a `setup.py` and allows to create both source and binary distributions of
1111
CMake.

docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
#
7474
# This is also used if you do content translation via gettext catalogs.
7575
# Usually you set "language" from the command line for these cases.
76-
language = None
76+
language = 'en'
7777

7878
# There are two options for replacing |today|: either, you set today to some
7979
# non-false value, then it is used:
@@ -160,7 +160,7 @@
160160
# Add any paths that contain custom static files (such as style sheets) here,
161161
# relative to this directory. They are copied after the builtin static files,
162162
# so a file named "default.css" will overwrite the builtin "default.css".
163-
html_static_path = ['_static']
163+
# html_static_path = ['_static']
164164

165165
# Add any extra paths that contain custom files (such as robots.txt or
166166
# .htaccess) here, relative to this directory. These files are copied

docs/index.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
Welcome to CMake Python Distributions's documentation!
77
======================================================
88

9-
`CMake <http://www.cmake.org>`_ is used to control the software compilation
9+
`CMake <https://cmake.org>`_ is used to control the software compilation
1010
process using simple platform and compiler independent configuration files,
1111
and generate native makefiles and workspaces that can be used in the
1212
compiler environment of your choice.
1313

1414
The suite of CMake tools were created by Kitware in response to the need
1515
for a powerful, cross-platform build environment for open-source projects
16-
such as `ITK <https://www.itk.org>`_ and `VTK <http://www.vtk.org>`_.
16+
such as `ITK <https://itk.org>`_ and `VTK <https://vtk.org>`_.
1717

1818
The CMake python wheels provide `CMake 3.28.3 <https://cmake.org/cmake/help/v3.28/index.html>`_.
1919

@@ -49,11 +49,11 @@ Resources
4949
=========
5050

5151
This project is maintained by Jean-Christophe Fillion-Robin from Kitware Inc.
52-
It is covered by the `Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>`_.
52+
It is covered by the `Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`_.
5353

5454
CMake is distributed under the OSI-approved BSD 3-clause License.
55-
For more information about CMake, visit http://cmake.org
55+
For more information about CMake, visit https://cmake.org
5656

57-
* Documentation: http://cmake-python-distributions.readthedocs.io/en/latest/
57+
* Documentation: https://cmake-python-distributions.readthedocs.io/en/latest/
5858
* Source code: https://github.com/scikit-build/cmake-python-distributions
5959
* Mailing list: https://groups.google.com/forum/#!forum/scikit-build

docs/make.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ if errorlevel 9009 (
6767
echo.may add the Sphinx directory to PATH.
6868
echo.
6969
echo.If you don't have Sphinx installed, grab it from
70-
echo.http://sphinx-doc.org/
70+
echo.https://sphinx-doc.org/
7171
exit /b 1
7272
)
7373

docs/make_a_release.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ means that ``echo "Hello"`` should be copied and evaluated in the terminal.
122122
123123
124124
.. _virtualenvwrapper: https://virtualenvwrapper.readthedocs.io/
125-
.. _virtualenv: http://virtualenv.readthedocs.io
125+
.. _virtualenv: https://virtualenv.pypa.io/en/latest
126126
.. _venv: https://docs.python.org/3/library/venv.html
127127

128128

docs/requirements-docs.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
docutils
2-
funcparserlib>=1.0.0a0
2+
funcparserlib>=1.0.0
3+
pillow<10
34
pygments
45
scikit-build
56
sphinx
67
sphinx_rtd_theme
7-
sphinxcontrib-blockdiag
8+
sphinxcontrib-blockdiag # old, not compatible with pillow 10+

noxfile.py

+36-12
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,49 @@ def tests(session: nox.Session) -> str:
5555
session.run("pytest", *session.posargs)
5656

5757

58-
@nox.session
59-
def docs(session: nox.Session) -> str:
58+
@nox.session(reuse_venv=True)
59+
def docs(session: nox.Session) -> None:
6060
"""
61-
Build the docs.
61+
Build the docs. Pass "--serve" to serve. Pass "-b linkcheck" to check links.
6262
"""
6363

64+
parser = argparse.ArgumentParser()
65+
parser.add_argument("--serve", action="store_true", help="Serve after building")
66+
parser.add_argument(
67+
"-b", dest="builder", default="html", help="Build target (default: html)"
68+
)
69+
args, posargs = parser.parse_known_args(session.posargs)
70+
71+
if args.builder != "html" and args.serve:
72+
session.error("Must not specify non-HTML builder with --serve")
73+
74+
extra_installs = ["sphinx-autobuild"] if args.serve else []
75+
6476
wheel = build(session)
65-
session.install("-r", "requirements-docs.txt")
77+
session.install("-r", "docs/requirements-docs.txt", *extra_installs)
6678
session.install(f"./dist/{wheel}")
6779

6880
session.chdir("docs")
69-
session.run("sphinx-build", "-M", "html", ".", "_build")
70-
71-
if session.posargs:
72-
if "serve" in session.posargs:
73-
print("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")
74-
session.run("python", "-m", "http.server", "8000", "-d", "_build/html")
75-
else:
76-
print("Unsupported argument to docs")
81+
82+
if args.builder == "linkcheck":
83+
session.run(
84+
"sphinx-build", "-b", "linkcheck", ".", "_build/linkcheck", *posargs
85+
)
86+
return
87+
88+
shared_args = (
89+
"-n", # nitpicky mode
90+
"-T", # full tracebacks
91+
f"-b={args.builder}",
92+
".",
93+
f"_build/{args.builder}",
94+
*posargs,
95+
)
96+
97+
if args.serve:
98+
session.run("sphinx-autobuild", *shared_args)
99+
else:
100+
session.run("sphinx-build", "--keep-going", *shared_args)
77101

78102

79103
def _bump(session: nox.Session, name: str, repository: str, branch: str, script: str, files) -> None:

pyproject.toml

+8-12
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ before-build = "pip install -r requirements-repair.txt"
2121
repair-wheel-command = "python scripts/repair_wheel.py -w {dest_dir} {wheel}"
2222
test-extras = "test"
2323
test-command = "pytest {project}/tests"
24-
build-verbosity = "1"
24+
build-verbosity = 1
2525

2626
[tool.cibuildwheel.linux]
2727
before-all = [
@@ -55,8 +55,10 @@ MACOSX_DEPLOYMENT_TARGET = "10.10"
5555

5656

5757
[tool.ruff]
58-
select = [
59-
"E", "F", "W", # flake8
58+
src = ["src"]
59+
60+
[tool.ruff.lint]
61+
extend-select = [
6062
"B", # flake8-bugbear
6163
"I", # isort
6264
"ARG", # flake8-unused-arguments
@@ -75,22 +77,16 @@ select = [
7577
"NPY", # NumPy specific rules
7678
"PD", # pandas-vet
7779
]
78-
extend-ignore = [
79-
"PLR", # Design related pylint codes
80-
"E501", # Line too long
80+
ignore = [
81+
"PLR09", # Too many X
8182
"RUF005", # Python 3 needed
8283
"B904", # Python 3 needed
8384
"SIM105", # Python 3 needed
8485
]
85-
src = ["src"]
86-
unfixable = [
87-
"T20", # Removes print statements
88-
"F841", # Removes unused variables
89-
]
9086
exclude = ["src/cmake/_version.py"]
9187
flake8-unused-arguments.ignore-variadic-names = true
9288

93-
[tool.ruff.per-file-ignores]
89+
[tool.ruff.lint.per-file-ignores]
9490
"docs/conf.py" = ["E402"]
9591
"*.pyi" = ["ARG001"]
9692
"noxfile.py" = ["PLW0603"] # Could be fixed if Python 2 dropped

0 commit comments

Comments
 (0)