pyrig-env 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.
- pyrig_env-1.0.0/LICENSE +21 -0
- pyrig_env-1.0.0/PKG-INFO +98 -0
- pyrig_env-1.0.0/README.md +71 -0
- pyrig_env-1.0.0/pyproject.toml +104 -0
- pyrig_env-1.0.0/pyproject.toml.orig +120 -0
- pyrig_env-1.0.0/src/pyrig_env/__init__.py +1 -0
- pyrig_env-1.0.0/src/pyrig_env/py.typed +0 -0
- pyrig_env-1.0.0/src/pyrig_env/rig/__init__.py +5 -0
- pyrig_env-1.0.0/src/pyrig_env/rig/configs/__init__.py +5 -0
- pyrig_env-1.0.0/src/pyrig_env/rig/configs/env.py +67 -0
pyrig_env-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Winipedia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pyrig_env-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyrig-env
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A pyrig plugin that contributes a .env file.
|
|
5
|
+
Keywords: pyrig
|
|
6
|
+
Author: Winipedia
|
|
7
|
+
Author-email: Winipedia <winipedia@gmx.de>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Typing :: Typed
|
|
16
|
+
Requires-Dist: pyrig>=18.58.2
|
|
17
|
+
Requires-Dist: pyrig-runtime>=3.23.9
|
|
18
|
+
Maintainer: Winipedia
|
|
19
|
+
Maintainer-email: Winipedia <winipedia@gmx.de>
|
|
20
|
+
Requires-Python: >=3.12
|
|
21
|
+
Project-URL: Changelog, https://github.com/Winipedia/pyrig-env/releases
|
|
22
|
+
Project-URL: Documentation, https://Winipedia.github.io/pyrig-env
|
|
23
|
+
Project-URL: Homepage, https://github.com/Winipedia/pyrig-env
|
|
24
|
+
Project-URL: Issues, https://github.com/Winipedia/pyrig-env/issues
|
|
25
|
+
Project-URL: Source, https://github.com/Winipedia/pyrig-env
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# pyrig-env
|
|
29
|
+
|
|
30
|
+
<!-- project-status -->
|
|
31
|
+
[](https://github.com/Winipedia/pyrig-env/actions/workflows/health_check.yml)
|
|
32
|
+
[](https://github.com/Winipedia/pyrig-env/actions/workflows/deploy.yml)
|
|
33
|
+
[](https://codecov.io/gh/Winipedia/pyrig-env)
|
|
34
|
+
<!-- code-quality -->
|
|
35
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
36
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
37
|
+
[](https://github.com/osprey-oss/deptry)
|
|
38
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
39
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
40
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
41
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
42
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
43
|
+
[](https://github.com/rvben/rumdl)
|
|
44
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
45
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
46
|
+
[](https://github.com/astral-sh/ruff)
|
|
47
|
+
[](https://github.com/Yelp/detect-secrets)
|
|
48
|
+
[](https://github.com/PyCQA/bandit)
|
|
49
|
+
[](https://github.com/mvdan/sh)
|
|
50
|
+
[](https://github.com/koalaman/shellcheck)
|
|
51
|
+
[](https://github.com/crate-ci/typos)
|
|
52
|
+
[](https://github.com/tombi-toml/tombi)
|
|
53
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
54
|
+
[](https://github.com/astral-sh/ty)
|
|
55
|
+
[](https://github.com/owenlamont/ryl)
|
|
56
|
+
<!-- tooling -->
|
|
57
|
+
[](https://github.com/astral-sh/uv)
|
|
58
|
+
[](https://github.com/Winipedia/pyrig)
|
|
59
|
+
[](https://github.com/Winipedia/pyrig-env)
|
|
60
|
+
[](https://github.com/j178/prek)
|
|
61
|
+
[](https://git-scm.com)
|
|
62
|
+
<!-- project-info -->
|
|
63
|
+
[](https://Winipedia.github.io/pyrig-env)
|
|
64
|
+
[](https://pypi.org/project/pyrig-env)
|
|
65
|
+
[](https://www.python.org)
|
|
66
|
+
[](https://github.com/Winipedia/pyrig-env/blob/main/LICENSE)
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
> A pyrig plugin that contributes a .env file.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Overview
|
|
75
|
+
|
|
76
|
+
pyrig-env is a [pyrig](https://github.com/Winipedia/pyrig) plugin that ensures
|
|
77
|
+
every project has an empty `.env` file for local environment variables and
|
|
78
|
+
secrets, excluded from version control so nothing sensitive is ever committed.
|
|
79
|
+
|
|
80
|
+
## What it adds
|
|
81
|
+
|
|
82
|
+
- **A managed `.env` file** — `pyrig sync` creates an empty `.env` file if one
|
|
83
|
+
is missing. Its content is never read or overwritten afterward, so you are
|
|
84
|
+
free to populate and maintain it by hand.
|
|
85
|
+
- **Version-control exclusion** — `.env` is automatically treated as
|
|
86
|
+
git-ignored, so secrets placed in it are never committed.
|
|
87
|
+
|
|
88
|
+
## Usage
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
uv add pyrig-env --dev
|
|
92
|
+
uv run pyrig sync
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Documentation
|
|
96
|
+
|
|
97
|
+
Full documentation, including the auto-generated API reference, is available on
|
|
98
|
+
the [documentation site](https://Winipedia.github.io/pyrig-env).
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# pyrig-env
|
|
2
|
+
|
|
3
|
+
<!-- project-status -->
|
|
4
|
+
[](https://github.com/Winipedia/pyrig-env/actions/workflows/health_check.yml)
|
|
5
|
+
[](https://github.com/Winipedia/pyrig-env/actions/workflows/deploy.yml)
|
|
6
|
+
[](https://codecov.io/gh/Winipedia/pyrig-env)
|
|
7
|
+
<!-- code-quality -->
|
|
8
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
9
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
10
|
+
[](https://github.com/osprey-oss/deptry)
|
|
11
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
12
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
13
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
14
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
15
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
16
|
+
[](https://github.com/rvben/rumdl)
|
|
17
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
18
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
19
|
+
[](https://github.com/astral-sh/ruff)
|
|
20
|
+
[](https://github.com/Yelp/detect-secrets)
|
|
21
|
+
[](https://github.com/PyCQA/bandit)
|
|
22
|
+
[](https://github.com/mvdan/sh)
|
|
23
|
+
[](https://github.com/koalaman/shellcheck)
|
|
24
|
+
[](https://github.com/crate-ci/typos)
|
|
25
|
+
[](https://github.com/tombi-toml/tombi)
|
|
26
|
+
[](https://github.com/pre-commit/pre-commit-hooks)
|
|
27
|
+
[](https://github.com/astral-sh/ty)
|
|
28
|
+
[](https://github.com/owenlamont/ryl)
|
|
29
|
+
<!-- tooling -->
|
|
30
|
+
[](https://github.com/astral-sh/uv)
|
|
31
|
+
[](https://github.com/Winipedia/pyrig)
|
|
32
|
+
[](https://github.com/Winipedia/pyrig-env)
|
|
33
|
+
[](https://github.com/j178/prek)
|
|
34
|
+
[](https://git-scm.com)
|
|
35
|
+
<!-- project-info -->
|
|
36
|
+
[](https://Winipedia.github.io/pyrig-env)
|
|
37
|
+
[](https://pypi.org/project/pyrig-env)
|
|
38
|
+
[](https://www.python.org)
|
|
39
|
+
[](https://github.com/Winipedia/pyrig-env/blob/main/LICENSE)
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
> A pyrig plugin that contributes a .env file.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Overview
|
|
48
|
+
|
|
49
|
+
pyrig-env is a [pyrig](https://github.com/Winipedia/pyrig) plugin that ensures
|
|
50
|
+
every project has an empty `.env` file for local environment variables and
|
|
51
|
+
secrets, excluded from version control so nothing sensitive is ever committed.
|
|
52
|
+
|
|
53
|
+
## What it adds
|
|
54
|
+
|
|
55
|
+
- **A managed `.env` file** — `pyrig sync` creates an empty `.env` file if one
|
|
56
|
+
is missing. Its content is never read or overwritten afterward, so you are
|
|
57
|
+
free to populate and maintain it by hand.
|
|
58
|
+
- **Version-control exclusion** — `.env` is automatically treated as
|
|
59
|
+
git-ignored, so secrets placed in it are never committed.
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
uv add pyrig-env --dev
|
|
65
|
+
uv run pyrig sync
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
Full documentation, including the auto-generated API reference, is available on
|
|
71
|
+
the [documentation site](https://Winipedia.github.io/pyrig-env).
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pyrig-env"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "A pyrig plugin that contributes a .env file."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
keywords = ["pyrig"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Operating System :: OS Independent",
|
|
12
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
13
|
+
"Programming Language :: Python :: 3.12",
|
|
14
|
+
"Programming Language :: Python :: 3.13",
|
|
15
|
+
"Programming Language :: Python :: 3.14",
|
|
16
|
+
"Typing :: Typed",
|
|
17
|
+
]
|
|
18
|
+
dependencies = [
|
|
19
|
+
"pyrig>=18.58.2",
|
|
20
|
+
"pyrig-runtime>=3.23.9",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[[project.authors]]
|
|
24
|
+
name = "Winipedia"
|
|
25
|
+
email = "winipedia@gmx.de"
|
|
26
|
+
|
|
27
|
+
[[project.maintainers]]
|
|
28
|
+
name = "Winipedia"
|
|
29
|
+
email = "winipedia@gmx.de"
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Changelog = "https://github.com/Winipedia/pyrig-env/releases"
|
|
33
|
+
Documentation = "https://Winipedia.github.io/pyrig-env"
|
|
34
|
+
Homepage = "https://github.com/Winipedia/pyrig-env"
|
|
35
|
+
Issues = "https://github.com/Winipedia/pyrig-env/issues"
|
|
36
|
+
Source = "https://github.com/Winipedia/pyrig-env"
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
pyrig-env = "pyrig_runtime.rig.cli.main:main"
|
|
40
|
+
|
|
41
|
+
[dependency-groups]
|
|
42
|
+
dev = [
|
|
43
|
+
"bandit>=1.9.4",
|
|
44
|
+
"deptry>=0.25.1",
|
|
45
|
+
"detect-secrets>=1.5.0",
|
|
46
|
+
"mkdocstrings[python]>=1.0.6",
|
|
47
|
+
"pre-commit-hooks>=6.0.0",
|
|
48
|
+
"prek>=0.4.14",
|
|
49
|
+
"pyrig>=18.58.2",
|
|
50
|
+
"pyrig-codecov>=3.16.43",
|
|
51
|
+
"pyrig-fixtures>=2.24.28",
|
|
52
|
+
"pyrig-pypi>=3.19.2",
|
|
53
|
+
"pytest>=9.1.1",
|
|
54
|
+
"pytest-cov>=7.1.0",
|
|
55
|
+
"pytest-randomly>=4.1.0",
|
|
56
|
+
"pytest-xdist>=3.8.0",
|
|
57
|
+
"ruff>=0.16.4",
|
|
58
|
+
"rumdl>=0.2.58",
|
|
59
|
+
"ryl>=0.21.0",
|
|
60
|
+
"shellcheck-py>=0.11.0.1",
|
|
61
|
+
"shfmt-py>=4.0.0",
|
|
62
|
+
"tombi>=1.4.1",
|
|
63
|
+
"ty>=0.0.73",
|
|
64
|
+
"typos>=1.49.0",
|
|
65
|
+
"zensical>=0.0.56",
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
[build-system]
|
|
69
|
+
requires = ["uv-build"]
|
|
70
|
+
build-backend = "uv_build"
|
|
71
|
+
|
|
72
|
+
[tool.deptry]
|
|
73
|
+
root = "src"
|
|
74
|
+
|
|
75
|
+
[tool.deptry.per_rule_ignores]
|
|
76
|
+
DEP002 = ["pyrig-runtime"]
|
|
77
|
+
|
|
78
|
+
[tool.pytest]
|
|
79
|
+
addopts = [
|
|
80
|
+
"--cov-branch",
|
|
81
|
+
"--cov-fail-under=100",
|
|
82
|
+
"--cov-report=term-missing:skip-covered",
|
|
83
|
+
"--cov-report=xml",
|
|
84
|
+
"--cov=pyrig_env",
|
|
85
|
+
"--dist=worksteal",
|
|
86
|
+
"--numprocesses=auto",
|
|
87
|
+
"--report-chars=a",
|
|
88
|
+
]
|
|
89
|
+
filterwarnings = ["error"]
|
|
90
|
+
strict = true
|
|
91
|
+
testpaths = ["tests"]
|
|
92
|
+
|
|
93
|
+
[tool.ruff.format]
|
|
94
|
+
docstring-code-format = true
|
|
95
|
+
|
|
96
|
+
[tool.ruff.lint]
|
|
97
|
+
ignore = ["CPY001"]
|
|
98
|
+
select = ["ALL"]
|
|
99
|
+
|
|
100
|
+
[tool.ruff.lint.per-file-ignores]
|
|
101
|
+
"tests/**/*.py" = ["S101"]
|
|
102
|
+
|
|
103
|
+
[tool.ruff.lint.pydocstyle]
|
|
104
|
+
convention = "google"
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pyrig-env"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "A pyrig plugin that contributes a .env file."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = [
|
|
9
|
+
"LICENSE",
|
|
10
|
+
]
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Winipedia", email = "winipedia@gmx.de" },
|
|
13
|
+
]
|
|
14
|
+
maintainers = [
|
|
15
|
+
{ name = "Winipedia", email = "winipedia@gmx.de" },
|
|
16
|
+
]
|
|
17
|
+
keywords = [
|
|
18
|
+
"pyrig",
|
|
19
|
+
]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Programming Language :: Python :: 3.14",
|
|
26
|
+
"Typing :: Typed",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"pyrig>=18.58.2",
|
|
30
|
+
"pyrig-runtime>=3.23.9",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Changelog = "https://github.com/Winipedia/pyrig-env/releases"
|
|
35
|
+
Documentation = "https://Winipedia.github.io/pyrig-env"
|
|
36
|
+
Homepage = "https://github.com/Winipedia/pyrig-env"
|
|
37
|
+
Issues = "https://github.com/Winipedia/pyrig-env/issues"
|
|
38
|
+
Source = "https://github.com/Winipedia/pyrig-env"
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
pyrig-env = "pyrig_runtime.rig.cli.main:main"
|
|
42
|
+
|
|
43
|
+
[dependency-groups]
|
|
44
|
+
dev = [
|
|
45
|
+
"bandit>=1.9.4",
|
|
46
|
+
"deptry>=0.25.1",
|
|
47
|
+
"detect-secrets>=1.5.0",
|
|
48
|
+
"mkdocstrings[python]>=1.0.6",
|
|
49
|
+
"pre-commit-hooks>=6.0.0",
|
|
50
|
+
"prek>=0.4.14",
|
|
51
|
+
"pyrig>=18.58.2",
|
|
52
|
+
"pyrig-codecov>=3.16.43",
|
|
53
|
+
"pyrig-fixtures>=2.24.28",
|
|
54
|
+
"pyrig-pypi>=3.19.2",
|
|
55
|
+
"pytest>=9.1.1",
|
|
56
|
+
"pytest-cov>=7.1.0",
|
|
57
|
+
"pytest-randomly>=4.1.0",
|
|
58
|
+
"pytest-xdist>=3.8.0",
|
|
59
|
+
"ruff>=0.16.4",
|
|
60
|
+
"rumdl>=0.2.58",
|
|
61
|
+
"ryl>=0.21.0",
|
|
62
|
+
"shellcheck-py>=0.11.0.1",
|
|
63
|
+
"shfmt-py>=4.0.0",
|
|
64
|
+
"tombi>=1.4.1",
|
|
65
|
+
"ty>=0.0.73",
|
|
66
|
+
"typos>=1.49.0",
|
|
67
|
+
"zensical>=0.0.56",
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
[build-system]
|
|
71
|
+
requires = [
|
|
72
|
+
"uv-build",
|
|
73
|
+
]
|
|
74
|
+
build-backend = "uv_build"
|
|
75
|
+
|
|
76
|
+
[tool.deptry]
|
|
77
|
+
root = "src"
|
|
78
|
+
|
|
79
|
+
[tool.deptry.per_rule_ignores]
|
|
80
|
+
DEP002 = [
|
|
81
|
+
"pyrig-runtime",
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
[tool.pytest]
|
|
85
|
+
addopts = [
|
|
86
|
+
"--cov-branch",
|
|
87
|
+
"--cov-fail-under=100",
|
|
88
|
+
"--cov-report=term-missing:skip-covered",
|
|
89
|
+
"--cov-report=xml",
|
|
90
|
+
"--cov=pyrig_env",
|
|
91
|
+
"--dist=worksteal",
|
|
92
|
+
"--numprocesses=auto",
|
|
93
|
+
"--report-chars=a",
|
|
94
|
+
]
|
|
95
|
+
filterwarnings = [
|
|
96
|
+
"error",
|
|
97
|
+
]
|
|
98
|
+
strict = true
|
|
99
|
+
testpaths = [
|
|
100
|
+
"tests",
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
[tool.ruff.format]
|
|
104
|
+
docstring-code-format = true
|
|
105
|
+
|
|
106
|
+
[tool.ruff.lint]
|
|
107
|
+
ignore = [
|
|
108
|
+
"CPY001",
|
|
109
|
+
]
|
|
110
|
+
select = [
|
|
111
|
+
"ALL",
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
[tool.ruff.lint.per-file-ignores]
|
|
115
|
+
"tests/**/*.py" = [
|
|
116
|
+
"S101",
|
|
117
|
+
]
|
|
118
|
+
|
|
119
|
+
[tool.ruff.lint.pydocstyle]
|
|
120
|
+
convention = "google"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""A pyrig plugin that manages a project's `.env` file."""
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Configuration for the target project's `.env` file."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from pyrig.rig.configs.base.config_file import DictConfigFile
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class EnvConfigFile(DictConfigFile):
|
|
10
|
+
"""Config file manager for the target project's `.env` file.
|
|
11
|
+
|
|
12
|
+
Only ever creates an empty `.env` file when one is missing; its content is
|
|
13
|
+
never read or overwritten afterward, so users are free to populate and
|
|
14
|
+
maintain secrets and local environment variables by hand. Excluded from
|
|
15
|
+
version control so those secrets are never committed.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
def _configs(self) -> dict[str, Any]:
|
|
19
|
+
"""Return an empty dict, since no `.env` content is required."""
|
|
20
|
+
return {}
|
|
21
|
+
|
|
22
|
+
def _dump(self, configs: dict[str, Any]) -> None:
|
|
23
|
+
"""Refuse to write non-empty content to `.env`; no-op for an empty dict.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
configs: Configuration to write. Must be empty.
|
|
27
|
+
|
|
28
|
+
Raises:
|
|
29
|
+
ValueError: If `configs` is non-empty.
|
|
30
|
+
"""
|
|
31
|
+
if not configs:
|
|
32
|
+
return
|
|
33
|
+
msg = f"""cannot dump to {self}"""
|
|
34
|
+
raise ValueError(msg)
|
|
35
|
+
|
|
36
|
+
def _load(self) -> dict[str, str | None]:
|
|
37
|
+
"""Refuse to load `.env` content.
|
|
38
|
+
|
|
39
|
+
Raises:
|
|
40
|
+
RuntimeError: Always.
|
|
41
|
+
"""
|
|
42
|
+
msg = f"{self} should never be loaded."
|
|
43
|
+
raise RuntimeError(msg)
|
|
44
|
+
|
|
45
|
+
def extension(self) -> str:
|
|
46
|
+
"""Return `""`, since `.env` has no extension."""
|
|
47
|
+
return ""
|
|
48
|
+
|
|
49
|
+
def extension_separator(self) -> str:
|
|
50
|
+
"""Return `""`, so the stem is not followed by a trailing dot."""
|
|
51
|
+
return ""
|
|
52
|
+
|
|
53
|
+
def is_correct(self) -> bool:
|
|
54
|
+
"""Return whether `.env` exists, without loading its content."""
|
|
55
|
+
return self.path().exists()
|
|
56
|
+
|
|
57
|
+
def parent_path(self) -> Path:
|
|
58
|
+
"""Return the project root as the parent directory."""
|
|
59
|
+
return Path()
|
|
60
|
+
|
|
61
|
+
def stem(self) -> str:
|
|
62
|
+
"""Return `".env"`."""
|
|
63
|
+
return ".env"
|
|
64
|
+
|
|
65
|
+
def version_control_ignored(self) -> bool:
|
|
66
|
+
"""Return `True`; `.env` is always excluded from version control."""
|
|
67
|
+
return True
|