Skip to content

Commit aebd21b

Browse files
docs: rework CI a bit, more modern skipping (#3424)
* docs: rework CI a bit, more modern skipping * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b11ff91 commit aebd21b

File tree

5 files changed

+19
-24
lines changed

5 files changed

+19
-24
lines changed

.github/workflows/ci.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -704,14 +704,11 @@ jobs:
704704
- name: Install Doxygen
705705
run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04
706706

707-
- name: Install docs & setup requirements
708-
run: python3 -m pip install -r docs/requirements.txt
709-
710707
- name: Build docs
711-
run: python3 -m sphinx -W -b html docs docs/.build
708+
run: pipx run nox -s docs
712709

713710
- name: Make SDist
714-
run: python3 setup.py sdist
711+
run: pipx run nox -s build -- --sdist
715712

716713
- run: git status --ignored
717714

@@ -723,7 +720,7 @@ jobs:
723720
- name: Compare Dists (headers only)
724721
working-directory: include
725722
run: |
726-
python3 -m pip install --user -U ../dist/*
723+
python3 -m pip install --user -U ../dist/*.tar.gz
727724
installed=$(python3 -c "import pybind11; print(pybind11.get_include() + '/pybind11')")
728725
diff -rq $installed ./pybind11
729726

docs/Doxyfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ ALIASES += "endrst=\endverbatim"
1818
QUIET = YES
1919
WARNINGS = YES
2020
WARN_IF_UNDOCUMENTED = NO
21-
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \
22-
PY_MAJOR_VERSION=3 \
21+
PREDEFINED = PY_MAJOR_VERSION=3 \
2322
PYBIND11_NOINLINE

docs/requirements.txt

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
breathe==4.26.1
2-
# docutils 0.17 breaks HTML tags & RTD theme
3-
# https://github.com/sphinx-doc/sphinx/issues/9001
4-
docutils==0.16
5-
sphinx==3.3.1
6-
sphinx_rtd_theme==0.5.0
7-
sphinxcontrib-moderncmakedomain==3.17
8-
sphinxcontrib-svg2pdfconverter==1.1.0
1+
breathe==4.31.0
2+
sphinx==3.5.4
3+
sphinx_rtd_theme==1.0.0
4+
sphinxcontrib-moderncmakedomain==3.19
5+
sphinxcontrib-svg2pdfconverter==1.1.1

include/pybind11/pytypes.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ class object : public handle {
287287
struct borrowed_t { };
288288
struct stolen_t { };
289289

290-
#ifndef DOXYGEN_SHOULD_SKIP_THIS // Issue in breathe 4.26.1
290+
/// @cond BROKEN
291291
template <typename T> friend T reinterpret_borrow(handle);
292292
template <typename T> friend T reinterpret_steal(handle);
293-
#endif
293+
/// @endcond
294294

295295
public:
296296
// Only accessible from derived classes and the reinterpret_* functions
@@ -1717,7 +1717,7 @@ class memoryview : public object {
17171717
#endif
17181718
};
17191719

1720-
#ifndef DOXYGEN_SHOULD_SKIP_THIS
1720+
/// @cond DUPLICATE
17211721
inline memoryview memoryview::from_buffer(
17221722
void *ptr, ssize_t itemsize, const char* format,
17231723
detail::any_container<ssize_t> shape,
@@ -1745,7 +1745,7 @@ inline memoryview memoryview::from_buffer(
17451745
throw error_already_set();
17461746
return memoryview(object(obj, stolen_t{}));
17471747
}
1748-
#endif // DOXYGEN_SHOULD_SKIP_THIS
1748+
/// @endcond
17491749
/// @} pytypes
17501750

17511751
/// \addtogroup python_builtins

noxfile.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def docs(session: nox.Session) -> None:
5757
session.chdir("docs")
5858

5959
if "pdf" in session.posargs:
60-
session.run("sphinx-build", "-M", "latexpdf", ".", "_build")
60+
session.run("sphinx-build", "-b", "latexpdf", ".", "_build")
6161
return
6262

63-
session.run("sphinx-build", "-M", "html", ".", "_build")
63+
session.run("sphinx-build", "-b", "html", ".", "_build")
6464

6565
if "serve" in session.posargs:
6666
session.log("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")
@@ -86,6 +86,8 @@ def build(session: nox.Session) -> None:
8686

8787
session.install("build")
8888
session.log("Building normal files")
89-
session.run("python", "-m", "build")
89+
session.run("python", "-m", "build", *session.posargs)
9090
session.log("Building pybind11-global files (PYBIND11_GLOBAL_SDIST=1)")
91-
session.run("python", "-m", "build", env={"PYBIND11_GLOBAL_SDIST": "1"})
91+
session.run(
92+
"python", "-m", "build", *session.posargs, env={"PYBIND11_GLOBAL_SDIST": "1"}
93+
)

0 commit comments

Comments
 (0)