envsub 0.2.0__tar.gz → 1.0.0__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.
- {envsub-0.2.0 → envsub-1.0.0}/.github/workflows/build-wheels.yml +7 -8
- {envsub-0.2.0 → envsub-1.0.0}/.gitignore +1 -1
- {envsub-0.2.0 → envsub-1.0.0}/CHANGELOG.md +12 -3
- {envsub-0.2.0 → envsub-1.0.0}/Cargo.lock +20 -59
- {envsub-0.2.0 → envsub-1.0.0}/Cargo.toml +6 -4
- {envsub-0.2.0 → envsub-1.0.0}/Justfile +9 -0
- {envsub-0.2.0 → envsub-1.0.0}/PKG-INFO +12 -9
- {envsub-0.2.0 → envsub-1.0.0}/README.md +0 -1
- {envsub-0.2.0 → envsub-1.0.0}/docs/source/conf.py +6 -5
- {envsub-0.2.0 → envsub-1.0.0}/pyproject.toml +21 -9
- {envsub-0.2.0 → envsub-1.0.0}/scripts/get_version.py +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/scripts/write_changelog.py +0 -0
- {envsub-0.2.0 → envsub-1.0.0/src/python}/envsub/__main__.py +2 -1
- {envsub-0.2.0 → envsub-1.0.0/src/python}/envsub/envsub.pyi +0 -1
- {envsub-0.2.0/src → envsub-1.0.0/src/rust}/lib.rs +2 -1
- envsub-1.0.0/tests/test_main.py +12 -0
- {envsub-0.2.0 → envsub-1.0.0}/tests/test_subenv.py +3 -5
- {envsub-0.2.0 → envsub-1.0.0}/uv.lock +199 -338
- envsub-0.2.0/tests/test_main.py +0 -12
- {envsub-0.2.0 → envsub-1.0.0}/.github/workflows/build-sdist.yml +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/.github/workflows/publish-doc.yml +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/.github/workflows/publish-pypi.yml +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/.github/workflows/release.yml +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/.github/workflows/tests-artifacts.yml +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/.github/workflows/tests.yml +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/.python-version +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/LICENSE +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/docs/Makefile +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/docs/make.bat +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/docs/source/changelog.md +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/docs/source/develop/envsub/envsub.__main__.md +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/docs/source/develop/envsub/envsub.envsub.md +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/docs/source/develop/envsub/envsub.md +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/docs/source/develop/index.rst +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/docs/source/index.md +0 -0
- {envsub-0.2.0 → envsub-1.0.0/src/python}/envsub/__init__.py +0 -0
- {envsub-0.2.0 → envsub-1.0.0/src/python}/envsub/py.typed +0 -0
- {envsub-0.2.0/src → envsub-1.0.0/src/rust}/subst.rs +0 -0
- {envsub-0.2.0 → envsub-1.0.0}/tests/__init__.py +0 -0
|
@@ -45,15 +45,15 @@ jobs:
|
|
|
45
45
|
- os: linux
|
|
46
46
|
manylinux: auto
|
|
47
47
|
target: armv7
|
|
48
|
-
interpreter: 3.
|
|
48
|
+
interpreter: 3.11 3.12 3.13 3.14 3.14t 3.15 3.15t
|
|
49
49
|
- os: linux
|
|
50
50
|
manylinux: auto
|
|
51
51
|
target: ppc64le
|
|
52
|
-
interpreter: 3.
|
|
52
|
+
interpreter: 3.11 3.12 3.13 3.14 3.14t 3.15 3.15t
|
|
53
53
|
- os: linux
|
|
54
54
|
manylinux: auto
|
|
55
55
|
target: s390x
|
|
56
|
-
interpreter: 3.
|
|
56
|
+
interpreter: 3.11 3.12 3.13 3.14 3.14t 3.15 3.15t
|
|
57
57
|
- os: linux
|
|
58
58
|
manylinux: auto
|
|
59
59
|
target: x86_64
|
|
@@ -71,15 +71,14 @@ jobs:
|
|
|
71
71
|
target: x86_64
|
|
72
72
|
- os: macos
|
|
73
73
|
target: aarch64
|
|
74
|
-
interpreter: 3.9 pypy3.9 pypy3.10
|
|
75
74
|
|
|
76
75
|
- os: windows
|
|
77
76
|
target: x86_64
|
|
78
|
-
interpreter: 3.11 3.12 3.13
|
|
77
|
+
interpreter: 3.11 3.12 3.13 3.14 3.14t 3.15 3.15t
|
|
79
78
|
- os: windows
|
|
80
79
|
target: i686
|
|
81
80
|
python-architecture: x86
|
|
82
|
-
interpreter: 3.11 3.12 3.13
|
|
81
|
+
interpreter: 3.11 3.12 3.13 3.14 3.14t 3.15 3.15t
|
|
83
82
|
exclude:
|
|
84
83
|
# Exclude failed build
|
|
85
84
|
- os: windows
|
|
@@ -92,7 +91,7 @@ jobs:
|
|
|
92
91
|
- name: set up python
|
|
93
92
|
uses: actions/setup-python@v5
|
|
94
93
|
with:
|
|
95
|
-
python-version: '3.
|
|
94
|
+
python-version: '3.14'
|
|
96
95
|
architecture: ${{ matrix.python-architecture || 'x64' }}
|
|
97
96
|
- name: install build deps
|
|
98
97
|
run: pip install twine
|
|
@@ -102,7 +101,7 @@ jobs:
|
|
|
102
101
|
with:
|
|
103
102
|
target: ${{ matrix.target }}
|
|
104
103
|
manylinux: ${{ matrix.manylinux }}
|
|
105
|
-
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.
|
|
104
|
+
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.11 3.12 3.13 3.14 3.14t 3.15 3.15t pypy3.11' }}
|
|
106
105
|
rust-toolchain: 'stable'
|
|
107
106
|
docker-options: -e CI
|
|
108
107
|
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
## 1.0.0 - 2026-11-11
|
|
2
|
+
|
|
3
|
+
* Add support of python 3.14 and 3.15
|
|
4
|
+
* Remove support of python 3.9 and 3.10
|
|
5
|
+
|
|
6
|
+
## 0.2.1 - 2025-04-17
|
|
7
|
+
|
|
8
|
+
* Fix links in documentation.
|
|
9
|
+
|
|
1
10
|
## 0.2.0 - 2025-02-16
|
|
2
11
|
|
|
3
|
-
* Replace twine by us publish
|
|
4
|
-
* Add some badges
|
|
12
|
+
* Replace twine by us publish.
|
|
13
|
+
* Add some badges.
|
|
5
14
|
|
|
6
15
|
## 0.1.18 - 2025-02-16
|
|
7
16
|
|
|
8
|
-
* Publish documentation using github pages
|
|
17
|
+
* Publish documentation using github pages.
|
|
9
18
|
|
|
10
19
|
## 0.1.17 - 2024-11-10
|
|
11
20
|
* Fix license inconcistency. This is MIT license.
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
# This file is automatically @generated by Cargo.
|
|
2
2
|
# It is not intended for manual editing.
|
|
3
|
-
version =
|
|
4
|
-
|
|
5
|
-
[[package]]
|
|
6
|
-
name = "autocfg"
|
|
7
|
-
version = "1.4.0"
|
|
8
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
|
10
|
-
|
|
11
|
-
[[package]]
|
|
12
|
-
name = "cfg-if"
|
|
13
|
-
version = "1.0.0"
|
|
14
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
-
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
3
|
+
version = 4
|
|
16
4
|
|
|
17
5
|
[[package]]
|
|
18
6
|
name = "envsub"
|
|
19
|
-
version = "0.
|
|
7
|
+
version = "1.0.0"
|
|
20
8
|
dependencies = [
|
|
21
9
|
"pyo3",
|
|
22
10
|
]
|
|
@@ -27,32 +15,17 @@ version = "0.5.0"
|
|
|
27
15
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
28
16
|
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
29
17
|
|
|
30
|
-
[[package]]
|
|
31
|
-
name = "indoc"
|
|
32
|
-
version = "2.0.5"
|
|
33
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
34
|
-
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
|
|
35
|
-
|
|
36
18
|
[[package]]
|
|
37
19
|
name = "libc"
|
|
38
20
|
version = "0.2.161"
|
|
39
21
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
40
22
|
checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1"
|
|
41
23
|
|
|
42
|
-
[[package]]
|
|
43
|
-
name = "memoffset"
|
|
44
|
-
version = "0.9.1"
|
|
45
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
46
|
-
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
47
|
-
dependencies = [
|
|
48
|
-
"autocfg",
|
|
49
|
-
]
|
|
50
|
-
|
|
51
24
|
[[package]]
|
|
52
25
|
name = "once_cell"
|
|
53
|
-
version = "1.
|
|
26
|
+
version = "1.21.4"
|
|
54
27
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
55
|
-
checksum = "
|
|
28
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
56
29
|
|
|
57
30
|
[[package]]
|
|
58
31
|
name = "portable-atomic"
|
|
@@ -62,46 +35,41 @@ checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2"
|
|
|
62
35
|
|
|
63
36
|
[[package]]
|
|
64
37
|
name = "proc-macro2"
|
|
65
|
-
version = "1.0.
|
|
38
|
+
version = "1.0.107"
|
|
66
39
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
67
|
-
checksum = "
|
|
40
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
68
41
|
dependencies = [
|
|
69
42
|
"unicode-ident",
|
|
70
43
|
]
|
|
71
44
|
|
|
72
45
|
[[package]]
|
|
73
46
|
name = "pyo3"
|
|
74
|
-
version = "0.
|
|
47
|
+
version = "0.29.3"
|
|
75
48
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
76
|
-
checksum = "
|
|
49
|
+
checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655"
|
|
77
50
|
dependencies = [
|
|
78
|
-
"cfg-if",
|
|
79
|
-
"indoc",
|
|
80
51
|
"libc",
|
|
81
|
-
"memoffset",
|
|
82
52
|
"once_cell",
|
|
83
53
|
"portable-atomic",
|
|
84
54
|
"pyo3-build-config",
|
|
85
55
|
"pyo3-ffi",
|
|
86
56
|
"pyo3-macros",
|
|
87
|
-
"unindent",
|
|
88
57
|
]
|
|
89
58
|
|
|
90
59
|
[[package]]
|
|
91
60
|
name = "pyo3-build-config"
|
|
92
|
-
version = "0.
|
|
61
|
+
version = "0.29.3"
|
|
93
62
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
94
|
-
checksum = "
|
|
63
|
+
checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb"
|
|
95
64
|
dependencies = [
|
|
96
|
-
"once_cell",
|
|
97
65
|
"target-lexicon",
|
|
98
66
|
]
|
|
99
67
|
|
|
100
68
|
[[package]]
|
|
101
69
|
name = "pyo3-ffi"
|
|
102
|
-
version = "0.
|
|
70
|
+
version = "0.29.3"
|
|
103
71
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
104
|
-
checksum = "
|
|
72
|
+
checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330"
|
|
105
73
|
dependencies = [
|
|
106
74
|
"libc",
|
|
107
75
|
"pyo3-build-config",
|
|
@@ -109,9 +77,9 @@ dependencies = [
|
|
|
109
77
|
|
|
110
78
|
[[package]]
|
|
111
79
|
name = "pyo3-macros"
|
|
112
|
-
version = "0.
|
|
80
|
+
version = "0.29.3"
|
|
113
81
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
114
|
-
checksum = "
|
|
82
|
+
checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6"
|
|
115
83
|
dependencies = [
|
|
116
84
|
"proc-macro2",
|
|
117
85
|
"pyo3-macros-backend",
|
|
@@ -121,13 +89,12 @@ dependencies = [
|
|
|
121
89
|
|
|
122
90
|
[[package]]
|
|
123
91
|
name = "pyo3-macros-backend"
|
|
124
|
-
version = "0.
|
|
92
|
+
version = "0.29.3"
|
|
125
93
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
126
|
-
checksum = "
|
|
94
|
+
checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3"
|
|
127
95
|
dependencies = [
|
|
128
96
|
"heck",
|
|
129
97
|
"proc-macro2",
|
|
130
|
-
"pyo3-build-config",
|
|
131
98
|
"quote",
|
|
132
99
|
"syn",
|
|
133
100
|
]
|
|
@@ -143,9 +110,9 @@ dependencies = [
|
|
|
143
110
|
|
|
144
111
|
[[package]]
|
|
145
112
|
name = "syn"
|
|
146
|
-
version = "2.0.
|
|
113
|
+
version = "2.0.119"
|
|
147
114
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
148
|
-
checksum = "
|
|
115
|
+
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
|
149
116
|
dependencies = [
|
|
150
117
|
"proc-macro2",
|
|
151
118
|
"quote",
|
|
@@ -154,18 +121,12 @@ dependencies = [
|
|
|
154
121
|
|
|
155
122
|
[[package]]
|
|
156
123
|
name = "target-lexicon"
|
|
157
|
-
version = "0.
|
|
124
|
+
version = "0.13.5"
|
|
158
125
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
159
|
-
checksum = "
|
|
126
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
160
127
|
|
|
161
128
|
[[package]]
|
|
162
129
|
name = "unicode-ident"
|
|
163
130
|
version = "1.0.13"
|
|
164
131
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
165
132
|
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
|
|
166
|
-
|
|
167
|
-
[[package]]
|
|
168
|
-
name = "unindent"
|
|
169
|
-
version = "0.2.3"
|
|
170
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
171
|
-
checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "envsub"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "1.0.0"
|
|
4
4
|
authors = ["Guillaume Gauvrit <guillaume@gauvr.it>"]
|
|
5
|
-
edition = "
|
|
5
|
+
edition = "2024"
|
|
6
6
|
description = "A text preprocessing tool with environment variable substitution and default value support."
|
|
7
|
-
license = "
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-file = "LICENSE"
|
|
8
9
|
readme = "README.md"
|
|
9
10
|
|
|
10
11
|
[dependencies]
|
|
11
|
-
pyo3 = { version = "0.
|
|
12
|
+
pyo3 = { version = "0.29", features = ["abi3-py311", "extension-module"] }
|
|
12
13
|
|
|
13
14
|
[lib]
|
|
14
15
|
name = "envsub"
|
|
15
16
|
crate-type = ["staticlib"]
|
|
17
|
+
path = "src/rust/lib.rs"
|
|
16
18
|
|
|
17
19
|
[package.metadata.maturin]
|
|
18
20
|
bindings = "pyo3"
|
|
@@ -4,6 +4,9 @@ develop:
|
|
|
4
4
|
uv run maturin develop
|
|
5
5
|
|
|
6
6
|
install:
|
|
7
|
+
uv sync --group dev --frozen
|
|
8
|
+
|
|
9
|
+
update:
|
|
7
10
|
uv sync --group dev
|
|
8
11
|
|
|
9
12
|
doc:
|
|
@@ -22,6 +25,12 @@ lf:
|
|
|
22
25
|
uv run pytest --lf -vvv
|
|
23
26
|
|
|
24
27
|
|
|
28
|
+
fmt:
|
|
29
|
+
cargo fmt
|
|
30
|
+
uv run ruff check --fix .
|
|
31
|
+
uv run ruff format src/python tests
|
|
32
|
+
|
|
33
|
+
|
|
25
34
|
release major_minor_patch: && changelog
|
|
26
35
|
#!/bin/bash
|
|
27
36
|
cargo release {{major_minor_patch}} --no-confirm --no-tag --no-push --no-publish --execute
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: envsub
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Classifier: License :: OSI Approved :: MIT License
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
6
11
|
Classifier: Programming Language :: Rust
|
|
7
12
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
8
13
|
Classifier: Topic :: Text Processing
|
|
@@ -17,22 +22,20 @@ Provides-Extra: docs
|
|
|
17
22
|
License-File: LICENSE
|
|
18
23
|
Summary: A text preprocessing tool with environment variable substitution.
|
|
19
24
|
Keywords: environment,substitution,variables
|
|
20
|
-
Author: Guillaume Gauvrit <guillaume@gauvr.it>
|
|
21
25
|
Author-email: Guillaume Gauvrit <guillaume@gauvr.it>
|
|
22
|
-
License: MIT
|
|
23
|
-
Requires-Python: >=3.
|
|
26
|
+
License: MIT
|
|
27
|
+
Requires-Python: >=3.11
|
|
24
28
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
25
|
-
Project-URL:
|
|
26
|
-
Project-URL: Documentation, https://mardiros.github.io/
|
|
27
|
-
Project-URL:
|
|
29
|
+
Project-URL: Changelog, https://mardiros.github.io/envsub/changelog.html
|
|
30
|
+
Project-URL: Documentation, https://mardiros.github.io/envsub/
|
|
31
|
+
Project-URL: Homepage, https://github.com/mardiros/envsub/
|
|
28
32
|
Project-URL: Issues, https://github.com/mardiros/envsub/issues
|
|
29
|
-
Project-URL:
|
|
33
|
+
Project-URL: Repository, https://github.com/mardiros/envsub.git
|
|
30
34
|
|
|
31
35
|
# envsub
|
|
32
36
|
|
|
33
37
|
[](https://mardiros.github.io/envsub/)
|
|
34
38
|
[](https://github.com/mardiros/envsub/actions/workflows/tests.yml)
|
|
35
|
-
[](https://codeclimate.com/github/mardiros/envsub/maintainability)
|
|
36
39
|
|
|
37
40
|
**envsub** is a text preprocessing tool that performs environment variable
|
|
38
41
|
substitution in files, with support for default values. Written in Rust and
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://mardiros.github.io/envsub/)
|
|
4
4
|
[](https://github.com/mardiros/envsub/actions/workflows/tests.yml)
|
|
5
|
-
[](https://codeclimate.com/github/mardiros/envsub/maintainability)
|
|
6
5
|
|
|
7
6
|
**envsub** is a text preprocessing tool that performs environment variable
|
|
8
7
|
substitution in files, with support for default values. Written in Rust and
|
|
@@ -10,17 +10,18 @@
|
|
|
10
10
|
# add these directories to sys.path here. If the directory is relative to the
|
|
11
11
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
12
12
|
#
|
|
13
|
-
import os
|
|
14
13
|
import sys
|
|
15
|
-
|
|
16
14
|
import tomllib
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
rootpath = Path(__file__).parents[2]
|
|
17
18
|
|
|
18
|
-
sys.path.insert(0,
|
|
19
|
+
sys.path.insert(0, str(rootpath / "src"))
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
# -- Project information -----------------------------------------------------
|
|
22
23
|
def _get_project_meta():
|
|
23
|
-
with open("
|
|
24
|
+
with open(str(rootpath / "pyproject.toml"), "rb") as pyproject:
|
|
24
25
|
return tomllib.load(pyproject)["project"]
|
|
25
26
|
|
|
26
27
|
|
|
@@ -46,7 +47,7 @@ extensions = [
|
|
|
46
47
|
]
|
|
47
48
|
|
|
48
49
|
autodoc2_packages = [
|
|
49
|
-
{"path": "
|
|
50
|
+
{"path": str(rootpath / "envsub")},
|
|
50
51
|
]
|
|
51
52
|
|
|
52
53
|
autodoc2_module_all_regexes = [
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "envsub"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "1.0.0"
|
|
4
4
|
description = "A text preprocessing tool with environment variable substitution."
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
license = { text = "MIT
|
|
6
|
+
license = { text = "MIT" }
|
|
7
7
|
authors = [{ name = "Guillaume Gauvrit", email = "guillaume@gauvr.it" }]
|
|
8
|
-
requires-python = ">=3.
|
|
8
|
+
requires-python = ">=3.11"
|
|
9
9
|
keywords = ["environment", "substitution", "variables"]
|
|
10
10
|
classifiers = [
|
|
11
11
|
"License :: OSI Approved :: MIT License",
|
|
12
12
|
"Programming Language :: Python :: 3",
|
|
13
|
+
"Programming Language :: Python :: 3.11",
|
|
14
|
+
"Programming Language :: Python :: 3.12",
|
|
15
|
+
"Programming Language :: Python :: 3.13",
|
|
16
|
+
"Programming Language :: Python :: 3.14",
|
|
17
|
+
"Programming Language :: Python :: 3.15",
|
|
13
18
|
"Programming Language :: Rust",
|
|
14
19
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
15
20
|
"Topic :: Text Processing",
|
|
@@ -42,20 +47,27 @@ docs = [
|
|
|
42
47
|
"myst-parser >=4.0.0,<5; python_version >= '3.10'",
|
|
43
48
|
]
|
|
44
49
|
|
|
45
|
-
|
|
46
50
|
[project.scripts]
|
|
47
|
-
envsub = "envsub:
|
|
51
|
+
envsub = "envsub.__main__:main"
|
|
48
52
|
|
|
49
53
|
[project.urls]
|
|
50
|
-
Homepage = "https://
|
|
51
|
-
Documentation = "https://mardiros.github.io/
|
|
54
|
+
Homepage = "https://github.com/mardiros/envsub/"
|
|
55
|
+
Documentation = "https://mardiros.github.io/envsub/"
|
|
52
56
|
Repository = "https://github.com/mardiros/envsub.git"
|
|
53
57
|
Issues = "https://github.com/mardiros/envsub/issues"
|
|
54
|
-
Changelog = "https://mardiros.github.io/
|
|
58
|
+
Changelog = "https://mardiros.github.io/envsub/changelog.html"
|
|
59
|
+
|
|
60
|
+
[tool.pyright]
|
|
61
|
+
extraPaths = ["src/python"]
|
|
62
|
+
include = ["src/python", "tests"]
|
|
63
|
+
typeCheckingMode = "strict"
|
|
64
|
+
reportMissingTypeStubs = false
|
|
65
|
+
venvPath = ".venv"
|
|
55
66
|
|
|
56
67
|
[tool.maturin]
|
|
57
68
|
bindings = "pyo3"
|
|
69
|
+
python-source = "src/python"
|
|
58
70
|
|
|
59
71
|
[build-system]
|
|
60
|
-
requires = ["maturin>=1.
|
|
72
|
+
requires = ["maturin>=1.16,<2.0"]
|
|
61
73
|
build-backend = "maturin"
|
|
File without changes
|
|
File without changes
|
|
@@ -3,12 +3,13 @@ A module executable from the shell, it read stdin, it writes std out.
|
|
|
3
3
|
|
|
4
4
|
```bash
|
|
5
5
|
$ echo "db: ${DATABASE_URL-sqlite:///}" > config.yml
|
|
6
|
-
$
|
|
6
|
+
$ python -m envsub < config.yml
|
|
7
7
|
db: sqlite:///
|
|
8
8
|
```
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
import sys
|
|
12
|
+
|
|
12
13
|
from .envsub import sub
|
|
13
14
|
|
|
14
15
|
|
|
@@ -98,7 +98,8 @@ impl RustTextIOWrapper {
|
|
|
98
98
|
Ok(slf)
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
pub fn __exit__(&mut self, _exc_type:
|
|
101
|
+
pub fn __exit__(&mut self, _exc_type: Py<PyAny>, _exc_value: Py<PyAny>, _traceback: Py<PyAny>) {
|
|
102
|
+
}
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
#[pyfunction]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import io
|
|
2
|
+
|
|
3
|
+
from envsub.__main__ import main
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_main(monkeypatch):
|
|
7
|
+
monkeypatch.setenv("NAME", "World")
|
|
8
|
+
stdout = io.StringIO()
|
|
9
|
+
monkeypatch.setattr("sys.stdin", io.StringIO("Hello, ${NAME}!"))
|
|
10
|
+
monkeypatch.setattr("sys.stdout", stdout)
|
|
11
|
+
main()
|
|
12
|
+
assert stdout.getvalue() == "Hello, World!"
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
1
|
from io import StringIO
|
|
2
|
+
|
|
4
3
|
import pytest
|
|
5
4
|
import yaml
|
|
6
|
-
|
|
7
5
|
from envsub import sub
|
|
8
6
|
|
|
9
7
|
|
|
@@ -120,9 +118,9 @@ def test_readline(envvars, params):
|
|
|
120
118
|
line = upstream.readline()
|
|
121
119
|
assert line == params["expected"][1]
|
|
122
120
|
line = upstream.readline()
|
|
123
|
-
assert line ==
|
|
121
|
+
assert line == ""
|
|
124
122
|
line = upstream.readline()
|
|
125
|
-
assert line ==
|
|
123
|
+
assert line == ""
|
|
126
124
|
|
|
127
125
|
|
|
128
126
|
@pytest.mark.parametrize(
|