diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index fedfe0c19..647a52d8e 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -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 @@ -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: | @@ -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) }} diff --git a/README.rst b/README.rst index 8be79a0c1..2fc442f96 100644 --- a/README.rst +++ b/README.rst @@ -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. diff --git a/docs/source/contrib.rst b/docs/source/contrib.rst index 6dc4643a9..c53502294 100644 --- a/docs/source/contrib.rst +++ b/docs/source/contrib.rst @@ -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 `_ 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. diff --git a/pydoctor/sphinx.py b/pydoctor/sphinx.py index 5766934a7..dbec697a3 100644 --- a/pydoctor/sphinx.py +++ b/pydoctor/sphinx.py @@ -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 diff --git a/setup.cfg b/setup.cfg index 5b477ca74..c71d31d41 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 @@ -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. @@ -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