From 1d83e23db65e7c26a8db7186302ce6efd453eee8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 21:18:28 +0000 Subject: [PATCH 1/5] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.2 → v0.14.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.2...v0.14.3) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4717b7..5ac4a62 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: args: [--py37-plus] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.14.2' + rev: 'v0.14.3' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] From 60622c3b85b1b7d34d160accce0b1fd681ce4d12 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Tue, 4 Nov 2025 14:41:29 +0800 Subject: [PATCH 2/5] feat: add String.type property to retrieve the string type Close #443 Signed-off-by: Frost Ming --- CHANGELOG.md | 1 + tomlkit/items.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0673cc4..d39e972 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - Custom encoders can now receive `_parent` and `_sort_keys` parameters to enable proper encoding of nested structures. ([#429](https://github.com/python-poetry/tomlkit/issues/429)) +- Add `String.type` property to get the string type. ([#443](https://github.com/python-poetry/tomlkit/issues/443)) ## Fixed diff --git a/tomlkit/items.py b/tomlkit/items.py index d326d49..f285467 100644 --- a/tomlkit/items.py +++ b/tomlkit/items.py @@ -1867,6 +1867,10 @@ def value(self) -> str: def as_string(self) -> str: return f"{self._t.value}{decode(self._original)}{self._t.value}" + @property + def type(self) -> StringType: + return self._t + def __add__(self: ItemT, other: str) -> ItemT: if not isinstance(other, str): return NotImplemented From 09b085b0acd8287523f1b9c2def664ad188a7a8d Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Tue, 13 Jan 2026 08:45:34 +0800 Subject: [PATCH 3/5] chore: update Python version and GitHub Actions to use latest versions Signed-off-by: Frost Ming --- .github/workflows/integration.yml | 10 +++++----- .github/workflows/release.yml | 4 ++-- .github/workflows/tests.yml | 10 +++++----- pyproject.toml | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 749a5d9..c318870 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: os: [ Ubuntu, macOS, Windows ] - python-version: [ "3.11" ] + python-version: [ "3.12" ] project: [ "poetry", "poetry-core" ] include: - os: Ubuntu @@ -34,16 +34,16 @@ jobs: shell: bash steps: - name: Checkout Source (${{ matrix.project }}) - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: repository: python-poetry/${{ matrix.project }} - name: Checkout Source (tomlkit) - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: tomlkit - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -61,7 +61,7 @@ jobs: run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") - name: Set up cache - uses: actions/cache@v3 + uses: actions/cache@v5 if: matrix.project != 'poetry-core' id: cache with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c9257e4..ebc4dcb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v6 with: submodules: "recursive" @@ -20,7 +20,7 @@ jobs: run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/} - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: 3.x diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5e50d22..351c79e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,16 +16,16 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-13, windows-latest] - python-version: [3.8, 3.9, "3.10", 3.11, 3.12, 3.13] + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.9, "3.10", 3.11, 3.12, 3.13, 3.14] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: "recursive" - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} allow-prereleases: true @@ -46,7 +46,7 @@ jobs: poetry env use python - name: Set up cache - uses: actions/cache@v4 + uses: actions/cache@v5 id: cache with: path: .venv diff --git a/pyproject.toml b/pyproject.toml index 7e479f2..0e2e4e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ include = [ ] [tool.poetry.dependencies] -python = ">=3.8" +python = ">=3.9" [tool.poetry.group.dev.dependencies] pytest = "^7.2.0" From b66f4b90466c3ce0f337bdc8056c4d92f002cfae Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Tue, 13 Jan 2026 08:46:08 +0800 Subject: [PATCH 4/5] chore: drop support for Python 3.8 and update CI matrix Signed-off-by: Frost Ming --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d39e972..95ec0cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed + +- Drop support for Python older than 3.9. Remove 3.8 from the CI matrix. + ### Added - Custom encoders can now receive `_parent` and `_sort_keys` parameters to enable proper encoding of nested structures. ([#429](https://github.com/python-poetry/tomlkit/issues/429)) From 89318385e1e9e802049f0a2658bb656cc96ab58b Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Tue, 13 Jan 2026 08:48:48 +0800 Subject: [PATCH 5/5] chore: update poetry.lock for Python version changes and remove deprecated dependencies Signed-off-by: Frost Ming --- poetry.lock | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/poetry.lock b/poetry.lock index dec568f..3d0754f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "alabaster" @@ -24,9 +24,6 @@ files = [ {file = "Babel-2.14.0.tar.gz", hash = "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363"}, ] -[package.dependencies] -pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} - [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] @@ -385,7 +382,7 @@ description = "Read metadata from Python packages" optional = false python-versions = ">=3.7" groups = ["dev"] -markers = "python_version < \"3.10\"" +markers = "python_version == \"3.9\"" files = [ {file = "importlib_metadata-6.7.0-py3-none-any.whl", hash = "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5"}, {file = "importlib_metadata-6.7.0.tar.gz", hash = "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4"}, @@ -698,19 +695,6 @@ pytest = ">=4.6" [package.extras] testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] -[[package]] -name = "pytz" -version = "2024.1" -description = "World timezone definitions, modern and historical" -optional = false -python-versions = "*" -groups = ["dev"] -markers = "python_version < \"3.9\"" -files = [ - {file = "pytz-2024.1-py2.py3-none-any.whl", hash = "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"}, - {file = "pytz-2024.1.tar.gz", hash = "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812"}, -] - [[package]] name = "pyyaml" version = "6.0.1" @@ -1054,7 +1038,7 @@ description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" groups = ["dev"] -markers = "python_version < \"3.10\"" +markers = "python_version == \"3.9\"" files = [ {file = "zipp-3.19.1-py3-none-any.whl", hash = "sha256:2828e64edb5386ea6a52e7ba7cdb17bb30a73a858f5eb6eb93d8d36f5ea26091"}, {file = "zipp-3.19.1.tar.gz", hash = "sha256:35427f6d5594f4acf82d25541438348c26736fa9b3afa2754bcd63cdb99d8e8f"}, @@ -1066,5 +1050,5 @@ test = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-it [metadata] lock-version = "2.1" -python-versions = ">=3.8" -content-hash = "432149d1ede5e9fe1d0759310ad2ae0c15f401eb6429ba37f58194bfa67b8bec" +python-versions = ">=3.9" +content-hash = "2528f55c9a960b658ee758585ba3b1c76546a8bf1c53fe61bc724e6eb045ade6"