From a109cecfdf72552052884c5d315ba6519a207a65 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Thu, 28 Aug 2025 21:23:28 +0200 Subject: [PATCH 01/18] add: hacky walkaround for generating the documentation --- .github/workflows/pdoc.yml | 1 + src/PyPartMC/__init__.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml index 4c757158..21da87be 100644 --- a/.github/workflows/pdoc.yml +++ b/.github/workflows/pdoc.yml @@ -26,6 +26,7 @@ jobs: python-version: 3.12 - name: Build run: | + echo "PDOC_GENERATE_PYPARTMC_DOCS=True" >> $GITHUB_ENV pip install pdoc pip install -e . PDOC_ALLOW_EXEC=1 python -We -m pdoc -o html PyPartMC diff --git a/src/PyPartMC/__init__.py b/src/PyPartMC/__init__.py index 1b456320..69ccbc46 100644 --- a/src/PyPartMC/__init__.py +++ b/src/PyPartMC/__init__.py @@ -10,6 +10,7 @@ from collections import namedtuple from contextlib import contextmanager from pathlib import Path +import inspect import nanobind @@ -79,6 +80,18 @@ def __generate_si(): __versions_of_build_time_dependencies__, ) +if os.getenv("PDOC_GENERATE_PYPARTMC_DOCS") == "True": + all_items = [] + for name, obj in inspect.getmembers(_PyPartMC): + if callable(obj): + if not inspect.isclass(obj): + exec(name + " = lambda : 0") + temp = "_PyPartMC." + name + ".__doc__" + setattr(eval(name), "__doc__", eval(temp)) + all_items.append(name) + + __all__ = tuple([*all_items, "si"]) + __version__ = importlib.metadata.version(__package__) # walkaround for MATLAB bindings From 54e6db9390e52ffaa3156ebee641010cd01707c9 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Thu, 28 Aug 2025 21:23:48 +0200 Subject: [PATCH 02/18] add: comment explaining the issue and its solution --- src/PyPartMC/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/PyPartMC/__init__.py b/src/PyPartMC/__init__.py index 69ccbc46..b65e40c1 100644 --- a/src/PyPartMC/__init__.py +++ b/src/PyPartMC/__init__.py @@ -80,6 +80,13 @@ def __generate_si(): __versions_of_build_time_dependencies__, ) +# Hacky walkaround for missing docs in pdoc auto-generated documentation. +# After the switch to nanobind, the docs became empty despite "__doc__" being +# accessible in all of PyPartMC's objects. The code below manually populates +# the "__all__" atrribute of the package. Additionally, functions in the generated +# docs would be listed as nanobind objects with no additional documentation. +# To solve that, dummy functions of the same name are created, and their "__doc__" +# attribute is manually set to the "original" objects' "__doc__" if os.getenv("PDOC_GENERATE_PYPARTMC_DOCS") == "True": all_items = [] for name, obj in inspect.getmembers(_PyPartMC): From ce6adc080f37314bbb30acad722c15e7654a4595 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Thu, 28 Aug 2025 22:27:59 +0200 Subject: [PATCH 03/18] add: set of tests for checking the help() function output on PyPartMC objects --- tests/test_help.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/test_help.py diff --git a/tests/test_help.py b/tests/test_help.py new file mode 100644 index 00000000..23b7b2ef --- /dev/null +++ b/tests/test_help.py @@ -0,0 +1,52 @@ +import pytest + +import PyPartMC as ppmc + +import pydoc + +@pytest.mark.parametrize( + "obj", + ( + ppmc.AeroBinned, + ppmc.AeroData, + ppmc.AeroParticle, + ppmc.AeroState, + ppmc.CampCore, + ppmc.EnvState, + ppmc.GasData, + ppmc.GasState, + ppmc.Photolysis, + ppmc.RunExactOpt, + ppmc.RunPartOpt, + ppmc.RunSectOpt, + ppmc.Scenario, + ppmc.condense_equilib_particle, + ppmc.condense_equilib_particles, + ppmc.diam2rad, + ppmc.histogram_1d, + ppmc.histogram_2d, + ppmc.input_exact, + ppmc.input_sectional, + ppmc.input_state, + ppmc.loss_rate, + ppmc.loss_rate_dry_dep, + ppmc.output_state, + ppmc.pow2_above, + ppmc.rad2diam, + ppmc.rand_init, + ppmc.rand_normal, + ppmc.run_exact, + ppmc.run_part, + ppmc.run_part_timeblock, + ppmc.run_part_timestep, + ppmc.run_sect, + ppmc.sphere_rad2vol, + ppmc.sphere_vol2rad, + ), +) +def test_help_output(obj): + help_output = pydoc.render_doc(obj) + + assert len(obj.__doc__) > 0 + # get rid of whitespace and bars + assert "".join(obj.__doc__.split()) in "".join(help_output.replace("|", "").split()) \ No newline at end of file From b7d4ccaacc1fb8c24f233138ced37a2ad5f2bd89 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Thu, 28 Aug 2025 22:32:36 +0200 Subject: [PATCH 04/18] linting --- src/PyPartMC/__init__.py | 4 ++-- tests/test_help.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/PyPartMC/__init__.py b/src/PyPartMC/__init__.py index b65e40c1..a92a5209 100644 --- a/src/PyPartMC/__init__.py +++ b/src/PyPartMC/__init__.py @@ -4,13 +4,13 @@ # pylint: disable=invalid-name import importlib.metadata +import inspect # pylint: disable=invalid-name,wrong-import-position import os from collections import namedtuple from contextlib import contextmanager from pathlib import Path -import inspect import nanobind @@ -81,7 +81,7 @@ def __generate_si(): ) # Hacky walkaround for missing docs in pdoc auto-generated documentation. -# After the switch to nanobind, the docs became empty despite "__doc__" being +# After the switch to nanobind, the docs became empty despite "__doc__" being # accessible in all of PyPartMC's objects. The code below manually populates # the "__all__" atrribute of the package. Additionally, functions in the generated # docs would be listed as nanobind objects with no additional documentation. diff --git a/tests/test_help.py b/tests/test_help.py index 23b7b2ef..b523bba5 100644 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -1,8 +1,9 @@ +import pydoc + import pytest import PyPartMC as ppmc -import pydoc @pytest.mark.parametrize( "obj", @@ -49,4 +50,4 @@ def test_help_output(obj): assert len(obj.__doc__) > 0 # get rid of whitespace and bars - assert "".join(obj.__doc__.split()) in "".join(help_output.replace("|", "").split()) \ No newline at end of file + assert "".join(obj.__doc__.split()) in "".join(help_output.replace("|", "").split()) From 8c291c5e232961476a8c7d5751f57a0ccc27f52e Mon Sep 17 00:00:00 2001 From: Griger5 Date: Fri, 29 Aug 2025 09:22:06 +0200 Subject: [PATCH 05/18] attempt fix of test_help failing (weird encoding in CI) --- .github/workflows/buildwheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/buildwheels.yml b/.github/workflows/buildwheels.yml index f2acdde9..af5e711a 100644 --- a/.github/workflows/buildwheels.yml +++ b/.github/workflows/buildwheels.yml @@ -69,6 +69,7 @@ jobs: env: # skip 32-bit, PyPy, and musllinux builds CIBW_SKIP: "*-win32 *-manylinux_i686 pp* *musllinux*" + CIBW_ENVIRONMENT_LINUX: PYTHONIOENCODING=utf8 CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel CIBW_ENVIRONMENT_WINDOWS: CMAKE_ARGS="-DCMAKE_MAKE_PROGRAM=D:/a/_temp/msys64/mingw64/bin/ninja.exe" CMAKE_PROGRAM_PATH="D:/a/_temp/msys64/usr/bin" CMAKE_GENERATOR="Ninja" TEMP="D:/a/_temp/" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel} From 5ee8cba6305621640e22e96f74419a4f4dfd61ee Mon Sep 17 00:00:00 2001 From: Griger5 Date: Fri, 29 Aug 2025 09:43:32 +0200 Subject: [PATCH 06/18] attempt fix of test_help failing (weird encoding in CI) --- .github/workflows/buildwheels.yml | 1 - tests/test_help.py | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildwheels.yml b/.github/workflows/buildwheels.yml index af5e711a..f2acdde9 100644 --- a/.github/workflows/buildwheels.yml +++ b/.github/workflows/buildwheels.yml @@ -69,7 +69,6 @@ jobs: env: # skip 32-bit, PyPy, and musllinux builds CIBW_SKIP: "*-win32 *-manylinux_i686 pp* *musllinux*" - CIBW_ENVIRONMENT_LINUX: PYTHONIOENCODING=utf8 CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel CIBW_ENVIRONMENT_WINDOWS: CMAKE_ARGS="-DCMAKE_MAKE_PROGRAM=D:/a/_temp/msys64/mingw64/bin/ninja.exe" CMAKE_PROGRAM_PATH="D:/a/_temp/msys64/usr/bin" CMAKE_GENERATOR="Ninja" TEMP="D:/a/_temp/" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel} diff --git a/tests/test_help.py b/tests/test_help.py index b523bba5..ec33851d 100644 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -1,4 +1,5 @@ import pydoc +import re import pytest @@ -48,6 +49,9 @@ def test_help_output(obj): help_output = pydoc.render_doc(obj) + processed_help_output = "".join(help_output.replace("|", "").split()) + processed_help_output = re.sub("\x08.", "", processed_help_output) + assert len(obj.__doc__) > 0 # get rid of whitespace and bars - assert "".join(obj.__doc__.split()) in "".join(help_output.replace("|", "").split()) + assert "".join(obj.__doc__.split()) in processed_help_output From 942ec5879775a4d6e4f0fd0894394a295a585ca7 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Tue, 2 Sep 2025 11:32:00 +0200 Subject: [PATCH 07/18] check __doc__ values on CI --- tests/test_help.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_help.py b/tests/test_help.py index ec33851d..ee9bafd3 100644 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -47,10 +47,11 @@ ), ) def test_help_output(obj): - help_output = pydoc.render_doc(obj) + # help_output = pydoc.render_doc(obj) + help_output = obj.__doc__ processed_help_output = "".join(help_output.replace("|", "").split()) - processed_help_output = re.sub("\x08.", "", processed_help_output) + # processed_help_output = re.sub("\x08.", "", processed_help_output) assert len(obj.__doc__) > 0 # get rid of whitespace and bars From 5b1c11fcd0b1a879399df8ae119b312b92b48ecb Mon Sep 17 00:00:00 2001 From: Griger5 Date: Tue, 2 Sep 2025 23:11:56 +0200 Subject: [PATCH 08/18] use plaintext renderer for pydoc --- tests/test_help.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_help.py b/tests/test_help.py index ee9bafd3..5223be68 100644 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -47,8 +47,8 @@ ), ) def test_help_output(obj): - # help_output = pydoc.render_doc(obj) - help_output = obj.__doc__ + help_output = pydoc.render_doc(obj, renderer=pydoc.plaintext) + # help_output = obj.__doc__ processed_help_output = "".join(help_output.replace("|", "").split()) # processed_help_output = re.sub("\x08.", "", processed_help_output) From c5f138e06667cee02e0710cd9b7ce2cda5155624 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Tue, 2 Sep 2025 23:45:59 +0200 Subject: [PATCH 09/18] bypass using pydoc.render_doc --- tests/test_help.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_help.py b/tests/test_help.py index 5223be68..13edb219 100644 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -1,3 +1,5 @@ +import contextlib +import io import pydoc import re @@ -47,8 +49,13 @@ ), ) def test_help_output(obj): - help_output = pydoc.render_doc(obj, renderer=pydoc.plaintext) + # help_output = pydoc.render_doc(obj, renderer=pydoc.plaintext) # help_output = obj.__doc__ + buffer = io.StringIO() + with contextlib.redirect_stdout(buffer): + help(obj) + + help_output = buffer.getvalue() processed_help_output = "".join(help_output.replace("|", "").split()) # processed_help_output = re.sub("\x08.", "", processed_help_output) From dd6c1d70dbb02e1074fed0c3f5d5e3749fb1789d Mon Sep 17 00:00:00 2001 From: Griger5 Date: Fri, 5 Sep 2025 17:20:02 +0200 Subject: [PATCH 10/18] skip secondary assert when testing functions --- tests/test_help.py | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/tests/test_help.py b/tests/test_help.py index 13edb219..c35f9073 100644 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -1,7 +1,5 @@ -import contextlib -import io +import inspect import pydoc -import re import pytest @@ -49,17 +47,13 @@ ), ) def test_help_output(obj): - # help_output = pydoc.render_doc(obj, renderer=pydoc.plaintext) - # help_output = obj.__doc__ - buffer = io.StringIO() - with contextlib.redirect_stdout(buffer): - help(obj) - - help_output = buffer.getvalue() - - processed_help_output = "".join(help_output.replace("|", "").split()) - # processed_help_output = re.sub("\x08.", "", processed_help_output) + help_output = pydoc.render_doc(obj, renderer=pydoc.plaintext) assert len(obj.__doc__) > 0 - # get rid of whitespace and bars - assert "".join(obj.__doc__.split()) in processed_help_output + + # help() output of functions is broken on CI + if inspect.isclass(obj): + # remove whitespace and bars + assert "".join(obj.__doc__.split()) in "".join( + help_output.replace("|", "").split() + ) From 61fa08203dccc3b8710b45de8aff2bfd5563c414 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Mon, 8 Sep 2025 17:30:21 +0200 Subject: [PATCH 11/18] debug github CI wtih tmate --- .github/workflows/pdoc.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml index 21da87be..5fbd0584 100644 --- a/.github/workflows/pdoc.yml +++ b/.github/workflows/pdoc.yml @@ -17,6 +17,9 @@ jobs: platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: + - uses: actions/checkout@v4 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - uses: actions/checkout@v2 with: submodules: recursive From adc5f6424800190030576d444a8611b83b0e7d28 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Mon, 8 Sep 2025 17:41:52 +0200 Subject: [PATCH 12/18] debug pdoc --- .github/workflows/pdoc.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml index 5fbd0584..d1496e12 100644 --- a/.github/workflows/pdoc.yml +++ b/.github/workflows/pdoc.yml @@ -17,9 +17,6 @@ jobs: platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v4 - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - uses: actions/checkout@v2 with: submodules: recursive @@ -40,3 +37,6 @@ jobs: BRANCH: pdoc FOLDER: html CLEAN: true + - uses: actions/checkout@v4 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 From ade3f5096feffa3f410b0ccb401a2152702c08c2 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Tue, 9 Sep 2025 09:54:59 +0200 Subject: [PATCH 13/18] disable buildwheels workflow --- .github/workflows/{buildwheels.yml => buildwheels.yml.off} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{buildwheels.yml => buildwheels.yml.off} (100%) diff --git a/.github/workflows/buildwheels.yml b/.github/workflows/buildwheels.yml.off similarity index 100% rename from .github/workflows/buildwheels.yml rename to .github/workflows/buildwheels.yml.off From 08a86368c9581fef284806914f72aaf310b85e18 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Thu, 11 Sep 2025 10:10:21 +0200 Subject: [PATCH 14/18] move where the flag is passed --- .github/workflows/pdoc.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml index d1496e12..ede01266 100644 --- a/.github/workflows/pdoc.yml +++ b/.github/workflows/pdoc.yml @@ -26,10 +26,9 @@ jobs: python-version: 3.12 - name: Build run: | - echo "PDOC_GENERATE_PYPARTMC_DOCS=True" >> $GITHUB_ENV pip install pdoc pip install -e . - PDOC_ALLOW_EXEC=1 python -We -m pdoc -o html PyPartMC + PDOC_ALLOW_EXEC=1 PDOC_GENERATE_PYPARTMC_DOCS=True python -We -m pdoc -o html PyPartMC - name: Deploy if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }} uses: JamesIves/github-pages-deploy-action@4.1.1 From 31336fbe535ac19f4ff92fd09d685d9ec7691509 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Thu, 11 Sep 2025 10:18:13 +0200 Subject: [PATCH 15/18] change when the tmate session is opened --- .github/workflows/pdoc.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml index ede01266..2002aa04 100644 --- a/.github/workflows/pdoc.yml +++ b/.github/workflows/pdoc.yml @@ -29,6 +29,9 @@ jobs: pip install pdoc pip install -e . PDOC_ALLOW_EXEC=1 PDOC_GENERATE_PYPARTMC_DOCS=True python -We -m pdoc -o html PyPartMC + - uses: actions/checkout@v4 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - name: Deploy if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }} uses: JamesIves/github-pages-deploy-action@4.1.1 @@ -36,6 +39,3 @@ jobs: BRANCH: pdoc FOLDER: html CLEAN: true - - uses: actions/checkout@v4 - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 From f3ba6b5c22a0aca72e2b45f7144402be22d3a7b8 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Thu, 11 Sep 2025 10:39:06 +0200 Subject: [PATCH 16/18] list html directory before it is deleted --- .github/workflows/pdoc.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml index 2002aa04..acb13919 100644 --- a/.github/workflows/pdoc.yml +++ b/.github/workflows/pdoc.yml @@ -29,9 +29,7 @@ jobs: pip install pdoc pip install -e . PDOC_ALLOW_EXEC=1 PDOC_GENERATE_PYPARTMC_DOCS=True python -We -m pdoc -o html PyPartMC - - uses: actions/checkout@v4 - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 + ls html/ - name: Deploy if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }} uses: JamesIves/github-pages-deploy-action@4.1.1 From aa93507f34b5ee20ddbe04e9e020b73424a48836 Mon Sep 17 00:00:00 2001 From: Griger5 Date: Thu, 11 Sep 2025 10:44:24 +0200 Subject: [PATCH 17/18] cat the docs html file --- .github/workflows/pdoc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml index acb13919..24dd36ae 100644 --- a/.github/workflows/pdoc.yml +++ b/.github/workflows/pdoc.yml @@ -30,6 +30,7 @@ jobs: pip install -e . PDOC_ALLOW_EXEC=1 PDOC_GENERATE_PYPARTMC_DOCS=True python -We -m pdoc -o html PyPartMC ls html/ + cat html/PyPartMC.html - name: Deploy if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }} uses: JamesIves/github-pages-deploy-action@4.1.1 From 1a9de5eb678cd904e3ceea6de82db63405d7ba1f Mon Sep 17 00:00:00 2001 From: Griger5 Date: Thu, 11 Sep 2025 10:54:23 +0200 Subject: [PATCH 18/18] clean up, enable buildwheels --- .github/workflows/{buildwheels.yml.off => buildwheels.yml} | 0 .github/workflows/pdoc.yml | 4 +--- src/PyPartMC/__init__.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) rename .github/workflows/{buildwheels.yml.off => buildwheels.yml} (100%) diff --git a/.github/workflows/buildwheels.yml.off b/.github/workflows/buildwheels.yml similarity index 100% rename from .github/workflows/buildwheels.yml.off rename to .github/workflows/buildwheels.yml diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml index 24dd36ae..f8a231c8 100644 --- a/.github/workflows/pdoc.yml +++ b/.github/workflows/pdoc.yml @@ -28,9 +28,7 @@ jobs: run: | pip install pdoc pip install -e . - PDOC_ALLOW_EXEC=1 PDOC_GENERATE_PYPARTMC_DOCS=True python -We -m pdoc -o html PyPartMC - ls html/ - cat html/PyPartMC.html + PDOC_ALLOW_EXEC=1 PDOC_GENERATE_PYPARTMC_DOCS=1 python -We -m pdoc -o html PyPartMC - name: Deploy if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }} uses: JamesIves/github-pages-deploy-action@4.1.1 diff --git a/src/PyPartMC/__init__.py b/src/PyPartMC/__init__.py index d37fbdfc..9c27ae04 100644 --- a/src/PyPartMC/__init__.py +++ b/src/PyPartMC/__init__.py @@ -87,7 +87,7 @@ def __generate_si(): # docs would be listed as nanobind objects with no additional documentation. # To solve that, dummy functions of the same name are created, and their "__doc__" # attribute is manually set to the "original" objects' "__doc__" -if os.getenv("PDOC_GENERATE_PYPARTMC_DOCS") == "True": +if os.getenv("PDOC_GENERATE_PYPARTMC_DOCS") == "1": all_items = [] for name, obj in inspect.getmembers( _PyPartMC # pylint: disable=undefined-variable