From b1965a216af41c7e503753c63551d894fac8399d Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Thu, 4 Jan 2024 14:28:40 +0000 Subject: [PATCH] [v1.1.0] Drop Python 3.7 and add support for Python 3.12 (#120) * docs: update python supported versions list * docs: update changelog * chore: bump up release to 1.0.6 * chore: CI only covers supported versions * fix: deploying package uses py3.8 instead of py3.7 * fix: exclude 3.13 * fix: switch release from 1.0.6 to 1.1.0 * refactor: replace deprecated package `distutils` `distutils` was deprecated and removed in Python 3.12 [1]. `distutils.dir_util.copy_tree` function can be replaced by the `shutil.copytree` counterpart. [1]: https://docs.python.org/3.10/whatsnew/3.10.html#distutils-deprecated * docs: added deprecated distutils fix to changelog --------- Co-authored-by: PauloASilva --- .github/workflows/deploy.yml | 6 +++--- .github/workflows/test.yml | 2 +- README.md | 2 +- docs/CHANGELOG.md | 6 ++++++ mkdocs_monorepo_plugin/merger.py | 4 ++-- setup.py | 8 ++++---- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 44e7422..4764949 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - python-version: ["3", "3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@master @@ -37,7 +37,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@master with: - python-version: 3.7 + python-version: 3.8 - name: Install Python dependencies run: ./__tests__/setup-pip.sh - name: Build Docs @@ -64,7 +64,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@master with: - python-version: 3.7 + python-version: 3.8 - name: Build Python distribution run: | pip install wheel diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffdd156..af41e76 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - python-version: ["3", "3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@main diff --git a/README.md b/README.md index d6ad42b..58bc9d8 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ $ tree . ## Supported Versions -- Python 3 — 3.7, 3.8, 3.9, 3.10, 3.11 +- Python 3.8, 3.9, 3.10, 3.11, 3.12 - [Mkdocs] 1.0.4 and above. ## Changelog diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 608a28f..dd2656a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.1.0 + +- Dropped official support for Python 3.7 +- Added official support for Python 3.12 +- Replaced deprecated package `distutils` [#118](https://github.com/backstage/mkdocs-monorepo-plugin/pull/118) courtesy of @PauloASilva and @piotr1212 + ## 1.0.4 - Resolve a bug that prevented this plugin from working with mkdocs >= v1.4.0 diff --git a/mkdocs_monorepo_plugin/merger.py b/mkdocs_monorepo_plugin/merger.py index 5a1d318..c6dc109 100644 --- a/mkdocs_monorepo_plugin/merger.py +++ b/mkdocs_monorepo_plugin/merger.py @@ -13,7 +13,7 @@ # limitations under the License. from tempfile import TemporaryDirectory -from distutils.dir_util import copy_tree +from shutil import copytree import logging import os @@ -59,7 +59,7 @@ def merge(self): dest_dir = os.path.join(self.temp_docs_dir.name, *split_alias) if os.path.exists(source_dir): - copy_tree(source_dir, dest_dir) + copytree(source_dir, dest_dir, dirs_exist_ok=True) for file_abs_path in Path(source_dir).rglob('*.md'): file_abs_path = str(file_abs_path) # python 3.5 compatibility if os.path.isfile(file_abs_path): diff --git a/setup.py b/setup.py index 06dc8dc..f7827ff 100644 --- a/setup.py +++ b/setup.py @@ -3,12 +3,12 @@ setuptools.setup( name='mkdocs-monorepo-plugin', - version='1.0.5', + version='1.1.0', description='Plugin for adding monorepository support in Mkdocs.', long_description=""" This introduces support for the !include syntax in mkdocs.yml, allowing you to import additional Mkdocs navigation. It enables large or complex repositories to have their own sets of docs/ folders, whilst generating only a single Mkdocs site. - This is built and maintained by the engineering community at Spotify. + This is built and maintained by the Backstage open source team. """, # noqa: E501 keywords='mkdocs monorepo', url='https://github.com/backstage/mkdocs-monorepo-plugin', @@ -26,11 +26,11 @@ 'Intended Audience :: Information Technology', 'Programming Language :: Python', 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11' + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12' ], packages=setuptools.find_packages(), entry_points={