Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pdoc3/pdoc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.10.0
Choose a base ref
...
head repository: pdoc3/pdoc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.11.5
Choose a head ref

Commits on Sep 24, 2021

  1. TST: use explicit ClassWithNew instead of typing.Generic

    typing.Generic doesn't have a __new__ method in 3.9.
    
    Fixes #355
    catern authored and kernc committed Sep 24, 2021
    Copy the full SHA
    4aa70de View commit details

Commits on Feb 3, 2022

  1. Leave trailing line break in reST directives (#385)

    * Add to `pdoc.test.Docformats.test_reST_include` to catch issue.
    
    * Add a single line-break at the end of `.. include::`ed files - except for when in a code block.
    
    * Minor change comment
    
    * Revert last 2 commits.
    
    * Don't consume trailing newline from reST directives.
    
    * [] itself a disjunctive list of characters
    howamith authored Feb 3, 2022
    Copy the full SHA
    2cce30a View commit details

Commits on Aug 19, 2022

  1. BUG: Skip __editable__ paths during iter_modules (#408)

    * Skip `__editable__` paths during `iter_modules`
    
    * Update pdoc/__init__.py
    abhinavsingh authored Aug 19, 2022
    Copy the full SHA
    60f77d2 View commit details

Commits on Oct 29, 2022

  1. Copy the full SHA
    fce8d98 View commit details
  2. CI: Fix mypy warning

    kernc committed Oct 29, 2022
    Copy the full SHA
    b3a56d9 View commit details
  3. Copy the full SHA
    80af5d4 View commit details

Commits on Dec 21, 2022

  1. Copy the full SHA
    3ecfbcf View commit details

Commits on Mar 9, 2024

  1. REF: Fix deprecation warnings for PEP224 docstrings of class variables (

    #437)
    
    * Update __init__.py
    
    ast.Str is deprecated and will be removed in Python 3.14;
    use ast.Constant instead
    
    * Update __init__.py
    
    Attribute s is deprecated and will be removed in Python 3.14;
    use value instead
    
    * Update __init__.py
    
    DeprecationWarning: Attribute s is deprecated and will be
    removed in Python 3.14; use value instead
    heseber authored Mar 9, 2024
    Copy the full SHA
    14cd51c View commit details

Commits on Mar 11, 2024

  1. Copy the full SHA
    bf256c6 View commit details
  2. Copy the full SHA
    8ce42f0 View commit details
  3. Copy the full SHA
    65459ea View commit details
  4. Copy the full SHA
    75d2c5f View commit details
  5. MNT: Fix flake8 errors

    kernc committed Mar 11, 2024
    Copy the full SHA
    da13281 View commit details
  6. MNT: Fix mypy errors

    kernc committed Mar 11, 2024
    Copy the full SHA
    26c98f5 View commit details
  7. Copy the full SHA
    641e7a8 View commit details
  8. Copy the full SHA
    96e9155 View commit details
  9. BUG: Added UnicodeDecodeError to list of expected exceptions in _pep2…

    …24_docstrings() (#396)
    
    Co-authored-by: Frank Pecher <frank.pecher@endress.com>
    frank101010 and Frank Pecher authored Mar 11, 2024
    Copy the full SHA
    cf5bffd View commit details

Commits on Jun 21, 2024

  1. BUG: Fix documenting classes that contain unittest.mock.Mock (#352)

    * BUG: Make `unittest.mock.Mock` not appear callable (fix #350)
    
    * Add class with mocks to unit test example package
    Terrance authored Jun 21, 2024
    Copy the full SHA
    56bbc9c View commit details

Commits on Jun 22, 2024

  1. ENH: Support MathJax inline $dollar-pattern$

    Fixes #410
    kernc committed Jun 22, 2024
    Copy the full SHA
    2c75136 View commit details
  2. Copy the full SHA
    357b450 View commit details
  3. REF: HTML: Don't Show Source Code button on module description

    Needlessly copies full module source verbatim.
    kernc committed Jun 22, 2024
    Copy the full SHA
    79cfcda View commit details
  4. Copy the full SHA
    ccc3658 View commit details
  5. Copy the full SHA
    9533631 View commit details
  6. Copy the full SHA
    2bb1179 View commit details
  7. CLN: Pass flake8 checks

    kernc committed Jun 22, 2024
    Copy the full SHA
    4eb45b5 View commit details
  8. BUG: Fix a fatal error preventing documentation generation in some ca…

    …ses (#302)
    
    * Update __init__.py
    
    Got a fatal exception on this line, which prevented the generation of the documentation.
    
    The problem is that some variable is initialized in a try bloc but still used out of it afterwards.
    If the getattr fails line 682 - which was my problem - then the variable is used without being initialized, which lead to fatal error.
    
    * Use `try-else` block
    mn3mos authored Jun 22, 2024
    Copy the full SHA
    3bf1cd8 View commit details
  9. BUG: Add newline at the end of HTML files

    Fixes #419
    kernc committed Jun 22, 2024
    Copy the full SHA
    c3fb554 View commit details
  10. ENH: Discern properties from variables (#277)

    * Possible way to address issue 276.
    This shows "property" if a variable is a property with a setter
    and/or a deleter and "ro-property" (read only property) if it is a property which
    does not have either a setter or getter.
    
    * Shorten comment line
    
    * Rename "vartype" to "kind".
    Also make property now show get/set/del depending on what
    is defined, e.g. propert/get/set
    
    * Remove unnecessary comment.
    
    * Make linter happy about line length.
    
    * REF: Make pdoc.Doc.obj point to raw property/descriptor
    
    * ENH: Introduce `Variable.kind: Literal["var","prop"]`
    johann-petrak authored Jun 22, 2024
    Copy the full SHA
    9b64f7f View commit details
  11. Copy the full SHA
    f7f053e View commit details
  12. Copy the full SHA
    53cb9b8 View commit details
  13. Copy the full SHA
    84ee28b View commit details
  14. Copy the full SHA
    d1136ea View commit details

Commits on Jun 24, 2024

  1. MNT: Bump to minimum Python 3.9

    kernc committed Jun 24, 2024
    Copy the full SHA
    80697eb View commit details

Commits on Jun 25, 2024

  1. Copy the full SHA
    94d26e8 View commit details

Commits on Jun 26, 2024

  1. Copy the full SHA
    69c4c24 View commit details
  2. Copy the full SHA
    66225f4 View commit details
  3. Copy the full SHA
    2a66eb2 View commit details

Commits on Nov 25, 2024

  1. CI: Fix mypy errors

    > pdoc/test/__init__.py:1727: error: Item "None" of "TextIOWrapper[_WrappedBuffer] | None" has no attribute "write"  [union-attr]
    kernc committed Nov 25, 2024
    Copy the full SHA
    2acbeeb View commit details

Commits on Nov 26, 2024

  1. Copy the full SHA
    c706361 View commit details
  2. Copy the full SHA
    6e8bdfd View commit details
  3. Copy the full SHA
    8793c67 View commit details
  4. BUG: Fix issues with --skip-errors

    Fixes #421
    kernc committed Nov 26, 2024
    Copy the full SHA
    e319570 View commit details
  5. BUG: Fix admonitions CSS margin

    kernc committed Nov 26, 2024
    Copy the full SHA
    4d7f935 View commit details
  6. Copy the full SHA
    78e771b View commit details
  7. REF: Format Optional as X | None

    Ref: 6e8bdfd ENH: Improve formatting of Optional, Union and collection.abc types
    Ref: #395
    
    Thanks @hhoppe
    kernc committed Nov 26, 2024
    Copy the full SHA
    115a168 View commit details
  8. Copy the full SHA
    224c228 View commit details
  9. Copy the full SHA
    0734db1 View commit details
  10. Copy the full SHA
    aab629c View commit details

Commits on Dec 13, 2024

  1. BUG: Fix bug with prebuilt Lunr.js index by including the crucial part

    Ref: ccc3658 ENH: Prebuild Lunr.js search index
    kernc committed Dec 13, 2024
    Copy the full SHA
    6330d7e View commit details
  2. BUG: Fix git_link_template not showing for property, cached_property (#…

    …451)
    
    * fix properties and cached_properties failing when adding git links
    
    see #450
    
    * fix whitespace for flake8
    
    * special case for namedtuple fields
    
    * add special case for member_descriptor
    
    * Extend existing _unwrap_descriptor() function
    
    ---------
    
    Co-authored-by: Kernc <kerncece@gmail.com>
    mivanit and kernc authored Dec 13, 2024
    Copy the full SHA
    f33f891 View commit details
15 changes: 0 additions & 15 deletions .codecov.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Default Checkout'
description: 'checkout & setup'
inputs:
python-version:
description: 'Python version'
required: true
default: '>=3'
runs:
using: "composite"
steps:
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~\AppData\Local\pip\Cache
~/Library/Caches/pip
key: ${{ runner.os }}-py${{ inputs.python-version }}
87 changes: 38 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -2,72 +2,61 @@ name: CI
on:
push: { branches: [master] }
pull_request: { branches: [master] }
schedule: [ cron: '12 2 * * 6' ] # Every Saturday, 02:12
schedule: [ cron: '12 2 6 * *' ]

jobs:
build:
name: Build
runs-on: ubuntu-18.04

test-matrix:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7]
include:
- python-version: 3.8
test-type: lint
- python-version: 3.8
test-type: docs

python-version: ['3.9', '>=3']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v2
name: Set up caches
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py${{ matrix.python-version }}
- run: pip install -U pip setuptools wheel && pip install -U .
- run: time python -m unittest -v pdoc.test

- name: Checkout repo
uses: actions/checkout@v2
lint-test-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
fetch-depth: 3
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
python-version: 3.11

- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -U .
- run: pip install -U pip setuptools wheel && pip install -U .

- name: Install lint dependencies
if: matrix.test-type == 'lint'
run: |
pip install flake8 coverage mypy types-Markdown
sudo apt update && sudo apt-get install \
texlive-xetex lmodern texlive-fonts-recommended # test_pdf_pandoc
wget -O/tmp/pandoc.deb https://github.com/jgm/pandoc/releases/download/2.10/pandoc-2.10-1-amd64.deb && sudo dpkg -i /tmp/pandoc.deb
- name: Install docs dependencies
if: matrix.test-type == 'docs'
run: pip install -e .
wget -O/tmp/pandoc.deb https://github.com/jgm/pandoc/releases/download/3.1.12.2/pandoc-3.1.12.2-1-amd64.deb && sudo dpkg -i /tmp/pandoc.deb
- run: find -name '*.md' | xargs .github/lint-markdown.sh
- run: flake8 pdoc setup.py
- run: mypy -p pdoc
- run: time coverage run -m unittest -v pdoc.test
- run: coverage report
- run: PDOC_TEST_PANDOC=1 time python -m unittest -v pdoc.test.CliTest.test_pdf_pandoc
- uses: actions/upload-artifact@v4
with:
name: Pdoc Documentation.pdf
path: /tmp/pdoc.pdf

- name: Test w/ Coverage, Lint
if: matrix.test-type == 'lint'
run: |
find -name '*.md' | xargs .github/lint-markdown.sh
flake8
mypy -p pdoc
time coverage run -m unittest -v pdoc.test
PDOC_TEST_PANDOC=1 time catchsegv python -m unittest -v pdoc.test.CliTest.test_pdf_pandoc
bash <(curl -s https://codecov.io/bash)
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
python-version: 3.11

- name: Test
if: '! matrix.test-type'
run: time python -m unittest -v pdoc.test
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Test docs
if: matrix.test-type == 'docs'
run: time doc/build.sh
- run: pip install -U pip setuptools wheel && pip install -e .
- run: time doc/build.sh
15 changes: 4 additions & 11 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -9,24 +9,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- uses: actions/cache@v2
name: Set up caches
with:
path: ~/.cache/pip
key: ${{ runner.os }}

- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 3
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- uses: ./.github/actions/setup
with:
python-version: 3.11

- name: Install dependencies
run: |
pip install -U pip setuptools wheel
41 changes: 41 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
0.11.5 (2024-12-13)
======
- A few default HTML template improvements

0.11.4 (2024-12-13)
======
- Fix Lunr.js prebuilt index introduced in v0.11.0
- Fix showing Git link (git_link_template) for property, cached_property,
namedtuple, and member_descriptor types

0.11.3 (2024-11-26)
======
- Format Optional as `X | None` (#395)
- Support configurable Python-Markdown extensions (#440)

0.11.2 (2024-11-25)
======
- Improve formatting of Optional, Union and `collection.abc` types (#395)
- In HTML, format long function params on multiple lines
- Fix issue with `--skip-errors` (#421)

0.11.1 (2024-06-26)
======
- Handle union type expressions (|) for Google style docstrings (#443)
- Fix bug with Lunr.js search when `node` in not available (#446)

0.11.0 (2024-06-22)
======
- Handle import of distutils on Python 3.12
- Discern properties from regular variables (#277)
- Prebuild Lunr.js search index if Node is available.
- Templates: Update CDN resource links
- Support MathJax inline $dollar-pattern$
- Fix documenting classes that contain `unittest.mock.Mock` (#352)
- Strengthen signature detection for pybind-generated modules
- Bump pandoc integration to v3
- Support Google Analytics 4
- Fix deprecation warnings for PEP224 docstrings of class variables (#437)
- Skip `__editable__` paths during `iter_modules` (#408)
- Various bug fixes and tweaks

0.10.0 (2021-08-03)
======
- Python 3.6+ required.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,14 +2,13 @@

pdoc
====

[![Build Status](https://img.shields.io/github/workflow/status/pdoc3/pdoc/CI?style=for-the-badge)](https://github.com/pdoc3/pdoc/actions)
[![Build Status](https://img.shields.io/github/actions/workflow/status/pdoc3/pdoc/ci.yml?branch=master&style=for-the-badge)](https://github.com/pdoc3/pdoc/actions)
[![Code Coverage](https://img.shields.io/codecov/c/gh/pdoc3/pdoc.svg?style=for-the-badge)](https://codecov.io/gh/pdoc3/pdoc)
[![pdoc3 on PyPI](https://img.shields.io/pypi/v/pdoc3.svg?color=blue&style=for-the-badge)](https://pypi.org/project/pdoc3)
[![package downloads](https://img.shields.io/pypi/dm/pdoc3.svg?color=skyblue&style=for-the-badge)](https://pypi.org/project/pdoc3)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/kernc?color=pink&style=for-the-badge)](https://github.com/sponsors/kernc)

Auto-generate API documentation for Python projects.
Auto-generate API documentation for Python 3+ projects.

[**Project website**](https://pdoc3.github.io/pdoc/)

14 changes: 10 additions & 4 deletions doc/build.sh
Original file line number Diff line number Diff line change
@@ -29,9 +29,9 @@ popd >/dev/null
if [ "$IS_RELEASE" ]; then
echo -e '\nAdding GAnalytics code\n'

ANALYTICS="<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;ga('create','UA-43663477-5','auto');ga('require','cleanUrlTracker',{indexFilename:'index.html',trailingSlash:'add'});ga('require','outboundLinkTracker',{events:['click','auxclick','contextmenu']});ga('require','maxScrollTracker');ga('require','pageVisibilityTracker');ga('send','pageview');setTimeout(function(){ga('send','event','pageview','view')},15000);</script><script async src='https://www.google-analytics.com/analytics.js'></script><script async src='https://cdnjs.cloudflare.com/ajax/libs/autotrack/2.4.1/autotrack.js'></script>"
ANALYTICS="<script async src='https://www.googletagmanager.com/gtag/js?id=G-BKZPJPR558'></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-BKZPJPR558');</script>"
find "$BUILDROOT" -name '*.html' -print0 |
xargs -0 -- sed -i "s#</body>#$ANALYTICS</body>#i"
xargs -0 -- sed -i "s#</head>#$ANALYTICS</head>#i"
ANALYTICS='<script data-ad-client="ca-pub-2900001379782823" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>'
find "$BUILDROOT" -name '*.html' -print0 |
xargs -0 -- sed -i "s#</head>#$ANALYTICS</head>#i"
@@ -41,6 +41,9 @@ fi
echo
echo 'Testing for broken links'
echo
problematic_urls='
https://www.gnu.org/licenses/agpl-3.0.html
'
pushd "$BUILDROOT" >/dev/null
grep -PR '<a .*?href=' |
sed -E "s/:.*?<a .*?href=([\"'])(.*?)/\t\2/g" |
@@ -58,9 +61,12 @@ for line in sys.stdin.readlines():
grep -v $'\t''$' |
while read -r line; do
while IFS=$'\t' read -r file url; do
echo "$file: $url"
[ -f "$url" ] ||
curl --silent --fail --retry 5 --retry-delay 5 --user-agent 'Mozilla/5.0 Firefox 61' "$url" >/dev/null 2>&1 ||
die "broken link in $file: $url"
curl --silent --fail --retry 3 --retry-delay 1 --connect-timeout 10 \
--user-agent 'Mozilla/5.0 Firefox 125' "$url" >/dev/null 2>&1 ||
grep -qF "$url" <(echo "$problematic_urls") ||
die "broken link in $file: $url"
done
done
popd >/dev/null
Loading