envlatch 0.6.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.
- envlatch-0.6.1/.env.example +5 -0
- envlatch-0.6.1/CHANGELOG.md +55 -0
- envlatch-0.6.1/CODE_OF_CONDUCT.md +43 -0
- envlatch-0.6.1/CONTRIBUTING.md +87 -0
- envlatch-0.6.1/LICENSE +21 -0
- envlatch-0.6.1/MANIFEST.in +15 -0
- envlatch-0.6.1/PKG-INFO +433 -0
- envlatch-0.6.1/PUBLISHING.md +73 -0
- envlatch-0.6.1/README.md +405 -0
- envlatch-0.6.1/README.ru.md +405 -0
- envlatch-0.6.1/SECURITY.md +35 -0
- envlatch-0.6.1/envlatch.json +5 -0
- envlatch-0.6.1/examples/allow-extra/development.env +7 -0
- envlatch-0.6.1/examples/config/envlatch.json +8 -0
- envlatch-0.6.1/examples/optional/.env.example +7 -0
- envlatch-0.6.1/examples/types/development.env +7 -0
- envlatch-0.6.1/examples/types/envlatch.json +14 -0
- envlatch-0.6.1/examples/types/template.env.example +6 -0
- envlatch-0.6.1/pyproject.toml +45 -0
- envlatch-0.6.1/setup.cfg +4 -0
- envlatch-0.6.1/src/envlatch/__init__.py +7 -0
- envlatch-0.6.1/src/envlatch/__main__.py +5 -0
- envlatch-0.6.1/src/envlatch/_types.py +73 -0
- envlatch-0.6.1/src/envlatch/cli.py +119 -0
- envlatch-0.6.1/src/envlatch/config.py +98 -0
- envlatch-0.6.1/src/envlatch/core.py +251 -0
- envlatch-0.6.1/src/envlatch.egg-info/PKG-INFO +433 -0
- envlatch-0.6.1/src/envlatch.egg-info/SOURCES.txt +37 -0
- envlatch-0.6.1/src/envlatch.egg-info/dependency_links.txt +1 -0
- envlatch-0.6.1/src/envlatch.egg-info/entry_points.txt +2 -0
- envlatch-0.6.1/src/envlatch.egg-info/top_level.txt +1 -0
- envlatch-0.6.1/tests/test_allow_extra.py +168 -0
- envlatch-0.6.1/tests/test_config.py +313 -0
- envlatch-0.6.1/tests/test_envlatch.py +426 -0
- envlatch-0.6.1/tests/test_github.py +159 -0
- envlatch-0.6.1/tests/test_optional.py +165 -0
- envlatch-0.6.1/tests/test_packaging.py +100 -0
- envlatch-0.6.1/tests/test_types.py +297 -0
- envlatch-0.6.1/tools/check_distribution.py +179 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.6.1 — 2026-11-03
|
|
4
|
+
|
|
5
|
+
- Prepare PyPI metadata with an SPDX MIT license, explicit Markdown description, project links and Python classifiers; retain zero runtime dependencies.
|
|
6
|
+
- Include public examples, bilingual documentation, configuration, tests and release tooling in the sdist, while restricting wheel contents to package code and metadata.
|
|
7
|
+
- Build a wheel from the sdist, reject unexpected/stale artifacts and unsafe archive paths, check metadata with Twine, and test both installed distributions outside the checkout on Linux/Windows.
|
|
8
|
+
- Add release-triggered GitHub Actions Trusted Publishing with a tag-restricted `pypi` environment, isolated OIDC upload permissions, pinned Actions and provenance attestations; require matching versions and successful package checks before upload.
|
|
9
|
+
- Keep uploads disabled until the one-time PyPI publisher setup is complete, verify installation from PyPI after publication, and document setup/recovery in English and Russian.
|
|
10
|
+
- Preserve source-only GitHub Release assets and all v0.6.0 validation behavior.
|
|
11
|
+
|
|
12
|
+
## 0.6.0 — 2026-11-02
|
|
13
|
+
|
|
14
|
+
- Add opt-in `types` rules in JSON configuration and the Python `check(..., types=...)` API: string, integer, boolean, URL (`url`) and port.
|
|
15
|
+
- Check only effective, nonblank values after overlays; optional missing/blank keys keep their existing behavior, and template values remain illustrative.
|
|
16
|
+
- Report `invalid_type` with the expected type and winning file/line, never dotenv values or raw validation exceptions; retain only key metadata and failed-key names after parsing.
|
|
17
|
+
- Reject malformed rules as safe input errors (exit 2) and unknown template keys as `unknown_type_key` validation errors (exit 1).
|
|
18
|
+
- Preserve v0.5.0 configurations, CLI behavior, parser metadata, exit codes and JSON report schema 1 when no types are configured; add no runtime dependencies.
|
|
19
|
+
- Document exact type rules in English/Russian and add a runnable example, regression tests and a CI smoke check.
|
|
20
|
+
|
|
21
|
+
## 0.5.0 — 2026-10-29
|
|
22
|
+
|
|
23
|
+
- Add explicit `--config PATH` JSON settings for input paths, strict mode, optional keys, allowance patterns and output format.
|
|
24
|
+
- Resolve configured paths relative to the settings file, preserving working-directory-relative CLI overrides.
|
|
25
|
+
- Replace configured lists when their CLI flags are supplied; add `--no-strict` for explicit policy overrides.
|
|
26
|
+
- Reject unknown/duplicate fields, invalid types, non-standard JSON and malformed text without echoing file contents.
|
|
27
|
+
- Keep JSON report schema 1 and existing CLI commands compatible; add root and standalone example configurations.
|
|
28
|
+
|
|
29
|
+
## 0.4.0 — 2026-10-26
|
|
30
|
+
|
|
31
|
+
- Add repeatable `--allow-extra PATTERN` and Python API `allow_extra` for controlled extra-key allowances.
|
|
32
|
+
- Support case-sensitive `*` and `?` patterns and exact names consistently on Windows and Linux.
|
|
33
|
+
- Suppress only matching extra-key diagnostics; required, blank, syntax, duplicate and input checks remain active.
|
|
34
|
+
- Reject malformed allowance configuration with safe input errors; retain JSON schema 1 and source provenance.
|
|
35
|
+
- Add a runnable development example, cross-platform CI coverage and matching English/Russian instructions.
|
|
36
|
+
|
|
37
|
+
## 0.3.0 — 2026-10-24
|
|
38
|
+
|
|
39
|
+
- Add `--format github` for native GitHub Actions error and warning annotations with source locations.
|
|
40
|
+
- Escape workflow-command properties and messages, preserving value-free diagnostics and existing exit codes.
|
|
41
|
+
- Render input/configuration errors as general error annotations; invalid CLI usage stays on standard error.
|
|
42
|
+
- Keep text output, JSON schema version 1, optional keys, strict checks and overlays compatible.
|
|
43
|
+
- Add English/Russian workflow examples and document source-only GitHub releases.
|
|
44
|
+
|
|
45
|
+
## 0.2.0 — 2026-10-22
|
|
46
|
+
|
|
47
|
+
- Add repeatable `--optional KEY` and Python API `optional_keys` for template keys allowed to be missing or blank.
|
|
48
|
+
- Detect unknown optional names as configuration errors instead of silently accepting typos.
|
|
49
|
+
- Preserve strict extra-key, syntax, duplicate, overlay and secret-safe reporting behavior.
|
|
50
|
+
- Keep JSON schema version 1; `checked_keys` counts required keys only.
|
|
51
|
+
- Add a runnable optional-key example and full English/Russian instructions.
|
|
52
|
+
|
|
53
|
+
## 0.1.0 — 2026-10-19
|
|
54
|
+
|
|
55
|
+
Initial release with dotenv contract validation, ordered overlays, text/JSON reports, and CI on Linux and Windows.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Code of Conduct / Правила общения
|
|
2
|
+
|
|
3
|
+
[English](#english) | [Русский](#русский)
|
|
4
|
+
|
|
5
|
+
## English
|
|
6
|
+
|
|
7
|
+
### Scope and expectations
|
|
8
|
+
|
|
9
|
+
EnvLatch welcomes contributors of different backgrounds and experience levels. These rules apply to issues, pull requests, reviews, discussions, and other project spaces.
|
|
10
|
+
|
|
11
|
+
- Be respectful, patient, and constructive. Discuss technical decisions rather than attacking people.
|
|
12
|
+
- Give actionable feedback, acknowledge mistakes, and make room for newcomers.
|
|
13
|
+
- Respect privacy. Share only information you have permission to publish; keep credentials and private environment files out of project conversations.
|
|
14
|
+
- Harassment, discrimination, threats, sexualized attention, deliberate intimidation, and publishing another person's private information are unacceptable.
|
|
15
|
+
- Avoid spam and repeated disruption. Respect a request to stop an interaction.
|
|
16
|
+
|
|
17
|
+
### Reporting and moderation
|
|
18
|
+
|
|
19
|
+
For behavior visible in the repository, report the relevant content using GitHub's reporting controls. A non-sensitive concern may also be raised in an issue with a factual description and links for the maintainer, [@sinzbtw](https://github.com/sinzbtw), to assess.
|
|
20
|
+
|
|
21
|
+
For a private report of abuse or threats, use [GitHub's abuse-reporting process](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam). Such reports are handled by GitHub. Do not publish sensitive incident details in a public issue or use vulnerability reports for conduct disputes.
|
|
22
|
+
|
|
23
|
+
The maintainer may explain the rules, ask for a correction, remove harmful content, close a disruptive conversation, restrict participation, or block repeat or severe offenders. Actions should be proportionate to the behavior and its impact. Concerns about a moderation decision may be raised respectfully with relevant, non-sensitive context. GitHub's own policies also apply.
|
|
24
|
+
|
|
25
|
+
## Русский
|
|
26
|
+
|
|
27
|
+
### Область действия и ожидаемое поведение
|
|
28
|
+
|
|
29
|
+
EnvLatch открыт для участников с разным опытом и подготовкой. Правила действуют в Issues, Pull Requests, review, обсуждениях и других пространствах проекта.
|
|
30
|
+
|
|
31
|
+
- Общайтесь уважительно, терпеливо и по существу. Обсуждайте технические решения, а не личности.
|
|
32
|
+
- Давайте конкретную обратную связь, признавайте ошибки и помогайте новичкам.
|
|
33
|
+
- Уважайте приватность. Публикуйте только информацию, на раскрытие которой у вас есть разрешение; не размещайте учётные данные и реальные файлы окружения.
|
|
34
|
+
- Травля, дискриминация, угрозы, нежелательное внимание сексуального характера, запугивание и публикация чужой личной информации недопустимы.
|
|
35
|
+
- Избегайте спама и намеренного срыва обсуждений. Уважайте просьбу прекратить общение.
|
|
36
|
+
|
|
37
|
+
### Сообщения о нарушениях и модерация
|
|
38
|
+
|
|
39
|
+
О видимых нарушениях сообщайте через средства жалоб GitHub у соответствующего контента. Если вопрос не содержит чувствительных сведений, его также можно изложить в Issue с фактами и ссылками для владельца проекта [@sinzbtw](https://github.com/sinzbtw).
|
|
40
|
+
|
|
41
|
+
Для приватного сообщения об оскорблениях или угрозах используйте [порядок подачи жалоб GitHub](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam). Такие жалобы рассматривает GitHub. Не публикуйте чувствительные подробности в открытом Issue и не используйте сообщения об уязвимостях для споров о поведении.
|
|
42
|
+
|
|
43
|
+
Владелец проекта может разъяснить правила, попросить исправить поведение, удалить вредоносный контент, закрыть деструктивное обсуждение, ограничить участие или заблокировать участника при повторном либо серьёзном нарушении. Меры должны соответствовать поведению и его последствиям. Возражения против решения можно изложить уважительно, приложив относящиеся к делу нечувствительные сведения. Правила самого GitHub также действуют.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Contributing to EnvLatch / Участие в разработке
|
|
2
|
+
|
|
3
|
+
[English](#english) | [Русский](#русский)
|
|
4
|
+
|
|
5
|
+
## English
|
|
6
|
+
|
|
7
|
+
Bug reports, documentation improvements, focused fixes, and useful features are welcome. Follow the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
8
|
+
|
|
9
|
+
### Report a problem or propose a feature
|
|
10
|
+
|
|
11
|
+
Use the [issue forms](https://github.com/sinzbtw/envlatch/issues/new/choose) after checking existing issues. Reports can be written in English or Russian.
|
|
12
|
+
|
|
13
|
+
For a bug, include `envlatch --version`, Python version, operating system, the command, expected and actual behavior, and a minimal template/environment example with invented values. Replace private paths or sensitive names when necessary. Never attach real `.env` files, credentials, access tokens, or unredacted private logs.
|
|
14
|
+
|
|
15
|
+
For a feature, describe the real problem, a proposed command or API, and relevant alternatives. Suspected vulnerabilities belong in the [private security reporting process](SECURITY.md), not public issues.
|
|
16
|
+
|
|
17
|
+
### Local development
|
|
18
|
+
|
|
19
|
+
Python 3.10 or newer and Git are required. Clone the repository and create a project-local virtual environment:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
git clone https://github.com/sinzbtw/envlatch.git
|
|
23
|
+
cd envlatch
|
|
24
|
+
python -m venv .venv
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Activate it with `.\.venv\Scripts\Activate.ps1` in Windows PowerShell, or `source .venv/bin/activate` on Linux/macOS. Then run:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
python -m pip install -e .
|
|
31
|
+
python -m unittest discover -s tests -v
|
|
32
|
+
python -m pip check
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The parser and contract checks are in `src/envlatch/core.py`; literal type predicates are in `src/envlatch/_types.py`; output formats and CLI handling are in `src/envlatch/cli.py`; JSON settings are loaded by `src/envlatch/config.py`; behavioral tests are in `tests/`. There are no runtime dependencies.
|
|
36
|
+
|
|
37
|
+
### Submit a change
|
|
38
|
+
|
|
39
|
+
- Keep the change focused and explain the problem and resulting behavior in the PR template. Link a related issue when one exists.
|
|
40
|
+
- For behavior changes, add a regression test covering the user-visible case, including safe handling of secrets where relevant. Run the relevant tests and the full suite before submission. For documentation-only changes, check links and examples and explain why runtime tests are not applicable.
|
|
41
|
+
- Keep `README.md` and `README.ru.md` consistent. Update `CHANGELOG.md` for user-visible behavior changes.
|
|
42
|
+
- Preserve exit-code behavior, deterministic output, JSON schema compatibility, Python 3.10 support, and the rule that dotenv values never appear in diagnostics. Discuss compatibility changes explicitly.
|
|
43
|
+
- Keep build tools inside the project's environment and avoid new runtime dependencies unless necessary and explained. Do not commit `.env`, virtual environments, build output, or real secrets.
|
|
44
|
+
|
|
45
|
+
GitHub Actions checks Linux and Windows. The maintainer manages versions and releases; GitHub Releases contain tagged source archives only, without wheel or checksum attachments. Contributions are provided under the repository's [MIT license](LICENSE).
|
|
46
|
+
|
|
47
|
+
## Русский
|
|
48
|
+
|
|
49
|
+
Сообщения об ошибках, улучшения документации, точечные исправления и полезные функции приветствуются. Соблюдайте [правила общения](CODE_OF_CONDUCT.md#русский).
|
|
50
|
+
|
|
51
|
+
### Сообщить о проблеме или предложить функцию
|
|
52
|
+
|
|
53
|
+
Сначала проверьте существующие Issues, затем используйте [формы обращений](https://github.com/sinzbtw/envlatch/issues/new/choose). Можно писать по-русски или по-английски.
|
|
54
|
+
|
|
55
|
+
Для ошибки укажите `envlatch --version`, версию Python, ОС, команду, ожидаемый и фактический результат и минимальный пример шаблона/окружения с вымышленными значениями. При необходимости замените приватные пути и чувствительные имена. Не прикладывайте реальные `.env`, учётные данные, токены доступа и неочищенные приватные логи.
|
|
56
|
+
|
|
57
|
+
Для новой функции опишите реальную задачу, предлагаемые команду или API и подходящие альтернативы. О возможных уязвимостях сообщайте [приватно по политике безопасности](SECURITY.md#русский), а не через открытый Issue.
|
|
58
|
+
|
|
59
|
+
### Локальная разработка
|
|
60
|
+
|
|
61
|
+
Нужны Python 3.10 или новее и Git. Клонируйте репозиторий и создайте виртуальное окружение внутри проекта:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
git clone https://github.com/sinzbtw/envlatch.git
|
|
65
|
+
cd envlatch
|
|
66
|
+
python -m venv .venv
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Активируйте его командой `.\.venv\Scripts\Activate.ps1` в Windows PowerShell или `source .venv/bin/activate` в Linux/macOS. Затем выполните:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
python -m pip install -e .
|
|
73
|
+
python -m unittest discover -s tests -v
|
|
74
|
+
python -m pip check
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Парсер и проверки контракта находятся в `src/envlatch/core.py`, проверки буквальных типов — в `src/envlatch/_types.py`, обработка CLI и форматы вывода — в `src/envlatch/cli.py`, загрузка JSON-настроек — в `src/envlatch/config.py`, поведенческие тесты — в `tests/`. Зависимостей для запуска нет.
|
|
78
|
+
|
|
79
|
+
### Предложить изменение
|
|
80
|
+
|
|
81
|
+
- Делайте отдельное изменение по одной задаче. В шаблоне PR опишите проблему и итоговое поведение, приложите ссылку на связанный Issue, если он есть.
|
|
82
|
+
- При изменении поведения добавляйте регрессионный тест пользовательского сценария, в том числе безопасной обработки секретов, если это относится к задаче. Перед отправкой запускайте связанные тесты и полный набор. Для изменений только документации проверьте ссылки и примеры и поясните, почему тесты программы неприменимы.
|
|
83
|
+
- Поддерживайте одинаковую информацию в `README.md` и `README.ru.md`. Изменения поведения для пользователей отражайте в `CHANGELOG.md`.
|
|
84
|
+
- Сохраняйте коды завершения, воспроизводимость вывода, совместимость схемы JSON, поддержку Python 3.10 и отсутствие значений dotenv в диагностике. Изменения совместимости обсуждайте явно.
|
|
85
|
+
- Держите инструменты сборки в окружении проекта и добавляйте зависимости для запуска только при необходимости, поясняя причину. Не коммитьте `.env`, виртуальные окружения, результаты сборки и реальные секреты.
|
|
86
|
+
|
|
87
|
+
GitHub Actions проверяет Linux и Windows. Версиями и выпусками управляет владелец проекта; в GitHub Releases публикуются только архивы исходников по тегу, без wheel и файлов контрольных сумм. Вклады в проект предоставляются по [лицензии MIT](LICENSE).
|
envlatch-0.6.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sinzbtw
|
|
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,15 @@
|
|
|
1
|
+
include LICENSE README.md README.ru.md CHANGELOG.md
|
|
2
|
+
include CONTRIBUTING.md CODE_OF_CONDUCT.md SECURITY.md PUBLISHING.md
|
|
3
|
+
include pyproject.toml MANIFEST.in .env.example envlatch.json
|
|
4
|
+
include examples/allow-extra/development.env
|
|
5
|
+
include examples/config/envlatch.json
|
|
6
|
+
include examples/optional/.env.example
|
|
7
|
+
include examples/types/template.env.example
|
|
8
|
+
include examples/types/development.env examples/types/envlatch.json
|
|
9
|
+
include tools/check_distribution.py
|
|
10
|
+
recursive-include src/envlatch *.py
|
|
11
|
+
recursive-include tests test_*.py
|
|
12
|
+
global-exclude *.py[cod]
|
|
13
|
+
prune .venv
|
|
14
|
+
prune .git
|
|
15
|
+
prune .github
|