dotenvmodel 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.
- dotenvmodel-0.1.1/.github/workflows/ci.yml +120 -0
- dotenvmodel-0.1.1/.github/workflows/publish.yml +50 -0
- dotenvmodel-0.1.1/.github/workflows/release-please.yml +35 -0
- dotenvmodel-0.1.1/.gitignore +207 -0
- dotenvmodel-0.1.1/.python-version +1 -0
- dotenvmodel-0.1.1/.release-please-manifest.json +3 -0
- dotenvmodel-0.1.1/.vscode/settings.json +7 -0
- dotenvmodel-0.1.1/CHANGELOG.md +99 -0
- dotenvmodel-0.1.1/LICENSE +21 -0
- dotenvmodel-0.1.1/Makefile +45 -0
- dotenvmodel-0.1.1/PKG-INFO +950 -0
- dotenvmodel-0.1.1/README.md +920 -0
- dotenvmodel-0.1.1/dotenvmodel/__init__.py +42 -0
- dotenvmodel-0.1.1/dotenvmodel/coercion.py +398 -0
- dotenvmodel-0.1.1/dotenvmodel/config.py +483 -0
- dotenvmodel-0.1.1/dotenvmodel/exceptions.py +131 -0
- dotenvmodel-0.1.1/dotenvmodel/fields.py +298 -0
- dotenvmodel-0.1.1/dotenvmodel/loading.py +145 -0
- dotenvmodel-0.1.1/dotenvmodel/logging_config.py +92 -0
- dotenvmodel-0.1.1/dotenvmodel/py.typed +0 -0
- dotenvmodel-0.1.1/dotenvmodel/types.py +480 -0
- dotenvmodel-0.1.1/dotenvmodel/validation.py +182 -0
- dotenvmodel-0.1.1/examples/advanced_types.py +131 -0
- dotenvmodel-0.1.1/examples/basic_usage.py +67 -0
- dotenvmodel-0.1.1/examples/logging_example.py +112 -0
- dotenvmodel-0.1.1/pyproject.toml +112 -0
- dotenvmodel-0.1.1/release-please-config.json +32 -0
- dotenvmodel-0.1.1/tests/__init__.py +0 -0
- dotenvmodel-0.1.1/tests/conftest.py +0 -0
- dotenvmodel-0.1.1/tests/test_basic.py +424 -0
- dotenvmodel-0.1.1/tests/test_coercion.py +483 -0
- dotenvmodel-0.1.1/tests/test_collection_validators.py +203 -0
- dotenvmodel-0.1.1/tests/test_empty_collection_items.py +124 -0
- dotenvmodel-0.1.1/tests/test_empty_strings.py +144 -0
- dotenvmodel-0.1.1/tests/test_errors.py +327 -0
- dotenvmodel-0.1.1/tests/test_field_constraints.py +118 -0
- dotenvmodel-0.1.1/tests/test_inheritance.py +129 -0
- dotenvmodel-0.1.1/tests/test_json.py +165 -0
- dotenvmodel-0.1.1/tests/test_json_and_optional.py +310 -0
- dotenvmodel-0.1.1/tests/test_loading.py +243 -0
- dotenvmodel-0.1.1/tests/test_logging_config.py +254 -0
- dotenvmodel-0.1.1/tests/test_prefix.py +234 -0
- dotenvmodel-0.1.1/tests/test_reload.py +334 -0
- dotenvmodel-0.1.1/tests/test_secretstr_security.py +117 -0
- dotenvmodel-0.1.1/tests/test_types.py +362 -0
- dotenvmodel-0.1.1/tests/test_union_types.py +83 -0
- dotenvmodel-0.1.1/tests/test_url_dsn.py +273 -0
- dotenvmodel-0.1.1/tests/test_url_password_decoding.py +87 -0
- dotenvmodel-0.1.1/tests/test_url_unquote.py +141 -0
- dotenvmodel-0.1.1/tests/test_urls.py +262 -0
- dotenvmodel-0.1.1/uv.lock +366 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Install uv
|
|
16
|
+
uses: astral-sh/setup-uv@v4
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
run: uv python install 3.12
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: uv sync --all-extras
|
|
25
|
+
|
|
26
|
+
- name: Lint with ruff
|
|
27
|
+
run: uv run ruff check .
|
|
28
|
+
|
|
29
|
+
- name: Check formatting
|
|
30
|
+
run: uv run ruff format --check .
|
|
31
|
+
|
|
32
|
+
typecheck:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- name: Install uv
|
|
38
|
+
uses: astral-sh/setup-uv@v4
|
|
39
|
+
with:
|
|
40
|
+
enable-cache: true
|
|
41
|
+
|
|
42
|
+
- name: Set up Python
|
|
43
|
+
run: uv python install 3.12
|
|
44
|
+
|
|
45
|
+
- name: Install dependencies
|
|
46
|
+
run: uv sync --all-extras
|
|
47
|
+
|
|
48
|
+
- name: Type check with ty
|
|
49
|
+
run: uv run ty check dotenvmodel
|
|
50
|
+
|
|
51
|
+
test:
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
strategy:
|
|
54
|
+
matrix:
|
|
55
|
+
python-version: ["3.12", "3.13"]
|
|
56
|
+
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/checkout@v4
|
|
59
|
+
|
|
60
|
+
- name: Install uv
|
|
61
|
+
uses: astral-sh/setup-uv@v4
|
|
62
|
+
with:
|
|
63
|
+
enable-cache: true
|
|
64
|
+
|
|
65
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
66
|
+
run: uv python install ${{ matrix.python-version }}
|
|
67
|
+
|
|
68
|
+
- name: Install dependencies
|
|
69
|
+
run: uv sync --all-extras
|
|
70
|
+
|
|
71
|
+
- name: Run tests
|
|
72
|
+
run: uv run pytest tests/
|
|
73
|
+
|
|
74
|
+
- name: Upload coverage
|
|
75
|
+
uses: codecov/codecov-action@v3
|
|
76
|
+
if: matrix.python-version == '3.12'
|
|
77
|
+
with:
|
|
78
|
+
file: ./coverage.xml
|
|
79
|
+
|
|
80
|
+
build:
|
|
81
|
+
runs-on: ubuntu-latest
|
|
82
|
+
needs: [lint, typecheck, test]
|
|
83
|
+
steps:
|
|
84
|
+
- uses: actions/checkout@v4
|
|
85
|
+
|
|
86
|
+
- name: Install uv
|
|
87
|
+
uses: astral-sh/setup-uv@v4
|
|
88
|
+
with:
|
|
89
|
+
enable-cache: true
|
|
90
|
+
|
|
91
|
+
- name: Set up Python
|
|
92
|
+
run: uv python install 3.12
|
|
93
|
+
|
|
94
|
+
- name: Build package
|
|
95
|
+
run: uv build
|
|
96
|
+
|
|
97
|
+
- name: Check package contents
|
|
98
|
+
run: |
|
|
99
|
+
ls -la dist/
|
|
100
|
+
uv run python -m tarfile -l dist/*.tar.gz
|
|
101
|
+
uv run python -m zipfile -l dist/*.whl
|
|
102
|
+
|
|
103
|
+
- name: Test installation from wheel
|
|
104
|
+
run: |
|
|
105
|
+
uv venv test-env
|
|
106
|
+
uv pip install --python test-env/bin/python dist/*.whl
|
|
107
|
+
cd /tmp && $GITHUB_WORKSPACE/test-env/bin/python -c "import dotenvmodel; print(dotenvmodel.__version__)"
|
|
108
|
+
|
|
109
|
+
- name: Test installation from source distribution
|
|
110
|
+
run: |
|
|
111
|
+
uv venv test-src-env
|
|
112
|
+
uv pip install --python test-src-env/bin/python dist/*.tar.gz
|
|
113
|
+
cd /tmp && $GITHUB_WORKSPACE/test-src-env/bin/python -c "import dotenvmodel; print(dotenvmodel.__version__)"
|
|
114
|
+
|
|
115
|
+
- name: Upload build artifacts
|
|
116
|
+
uses: actions/upload-artifact@v4
|
|
117
|
+
with:
|
|
118
|
+
name: dist
|
|
119
|
+
path: dist/
|
|
120
|
+
retention-days: 7
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
inputs:
|
|
6
|
+
release_created:
|
|
7
|
+
required: true
|
|
8
|
+
type: boolean
|
|
9
|
+
tag_name:
|
|
10
|
+
required: true
|
|
11
|
+
type: string
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
publish:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
if: inputs.release_created || github.event_name == 'release' || github.event_name == 'workflow_dispatch'
|
|
20
|
+
permissions:
|
|
21
|
+
id-token: write
|
|
22
|
+
contents: read
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Install uv
|
|
28
|
+
uses: astral-sh/setup-uv@v4
|
|
29
|
+
with:
|
|
30
|
+
version: "latest"
|
|
31
|
+
|
|
32
|
+
- name: Set up Python
|
|
33
|
+
run: uv python install
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: uv sync --all-extras --group dev
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: uv run pytest tests/ -v
|
|
40
|
+
|
|
41
|
+
- name: Build package
|
|
42
|
+
run: uv build
|
|
43
|
+
|
|
44
|
+
- name: Publish to PyPI
|
|
45
|
+
env:
|
|
46
|
+
TWINE_USERNAME: __token__
|
|
47
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
48
|
+
run: |
|
|
49
|
+
uv tool install twine
|
|
50
|
+
uv tool run twine upload dist/*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Release Please
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
id-token: write
|
|
12
|
+
issues: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
release-please:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
outputs:
|
|
18
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
19
|
+
tag_name: ${{ steps.release.outputs.tag_name }}
|
|
20
|
+
steps:
|
|
21
|
+
- uses: googleapis/release-please-action@v4
|
|
22
|
+
id: release
|
|
23
|
+
with:
|
|
24
|
+
release-type: python
|
|
25
|
+
package-name: dotenvmodel
|
|
26
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
27
|
+
|
|
28
|
+
publish:
|
|
29
|
+
needs: release-please
|
|
30
|
+
if: needs.release-please.outputs.release_created
|
|
31
|
+
uses: ./.github/workflows/publish.yml
|
|
32
|
+
with:
|
|
33
|
+
release_created: true
|
|
34
|
+
tag_name: ${{ needs.release-please.outputs.tag_name }}
|
|
35
|
+
secrets: inherit
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.1](https://github.com/AZX-PBC/dotenvmodel/compare/v0.1.0...v0.1.1) (2025-12-05)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* update PyPI publishing workflow configuration ([f854abb](https://github.com/AZX-PBC/dotenvmodel/commit/f854abb08272c51e1a872d4062230f8b2e7d5c21))
|
|
14
|
+
* update PyPI publishing workflow configuration ([8c3ed30](https://github.com/AZX-PBC/dotenvmodel/commit/8c3ed301b7aa3fffcffb2343a0f194cce639832a))
|
|
15
|
+
|
|
16
|
+
## 0.1.0 (2025-12-05)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* v0.1.0 - Complete type-safe environment configuration library ([#1](https://github.com/AZX-PBC/dotenvmodel/issues/1)) ([7e9b2a9](https://github.com/AZX-PBC/dotenvmodel/commit/7e9b2a9cf01db778b0855df40745eac1d2134de5))
|
|
22
|
+
|
|
23
|
+
## [0.1.0] - 2025-12-05
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **Core Configuration System**
|
|
28
|
+
- `DotEnvConfig` base class with metaclass-based field discovery
|
|
29
|
+
- Type-safe field definitions with full IntelliSense support
|
|
30
|
+
- Automatic type coercion for common Python types
|
|
31
|
+
|
|
32
|
+
- **Type Support**
|
|
33
|
+
- Basic types: `str`, `int`, `float`, `bool`, `Path`
|
|
34
|
+
- Collection types: `list`, `set`, `tuple`, `dict`
|
|
35
|
+
- Special types: `UUID`, `Decimal`, `datetime`, `timedelta`
|
|
36
|
+
- URL/DSN types: `HttpUrl`, `PostgresDsn`, `RedisDsn`
|
|
37
|
+
- Security: `SecretStr` for sensitive values
|
|
38
|
+
- Flexible: `Json[T]` for typed JSON parsing
|
|
39
|
+
|
|
40
|
+
- **Validation**
|
|
41
|
+
- Numeric constraints: `ge`, `le`, `gt`, `lt`
|
|
42
|
+
- String constraints: `min_length`, `max_length`, `regex`
|
|
43
|
+
- Choice validation
|
|
44
|
+
- Collection size constraints: `min_items`, `max_items`
|
|
45
|
+
- UUID version validation
|
|
46
|
+
|
|
47
|
+
- **Environment Management**
|
|
48
|
+
- Automatic .env file loading with cascading (`.env`, `.env.{env}`, `.env.{env}.local`)
|
|
49
|
+
- Support for multiple environments (dev, prod, test, staging)
|
|
50
|
+
- Custom .env file locations via `env_dir` parameter
|
|
51
|
+
- Override control with `override` parameter
|
|
52
|
+
|
|
53
|
+
- **Advanced Features**
|
|
54
|
+
- **Configuration Reload**: `reload()` method to update config at runtime without creating new instances
|
|
55
|
+
- **Environment Prefixes**: Class-level `env_prefix` to namespace environment variables
|
|
56
|
+
- Field aliases for environment variable names
|
|
57
|
+
- Default values and factories
|
|
58
|
+
- Optional fields with proper None handling
|
|
59
|
+
|
|
60
|
+
- **Developer Experience**
|
|
61
|
+
- Comprehensive error messages with helpful hints
|
|
62
|
+
- Optional logging support for debugging
|
|
63
|
+
- `load_from_dict()` for testing without environment variables
|
|
64
|
+
- Helper methods: `dict()`, `get()`, `__repr__()`
|
|
65
|
+
|
|
66
|
+
- **Testing & Quality**
|
|
67
|
+
- 315 comprehensive tests
|
|
68
|
+
- 98% code coverage
|
|
69
|
+
- Full type safety with py.typed marker
|
|
70
|
+
- Linting with ruff
|
|
71
|
+
- CI/CD ready configuration
|
|
72
|
+
|
|
73
|
+
- **Documentation**
|
|
74
|
+
- Comprehensive README with examples
|
|
75
|
+
- Type safety and IntelliSense documentation
|
|
76
|
+
- Complete API documentation
|
|
77
|
+
- Advanced usage patterns and best practices
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
|
|
81
|
+
- N/A (initial release)
|
|
82
|
+
|
|
83
|
+
### Deprecated
|
|
84
|
+
|
|
85
|
+
- N/A (initial release)
|
|
86
|
+
|
|
87
|
+
### Removed
|
|
88
|
+
|
|
89
|
+
- N/A (initial release)
|
|
90
|
+
|
|
91
|
+
### Fixed
|
|
92
|
+
|
|
93
|
+
- N/A (initial release)
|
|
94
|
+
|
|
95
|
+
### Security
|
|
96
|
+
|
|
97
|
+
- No known security issues
|
|
98
|
+
|
|
99
|
+
[0.1.0]: https://github.com/azxio/dotenvmodel/releases/tag/v0.1.0
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 AZX, PBC.
|
|
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.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.PHONY: help install test lint format type-check clean build publish
|
|
2
|
+
|
|
3
|
+
help:
|
|
4
|
+
@echo "Available commands:"
|
|
5
|
+
@echo " make install - Install package and dev dependencies"
|
|
6
|
+
@echo " make test - Run tests with coverage"
|
|
7
|
+
@echo " make lint - Run ruff linter"
|
|
8
|
+
@echo " make format - Format code with ruff"
|
|
9
|
+
@echo " make type-check - Run mypy type checker"
|
|
10
|
+
@echo " make clean - Clean build artifacts"
|
|
11
|
+
@echo " make build - Build package"
|
|
12
|
+
@echo " make publish - Publish to PyPI"
|
|
13
|
+
|
|
14
|
+
install:
|
|
15
|
+
uv sync --all-extras
|
|
16
|
+
|
|
17
|
+
test:
|
|
18
|
+
uv run pytest
|
|
19
|
+
|
|
20
|
+
lint:
|
|
21
|
+
uv run ruff check .
|
|
22
|
+
|
|
23
|
+
format:
|
|
24
|
+
uv run ruff format .
|
|
25
|
+
uv run ruff check --fix .
|
|
26
|
+
|
|
27
|
+
type-check:
|
|
28
|
+
uv run ty check dotenvmodel
|
|
29
|
+
|
|
30
|
+
clean:
|
|
31
|
+
rm -rf build/
|
|
32
|
+
rm -rf dist/
|
|
33
|
+
rm -rf *.egg-info
|
|
34
|
+
rm -rf .pytest_cache
|
|
35
|
+
rm -rf .mypy_cache
|
|
36
|
+
rm -rf .ruff_cache
|
|
37
|
+
rm -rf htmlcov
|
|
38
|
+
find . -type d -name __pycache__ -exec rm -rf {} +
|
|
39
|
+
find . -type f -name "*.pyc" -delete
|
|
40
|
+
|
|
41
|
+
build: clean
|
|
42
|
+
uv build
|
|
43
|
+
|
|
44
|
+
publish: build
|
|
45
|
+
uv publish
|