Skip to content

Commit

Permalink
Release pydoctor 24.3.3 (#767)
Browse files Browse the repository at this point in the history
* Remove support for python 3.13 until zopefoundation/zope.interface#292 is fixed

* Switch to pypi OIDC publishing.

* Add meta job to handle required jobs for protected branches.

* Unpin twisted requirement for the mypy environment.

* And fix the twisted intersphinx as a drive-by change.

---------

Co-authored-by: tristanlatr <tristanlatr@users.noreply.github.com>
Co-authored-by: Adi Roiban <adi.roiban@chevah.com>
  • Loading branch information
3 people committed May 17, 2024
1 parent 27f5d4d commit dca9625
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 17 deletions.
46 changes: 38 additions & 8 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ on:
pull_request:
branches: [ master ]


permissions:
contents: read


jobs:
unit_tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
python-version: [pypy-3.7, 3.7, 3.8, 3.9, '3.10', 3.11, '3.12', '3.13-dev']
# Re-enable 3.13-dev when https://github.com/zopefoundation/zope.interface/issues/292 is fixed
python-version: [pypy-3.7, 3.7, 3.8, 3.9, '3.10', 3.11, '3.12']
os: [ubuntu-22.04]
include:
- os: windows-latest
Expand Down Expand Up @@ -68,13 +74,19 @@ jobs:
needs: [unit_tests]
runs-on: ubuntu-latest

permissions:
contents: read
# The `id-token` permission is mandatory for trusted publishing
# See https://github.com/pypa/gh-action-pypi-publish
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.9
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.12

- name: Log system information
run: |
Expand All @@ -92,9 +104,27 @@ jobs:
python setup.py --quiet build check sdist bdist_wheel
ls -alh ./dist/
- name: Publish pydoctor to PyPI on tags
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
- name: Publish to PyPI - on tag
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1

# This is a meta-job to simplify PR CI enforcement configuration in GitHub.
# Inside the GitHub config UI you only configure this job as required.
# All the extra requirements are defined "as code" as part of the `needs`
# list for this job.
gha-required:
name: GHA Required
runs-on: ubuntu-latest
# The `if` condition is very important.
# If not set, the job will be skipped on failing dependencies.
if: ${{ !cancelled() }}
needs:
# This is the list of CI job that we are interested to pass before
# a merge.
# pypi-publish is skipped since this is only executed for a tag.
- unit_tests
steps:
- name: Require all successes
uses: re-actors/alls-green@3a2de129f0713010a71314c74e33c0e3ef90e696
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
jobs: ${{ toJSON(needs) }}
10 changes: 9 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,18 @@ What's New?
in development
^^^^^^^^^^^^^^

pydoctor 24.3.3
^^^^^^^^^^^^^^^

* Fix release pipeline.

pydoctor 24.3.0
^^^^^^^^^^^^^^^

This is the last major release to support Python 3.7.

* Drop support for Python 3.6.
* Add support for Python 3.12 and Python 3.13.
* Add support for Python 3.12.
* Astor is no longer a requirement starting at Python 3.9.
* `ExtRegistrar.register_post_processor()` now supports a `priority` argument that is an int.
Highest priority callables will be called first during post-processing.
Expand Down
10 changes: 8 additions & 2 deletions docs/source/contrib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,15 @@ Read more about reviewing:
Releasing and publishing a new package
--------------------------------------

Publishing to PyPI is done via a GitHub Actions workflow that is triggered when a tag is pushed. Version is configured in the ``setup.cfg``.
Publishing to PyPI is done via a GitHub Actions workflow.
The publish to PyPI is triggered when a tag is pushed.
Version is configured in the ``setup.cfg``.

The following process ensures correct version management:
The `pydoctor PyPI project <https://pypi.org/manage/project/pydoctor/settings/publishing>`_ is configured to accept trusted publishing via GitHub actions from the `unit.yaml` workflow.

If the release is done from another workflow file, the PyPI project management page needs to be updated.

The following process ensures correct version management:

- Create a branch: name it by the name of the new major ``pydoctor`` version, i.e. ``21.9.x``, re-use that same branch for bug-fixes.
- On the branch, update the version and release notes.
Expand Down
3 changes: 1 addition & 2 deletions pydoctor/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ def __init__(
project_name: Optional[str] = None
):
"""
@param project_name: Dummy argument to stay compatible with
L{twisted.python._pydoctor}.
@param project_name: Dummy argument.
"""
self._links: Dict[str, Tuple[str, str]] = {}
self._logger = logger
Expand Down
7 changes: 3 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pydoctor
version = 23.9.0.dev0
version = 24.3.3.dev0
author = Michael Hudson-Doyle
author_email = micahel@gmail.com
maintainer = Maarten ter Huurne
Expand Down Expand Up @@ -79,7 +79,7 @@ mypy =
hypothesis
pytest>=6.0.0
sphinx>=3.4.0
twisted @ git+https://github.com/twisted/twisted.git
twisted
types-requests
; FIXME: https://github.com/twisted/pydoctor/issues/504
; This is pinned for now as newer versions are breaking our static checks.
Expand Down Expand Up @@ -117,8 +117,7 @@ filterwarnings =
[tool:pydoctor]
intersphinx =
https://docs.python.org/3/objects.inv
; FIXME: use the official Twisted's docs when they update
https://tristanlatr.github.io/apidocs/twisted/objects.inv
https://docs.twisted.org/en/stable/api/objects.inv
https://urllib3.readthedocs.io/en/latest/objects.inv
https://requests.readthedocs.io/en/latest/objects.inv
https://www.attrs.org/en/stable/objects.inv
Expand Down

0 comments on commit dca9625

Please sign in to comment.