diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac2277a..f94581b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,9 +28,9 @@ jobs: if: startsWith(github.ref, 'refs/tags/') steps: - name: Check out the repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: '3.x' - name: Install dependencies @@ -55,9 +55,9 @@ jobs: needs: build-test steps: - name: Check out the repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: '3.x' - name: Install dependencies diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ab93fa5..e0ca1b3 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -58,9 +58,9 @@ jobs: Write-Host "GITHUB_PATH: $env:PATH" Write-Host "CAIROCFFI_DLL_DIRECTORIES: $env:CAIROCFFI_DLL_DIRECTORIES" - name: Check out the repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: '3.x' - name: Install dependencies diff --git a/.github/workflows/documentation_testbuild.yml b/.github/workflows/documentation_testbuild.yml index 816c0f6..6d09fa5 100644 --- a/.github/workflows/documentation_testbuild.yml +++ b/.github/workflows/documentation_testbuild.yml @@ -46,9 +46,9 @@ jobs: Write-Host "GITHUB_PATH: $env:PATH" Write-Host "CAIROCFFI_DLL_DIRECTORIES: $env:CAIROCFFI_DLL_DIRECTORIES" - name: Check out the repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: '3.x' - name: Install dependencies diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index c941c5a..21a468c 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Run Labeler uses: crazy-max/ghaction-github-labeler@v6.0.0 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0b6b39c..36f396e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,13 +30,13 @@ jobs: strategy: matrix: os: [ windows-latest ] - python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ] + python-version: [ '3.11', '3.12', '3.13', '3.14' ] runs-on: ${{ matrix.os }} steps: - name: Check out the repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/pyproject.toml b/pyproject.toml index dbc6fd7..d8ec8b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ build-backend = "hatchling.build" name = "utils-COMobjects" description = "Package with various utilities to support COM object development with Python based on PyWin32" readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.11" # only license identifier from https://spdx.org/licenses/ are allowed license = { text = "GPL-3.0-only" } # keywords for easier look-up on PyPI @@ -26,7 +26,6 @@ authors = [ # options under https://pypi.org/classifiers/ classifiers = [ "Programming Language :: Python", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -111,8 +110,8 @@ bump_map = {"feat" = "MINOR", "fix" = "PATCH", "BREAKING CHANGE" = "MAJOR"} # with Initial Commit in changelog commit_parser ="^(?P[Ii]nitial [Cc]ommit|feat|fix|refactor|perf|docs|style|test|chore|build|ci|revert|BREAKING CHANGE)(\\((?P[^)]+)\\))?(:\\s(?P.*))?" changelog_pattern = "^([Ii]nitial [Cc]ommit|feat|fix|docs|style|refactor|perf|test|chore|build|ci|revert|BREAKING CHANGE).*" -change_type_map = { feat = "Features", fix = "Bug fixes", refactor = "Refactoring", perf = "performance improvements", docs = "Documentation", style = "Code style", test = "Testing", chore = "Chores", build = "Build system", ci = "Continuous Integration" } -change_type_order = ["BREAKING CHANGE", "feat", "fix", "refactor", "perf", "docs", "style", "test", "chore", "build", "ci"] +change_type_map = { feat = "Features", fix = "Bug fixes", refactor = "Code refactoring", perf = "Performance improvements", docs = "Documentation", style = "Code style", test = "Testing", chore = "Chores", build = "Build system", ci = "Continuous Integration" } +change_type_order = ["BREAKING CHANGE", "Features", "Bug fixes", "Code refactoring", "Performance improvements", "Documentation", "Code style", "Testing", "Chore", "Build System", "Continuous Integration", "Initial Commit"] ################## @@ -327,7 +326,7 @@ debug = "cov --no-cov -s --pdb --pdbcls=IPython.core.debugger:Pdb {args}" # Hatch testing environment matrix for various Python versions replacing the functionality of tox [[tool.hatch.envs.test.matrix]] template = ["test"] -python = ["3.10", "3.11", "3.12", "3.13", "3.14"] +python = ["3.11", "3.12", "3.13", "3.14"] # Hatch default linting environment for "hatch fmt" [tool.hatch.envs.hatch-static-analysis] diff --git a/src/utils_COMobjects/version.py b/src/utils_COMobjects/version.py index e82a981..a0dfa5a 100644 --- a/src/utils_COMobjects/version.py +++ b/src/utils_COMobjects/version.py @@ -6,7 +6,7 @@ # ruff and mypy per file settings # others -# ruff: noqa: PLC0415 +# ruff: noqa: E302, PLC0415 # fmt: off @@ -14,11 +14,11 @@ def _get_hatch_version(): """Compute the most up-to-date version number in a development environment. - Returns `None` if Hatchling is not installed, e.g. in a production environment. - For more details, see . """ import os + # preparation for Pathlib + # from pathlib import path try: from hatchling.metadata.core import ProjectMetadata @@ -33,9 +33,19 @@ def _get_hatch_version(): err_msg = "pyproject.toml not found although hatchling is installed" raise RuntimeError(err_msg) root = os.path.dirname(pyproject_toml) - metadata = ProjectMetadata(root=root, plugin_manager=PluginManager()) - # Version can be either statically set in pyproject.toml or computed dynamically: - return metadata.core.version or metadata.hatch.version.cached + # preparation for Pathlib + # root = Path(pyproject_toml).parent + # Temporarily set cwd to project root for PEP 517 compliance. + old_cwd = os.getcwd() + # preparation for Pathlib + # old_cwd = Path.cwd() + os.chdir(root) + try: + metadata = ProjectMetadata(root=str(root), plugin_manager=PluginManager()) + # Version can be static in pyproject.toml or computed dynamically: + return metadata.core.version or metadata.hatch.version.cached + finally: + os.chdir(old_cwd) def _get_importlib_metadata_version():