tomledit 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tomledit-0.1.1/.github/workflows/linting.yml +82 -0
- tomledit-0.1.1/.github/workflows/publish.yml +53 -0
- tomledit-0.1.1/.github/workflows/wheels.yml +120 -0
- tomledit-0.1.1/.gitignore +3 -0
- tomledit-0.1.1/CHANGELOG.md +5 -0
- tomledit-0.1.1/Cargo.lock +260 -0
- tomledit-0.1.1/Cargo.toml +17 -0
- tomledit-0.1.1/PKG-INFO +36 -0
- tomledit-0.1.1/README.md +21 -0
- tomledit-0.1.1/pyproject.toml +64 -0
- tomledit-0.1.1/renovate.json +9 -0
- tomledit-0.1.1/src/document.rs +194 -0
- tomledit-0.1.1/src/error.rs +20 -0
- tomledit-0.1.1/src/item.rs +44 -0
- tomledit-0.1.1/src/item_proxy.rs +1257 -0
- tomledit-0.1.1/src/lib.rs +18 -0
- tomledit-0.1.1/src/value.rs +208 -0
- tomledit-0.1.1/tests/__init__.py +0 -0
- tomledit-0.1.1/tests/test_tomledit.py +1582 -0
- tomledit-0.1.1/tomledit.pyi +78 -0
- tomledit-0.1.1/uv.lock +156 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: Linting
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
schedule:
|
|
11
|
+
- cron: "0 3 1 * *"
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
python:
|
|
16
|
+
name: Python
|
|
17
|
+
runs-on: ${{ matrix.image }}
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
os:
|
|
21
|
+
- Ubuntu
|
|
22
|
+
python-version:
|
|
23
|
+
- "3.10"
|
|
24
|
+
- "3.11"
|
|
25
|
+
- "3.12"
|
|
26
|
+
- "3.13"
|
|
27
|
+
- "3.14"
|
|
28
|
+
include:
|
|
29
|
+
- os: Ubuntu
|
|
30
|
+
image: ubuntu-latest
|
|
31
|
+
steps:
|
|
32
|
+
- name: Check out repository
|
|
33
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
34
|
+
with:
|
|
35
|
+
persist-credentials: false
|
|
36
|
+
|
|
37
|
+
- name: Set up python {{ matrix.python-version }}
|
|
38
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
39
|
+
with:
|
|
40
|
+
python-version: ${{ matrix.python-version }}
|
|
41
|
+
allow-prereleases: true
|
|
42
|
+
|
|
43
|
+
- name: Install uv
|
|
44
|
+
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
|
|
45
|
+
|
|
46
|
+
- name: Check lockfile
|
|
47
|
+
run: uv lock --locked --offline
|
|
48
|
+
|
|
49
|
+
- name: Install project
|
|
50
|
+
run: uv sync -p ${{ matrix.python-version }}
|
|
51
|
+
|
|
52
|
+
- name: Install ruff
|
|
53
|
+
uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1
|
|
54
|
+
|
|
55
|
+
- name: ruff check
|
|
56
|
+
run: ruff check .
|
|
57
|
+
|
|
58
|
+
- name: ruff format
|
|
59
|
+
run: ruff format --check .
|
|
60
|
+
|
|
61
|
+
- name: pytest
|
|
62
|
+
run: uv run pytest
|
|
63
|
+
|
|
64
|
+
rust:
|
|
65
|
+
name: Rust
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- name: Check out repository
|
|
69
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
70
|
+
with:
|
|
71
|
+
persist-credentials: false
|
|
72
|
+
|
|
73
|
+
- name: Install Rust toolchain
|
|
74
|
+
uses: dtolnay/rust-toolchain@stable
|
|
75
|
+
with:
|
|
76
|
+
components: clippy
|
|
77
|
+
|
|
78
|
+
- name: cargo fmt
|
|
79
|
+
run: cargo fmt --check
|
|
80
|
+
|
|
81
|
+
- name: cargo clippy
|
|
82
|
+
run: cargo clippy --all-targets -- -D warnings
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["Build wheels"]
|
|
6
|
+
types:
|
|
7
|
+
- completed
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
name: Publish to PyPI
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
if: >-
|
|
17
|
+
github.event.workflow_run.conclusion == 'success' &&
|
|
18
|
+
startsWith(github.event.workflow_run.head_branch, 'v')
|
|
19
|
+
permissions:
|
|
20
|
+
id-token: write
|
|
21
|
+
environment: pypi
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
24
|
+
with:
|
|
25
|
+
persist-credentials: false
|
|
26
|
+
ref: ${{ github.event.workflow_run.head_branch }}
|
|
27
|
+
|
|
28
|
+
- name: Verify tag matches package version
|
|
29
|
+
run: |
|
|
30
|
+
TAG="${{ github.event.workflow_run.head_branch }}"
|
|
31
|
+
VERSION="${TAG#v}"
|
|
32
|
+
PKG_VERSION=$(python3 -c "
|
|
33
|
+
import tomllib
|
|
34
|
+
with open('pyproject.toml', 'rb') as f:
|
|
35
|
+
print(tomllib.load(f)['project']['version'])
|
|
36
|
+
")
|
|
37
|
+
if [ "$VERSION" != "$PKG_VERSION" ]; then
|
|
38
|
+
echo "::error::Tag ${TAG} does not match pyproject.toml version ${PKG_VERSION}"
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
- name: Download artifacts from build workflow
|
|
43
|
+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
|
44
|
+
with:
|
|
45
|
+
path: dist
|
|
46
|
+
merge-multiple: true
|
|
47
|
+
run-id: ${{ github.event.workflow_run.id }}
|
|
48
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
49
|
+
|
|
50
|
+
- name: Publish to PyPI
|
|
51
|
+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
|
|
52
|
+
with:
|
|
53
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
name: Build wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
sdist:
|
|
17
|
+
name: Source distribution
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
21
|
+
with:
|
|
22
|
+
persist-credentials: false
|
|
23
|
+
|
|
24
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.14"
|
|
27
|
+
|
|
28
|
+
- name: Build sdist
|
|
29
|
+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
|
|
30
|
+
with:
|
|
31
|
+
command: sdist
|
|
32
|
+
args: --out dist
|
|
33
|
+
|
|
34
|
+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
35
|
+
with:
|
|
36
|
+
name: sdist
|
|
37
|
+
path: dist/*.tar.gz
|
|
38
|
+
|
|
39
|
+
wheels:
|
|
40
|
+
name: "${{ matrix.platform.target }} (${{ matrix.platform.os }})"
|
|
41
|
+
runs-on: ${{ matrix.platform.os }}
|
|
42
|
+
strategy:
|
|
43
|
+
fail-fast: false
|
|
44
|
+
matrix:
|
|
45
|
+
platform:
|
|
46
|
+
# Linux x86_64
|
|
47
|
+
- os: ubuntu-latest
|
|
48
|
+
target: x86_64-unknown-linux-gnu
|
|
49
|
+
manylinux: auto
|
|
50
|
+
# Linux aarch64
|
|
51
|
+
- os: ubuntu-latest
|
|
52
|
+
target: aarch64-unknown-linux-gnu
|
|
53
|
+
manylinux: auto
|
|
54
|
+
# Linux i686
|
|
55
|
+
- os: ubuntu-latest
|
|
56
|
+
target: i686-unknown-linux-gnu
|
|
57
|
+
manylinux: auto
|
|
58
|
+
# Linux armv7
|
|
59
|
+
- os: ubuntu-latest
|
|
60
|
+
target: armv7-unknown-linux-gnueabihf
|
|
61
|
+
manylinux: auto
|
|
62
|
+
# Linux s390x
|
|
63
|
+
- os: ubuntu-latest
|
|
64
|
+
target: s390x-unknown-linux-gnu
|
|
65
|
+
manylinux: auto
|
|
66
|
+
# Linux ppc64le
|
|
67
|
+
- os: ubuntu-latest
|
|
68
|
+
target: powerpc64le-unknown-linux-gnu
|
|
69
|
+
manylinux: auto
|
|
70
|
+
# musllinux x86_64
|
|
71
|
+
- os: ubuntu-latest
|
|
72
|
+
target: x86_64-unknown-linux-musl
|
|
73
|
+
manylinux: musllinux_1_1
|
|
74
|
+
# musllinux aarch64
|
|
75
|
+
- os: ubuntu-latest
|
|
76
|
+
target: aarch64-unknown-linux-musl
|
|
77
|
+
manylinux: musllinux_1_1
|
|
78
|
+
# macOS x86_64
|
|
79
|
+
- os: macos-latest
|
|
80
|
+
target: x86_64-apple-darwin
|
|
81
|
+
# macOS aarch64 (Apple Silicon)
|
|
82
|
+
- os: macos-latest
|
|
83
|
+
target: aarch64-apple-darwin
|
|
84
|
+
# Windows x86_64
|
|
85
|
+
- os: windows-latest
|
|
86
|
+
target: x86_64-pc-windows-msvc
|
|
87
|
+
# Windows i686
|
|
88
|
+
- os: windows-latest
|
|
89
|
+
target: i686-pc-windows-msvc
|
|
90
|
+
# Windows aarch64
|
|
91
|
+
- os: windows-latest
|
|
92
|
+
target: aarch64-pc-windows-msvc
|
|
93
|
+
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
96
|
+
with:
|
|
97
|
+
persist-credentials: false
|
|
98
|
+
|
|
99
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
100
|
+
with:
|
|
101
|
+
python-version: "3.14"
|
|
102
|
+
|
|
103
|
+
- name: Build wheels
|
|
104
|
+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
|
|
105
|
+
with:
|
|
106
|
+
target: ${{ matrix.platform.target }}
|
|
107
|
+
manylinux: ${{ matrix.platform.manylinux || 'auto' }}
|
|
108
|
+
args: --release --out dist --interpreter 3.10 3.11 3.12 3.13 3.14
|
|
109
|
+
before-script-linux: |
|
|
110
|
+
# Install OpenSSL development headers if needed
|
|
111
|
+
if command -v apt-get &> /dev/null; then
|
|
112
|
+
apt-get update && apt-get install -y libssl-dev
|
|
113
|
+
elif command -v apk &> /dev/null; then
|
|
114
|
+
apk add --no-cache openssl-dev
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
118
|
+
with:
|
|
119
|
+
name: wheels-${{ matrix.platform.target }}
|
|
120
|
+
path: dist/*.whl
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "cc"
|
|
7
|
+
version = "1.2.56"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"find-msvc-tools",
|
|
12
|
+
"shlex",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[[package]]
|
|
16
|
+
name = "equivalent"
|
|
17
|
+
version = "1.0.2"
|
|
18
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
19
|
+
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
20
|
+
|
|
21
|
+
[[package]]
|
|
22
|
+
name = "find-msvc-tools"
|
|
23
|
+
version = "0.1.9"
|
|
24
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
25
|
+
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
|
|
26
|
+
|
|
27
|
+
[[package]]
|
|
28
|
+
name = "hashbrown"
|
|
29
|
+
version = "0.16.1"
|
|
30
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
31
|
+
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
|
32
|
+
|
|
33
|
+
[[package]]
|
|
34
|
+
name = "heck"
|
|
35
|
+
version = "0.5.0"
|
|
36
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
37
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
38
|
+
|
|
39
|
+
[[package]]
|
|
40
|
+
name = "indexmap"
|
|
41
|
+
version = "2.13.0"
|
|
42
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
43
|
+
checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
|
|
44
|
+
dependencies = [
|
|
45
|
+
"equivalent",
|
|
46
|
+
"hashbrown",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[[package]]
|
|
50
|
+
name = "libc"
|
|
51
|
+
version = "0.2.182"
|
|
52
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
53
|
+
checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112"
|
|
54
|
+
|
|
55
|
+
[[package]]
|
|
56
|
+
name = "memchr"
|
|
57
|
+
version = "2.8.0"
|
|
58
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
59
|
+
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
|
60
|
+
|
|
61
|
+
[[package]]
|
|
62
|
+
name = "once_cell"
|
|
63
|
+
version = "1.21.3"
|
|
64
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
65
|
+
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
|
66
|
+
|
|
67
|
+
[[package]]
|
|
68
|
+
name = "portable-atomic"
|
|
69
|
+
version = "1.13.1"
|
|
70
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
71
|
+
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
|
|
72
|
+
|
|
73
|
+
[[package]]
|
|
74
|
+
name = "proc-macro2"
|
|
75
|
+
version = "1.0.106"
|
|
76
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
77
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
78
|
+
dependencies = [
|
|
79
|
+
"unicode-ident",
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
[[package]]
|
|
83
|
+
name = "pyo3"
|
|
84
|
+
version = "0.28.2"
|
|
85
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
86
|
+
checksum = "cf85e27e86080aafd5a22eae58a162e133a589551542b3e5cee4beb27e54f8e1"
|
|
87
|
+
dependencies = [
|
|
88
|
+
"libc",
|
|
89
|
+
"once_cell",
|
|
90
|
+
"portable-atomic",
|
|
91
|
+
"pyo3-build-config",
|
|
92
|
+
"pyo3-ffi",
|
|
93
|
+
"pyo3-macros",
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
[[package]]
|
|
97
|
+
name = "pyo3-build-config"
|
|
98
|
+
version = "0.28.2"
|
|
99
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
100
|
+
checksum = "8bf94ee265674bf76c09fa430b0e99c26e319c945d96ca0d5a8215f31bf81cf7"
|
|
101
|
+
dependencies = [
|
|
102
|
+
"python3-dll-a",
|
|
103
|
+
"target-lexicon",
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
[[package]]
|
|
107
|
+
name = "pyo3-ffi"
|
|
108
|
+
version = "0.28.2"
|
|
109
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
110
|
+
checksum = "491aa5fc66d8059dd44a75f4580a2962c1862a1c2945359db36f6c2818b748dc"
|
|
111
|
+
dependencies = [
|
|
112
|
+
"libc",
|
|
113
|
+
"pyo3-build-config",
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
[[package]]
|
|
117
|
+
name = "pyo3-macros"
|
|
118
|
+
version = "0.28.2"
|
|
119
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
120
|
+
checksum = "f5d671734e9d7a43449f8480f8b38115df67bef8d21f76837fa75ee7aaa5e52e"
|
|
121
|
+
dependencies = [
|
|
122
|
+
"proc-macro2",
|
|
123
|
+
"pyo3-macros-backend",
|
|
124
|
+
"quote",
|
|
125
|
+
"syn",
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
[[package]]
|
|
129
|
+
name = "pyo3-macros-backend"
|
|
130
|
+
version = "0.28.2"
|
|
131
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
132
|
+
checksum = "22faaa1ce6c430a1f71658760497291065e6450d7b5dc2bcf254d49f66ee700a"
|
|
133
|
+
dependencies = [
|
|
134
|
+
"heck",
|
|
135
|
+
"proc-macro2",
|
|
136
|
+
"pyo3-build-config",
|
|
137
|
+
"quote",
|
|
138
|
+
"syn",
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
[[package]]
|
|
142
|
+
name = "python3-dll-a"
|
|
143
|
+
version = "0.2.14"
|
|
144
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
145
|
+
checksum = "d381ef313ae70b4da5f95f8a4de773c6aa5cd28f73adec4b4a31df70b66780d8"
|
|
146
|
+
dependencies = [
|
|
147
|
+
"cc",
|
|
148
|
+
]
|
|
149
|
+
|
|
150
|
+
[[package]]
|
|
151
|
+
name = "quote"
|
|
152
|
+
version = "1.0.45"
|
|
153
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
154
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
155
|
+
dependencies = [
|
|
156
|
+
"proc-macro2",
|
|
157
|
+
]
|
|
158
|
+
|
|
159
|
+
[[package]]
|
|
160
|
+
name = "serde_core"
|
|
161
|
+
version = "1.0.228"
|
|
162
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
163
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
164
|
+
dependencies = [
|
|
165
|
+
"serde_derive",
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
[[package]]
|
|
169
|
+
name = "serde_derive"
|
|
170
|
+
version = "1.0.228"
|
|
171
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
172
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
173
|
+
dependencies = [
|
|
174
|
+
"proc-macro2",
|
|
175
|
+
"quote",
|
|
176
|
+
"syn",
|
|
177
|
+
]
|
|
178
|
+
|
|
179
|
+
[[package]]
|
|
180
|
+
name = "shlex"
|
|
181
|
+
version = "1.3.0"
|
|
182
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
183
|
+
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|
184
|
+
|
|
185
|
+
[[package]]
|
|
186
|
+
name = "syn"
|
|
187
|
+
version = "2.0.117"
|
|
188
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
189
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
190
|
+
dependencies = [
|
|
191
|
+
"proc-macro2",
|
|
192
|
+
"quote",
|
|
193
|
+
"unicode-ident",
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
[[package]]
|
|
197
|
+
name = "target-lexicon"
|
|
198
|
+
version = "0.13.5"
|
|
199
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
200
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
201
|
+
|
|
202
|
+
[[package]]
|
|
203
|
+
name = "toml_datetime"
|
|
204
|
+
version = "1.0.0+spec-1.1.0"
|
|
205
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
206
|
+
checksum = "32c2555c699578a4f59f0cc68e5116c8d7cabbd45e1409b989d4be085b53f13e"
|
|
207
|
+
dependencies = [
|
|
208
|
+
"serde_core",
|
|
209
|
+
]
|
|
210
|
+
|
|
211
|
+
[[package]]
|
|
212
|
+
name = "toml_edit"
|
|
213
|
+
version = "0.25.4+spec-1.1.0"
|
|
214
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
215
|
+
checksum = "7193cbd0ce53dc966037f54351dbbcf0d5a642c7f0038c382ef9e677ce8c13f2"
|
|
216
|
+
dependencies = [
|
|
217
|
+
"indexmap",
|
|
218
|
+
"toml_datetime",
|
|
219
|
+
"toml_parser",
|
|
220
|
+
"toml_writer",
|
|
221
|
+
"winnow",
|
|
222
|
+
]
|
|
223
|
+
|
|
224
|
+
[[package]]
|
|
225
|
+
name = "toml_parser"
|
|
226
|
+
version = "1.0.9+spec-1.1.0"
|
|
227
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
228
|
+
checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4"
|
|
229
|
+
dependencies = [
|
|
230
|
+
"winnow",
|
|
231
|
+
]
|
|
232
|
+
|
|
233
|
+
[[package]]
|
|
234
|
+
name = "toml_writer"
|
|
235
|
+
version = "1.0.6+spec-1.1.0"
|
|
236
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
237
|
+
checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
|
|
238
|
+
|
|
239
|
+
[[package]]
|
|
240
|
+
name = "tomledit"
|
|
241
|
+
version = "0.1.1"
|
|
242
|
+
dependencies = [
|
|
243
|
+
"pyo3",
|
|
244
|
+
"toml_edit",
|
|
245
|
+
]
|
|
246
|
+
|
|
247
|
+
[[package]]
|
|
248
|
+
name = "unicode-ident"
|
|
249
|
+
version = "1.0.24"
|
|
250
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
251
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
252
|
+
|
|
253
|
+
[[package]]
|
|
254
|
+
name = "winnow"
|
|
255
|
+
version = "0.7.15"
|
|
256
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
257
|
+
checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"
|
|
258
|
+
dependencies = [
|
|
259
|
+
"memchr",
|
|
260
|
+
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "tomledit"
|
|
3
|
+
license = "Apache-2.0 OR MIT"
|
|
4
|
+
version = "0.1.1"
|
|
5
|
+
edition = "2024"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
|
|
8
|
+
[lib]
|
|
9
|
+
name = "tomledit"
|
|
10
|
+
crate-type = ["cdylib"]
|
|
11
|
+
|
|
12
|
+
[dependencies]
|
|
13
|
+
toml_edit = "0.25"
|
|
14
|
+
|
|
15
|
+
[dependencies.pyo3]
|
|
16
|
+
version = "0.28"
|
|
17
|
+
features = ["generate-import-lib"]
|
tomledit-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tomledit
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
5
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Summary: Format-preserving TOML parser
|
|
8
|
+
Keywords: encoding,toml
|
|
9
|
+
Author: David Hotham
|
|
10
|
+
License-Expression: Apache-2.0 OR MIT
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
Project-URL: Repository, https://github.com/dimbleby/tomledit
|
|
14
|
+
|
|
15
|
+
# tomledit
|
|
16
|
+
|
|
17
|
+
A format-preserving TOML editor for Python, powered by Rust's
|
|
18
|
+
[toml_edit](https://docs.rs/toml_edit) via [pyo3](https://pyo3.rs).
|
|
19
|
+
|
|
20
|
+
Parse a TOML document, modify it like a native Python dict, and write it back
|
|
21
|
+
— comments, whitespace, and ordering are preserved.
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from tomledit import Document
|
|
27
|
+
|
|
28
|
+
doc = Document.parse(open("pyproject.toml").read())
|
|
29
|
+
|
|
30
|
+
doc["project"]["version"] = "2.0.0"
|
|
31
|
+
doc["project"]["keywords"].append("new-keyword")
|
|
32
|
+
del doc["project"]["optional-dependencies"]
|
|
33
|
+
|
|
34
|
+
open("pyproject.toml", "w").write(str(doc))
|
|
35
|
+
```
|
|
36
|
+
|
tomledit-0.1.1/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# tomledit
|
|
2
|
+
|
|
3
|
+
A format-preserving TOML editor for Python, powered by Rust's
|
|
4
|
+
[toml_edit](https://docs.rs/toml_edit) via [pyo3](https://pyo3.rs).
|
|
5
|
+
|
|
6
|
+
Parse a TOML document, modify it like a native Python dict, and write it back
|
|
7
|
+
— comments, whitespace, and ordering are preserved.
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
from tomledit import Document
|
|
13
|
+
|
|
14
|
+
doc = Document.parse(open("pyproject.toml").read())
|
|
15
|
+
|
|
16
|
+
doc["project"]["version"] = "2.0.0"
|
|
17
|
+
doc["project"]["keywords"].append("new-keyword")
|
|
18
|
+
del doc["project"]["optional-dependencies"]
|
|
19
|
+
|
|
20
|
+
open("pyproject.toml", "w").write(str(doc))
|
|
21
|
+
```
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tomledit"
|
|
3
|
+
version = "0.1.1"
|
|
4
|
+
description = "Format-preserving TOML parser"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "David Hotham" },
|
|
8
|
+
]
|
|
9
|
+
keywords = ["encoding", "toml"]
|
|
10
|
+
license = "Apache-2.0 OR MIT"
|
|
11
|
+
classifiers = [
|
|
12
|
+
"License :: OSI Approved :: Apache Software License",
|
|
13
|
+
"License :: OSI Approved :: MIT License",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
]
|
|
16
|
+
requires-python = ">=3.10"
|
|
17
|
+
dependencies = []
|
|
18
|
+
|
|
19
|
+
[project.urls]
|
|
20
|
+
Repository = "https://github.com/dimbleby/tomledit"
|
|
21
|
+
|
|
22
|
+
[dependency-groups]
|
|
23
|
+
dev = [
|
|
24
|
+
"pytest>=8.4.2",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[build-system]
|
|
28
|
+
requires = ["maturin>=1.0,<2.0"]
|
|
29
|
+
build-backend = "maturin"
|
|
30
|
+
|
|
31
|
+
[tool.maturin]
|
|
32
|
+
features = ["pyo3/extension-module"]
|
|
33
|
+
|
|
34
|
+
[tool.ruff.lint]
|
|
35
|
+
select = ["ALL"]
|
|
36
|
+
ignore = [
|
|
37
|
+
"C90", # mccabe
|
|
38
|
+
"COM", # flake8-commas
|
|
39
|
+
"CPY", # flake8-copyright
|
|
40
|
+
"D", # pydocstyle
|
|
41
|
+
"DOC", # pydoclint
|
|
42
|
+
"ERA", # eradicate
|
|
43
|
+
"PD", # pandas-vet
|
|
44
|
+
"PLR", # pylint-refactor
|
|
45
|
+
"T20", # flake8-print
|
|
46
|
+
"ANN401", # any-type
|
|
47
|
+
"E203", # whitespace before ':'
|
|
48
|
+
"S101", # assert-used
|
|
49
|
+
]
|
|
50
|
+
extend-safe-fixes = [
|
|
51
|
+
"TC", # flake8-type-checking
|
|
52
|
+
]
|
|
53
|
+
unfixable = [
|
|
54
|
+
"F841", # unused-variable
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[tool.ruff.lint.flake8-tidy-imports]
|
|
58
|
+
ban-relative-imports = "all"
|
|
59
|
+
|
|
60
|
+
[tool.ruff.lint.flake8-type-checking]
|
|
61
|
+
strict = true
|
|
62
|
+
|
|
63
|
+
[tool.ruff.lint.isort]
|
|
64
|
+
required-imports = ["from __future__ import annotations"]
|