generated from Hochfrequenz/python_template_repository
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump rebdhuhn from 0.3.1 to 0.4.0; Make kroki-port configurable via env var; Clean Up docker image #83
Merged
Merged
Bump rebdhuhn from 0.3.1 to 0.4.0; Make kroki-port configurable via env var; Clean Up docker image #83
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
cc66ace
Bump rebdhuhn from 0.3.1 to 0.4.0
dependabot[bot] 5862676
➕ install `python-dotenv` and `pydantic-settings`
1ceca78
make kroki-port configurable
d0acd29
Update docker-compose.yaml
hf-kklein 760afc4
remove direct dependency to python-dotenv (keep indirect)
828d3c8
Merge remote-tracking branch 'origin/dependabot/pip/rebdhuhn-0.4.0' i…
1423ec0
set min version
f7218bb
please the linters
fca5334
hrm,.
fbef2d5
docs
becbadc
Fix Docker Compose Setup (#84)
hf-krechan 5fafdae
WIP on fix-docker-compose-setup
367d64c
more docs
32d370d
Update README.md
hf-kklein f71c428
update docker-compose
hf-krechan eccc938
Update README.md
hf-kklein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
EBD_DOCX_FILE=./edi_energy_mirror/edi_energy_de/FV2410/Entscheidungsbaum-DiagrammeundCodelisten-informatorischeLesefassung3.5KonsolidierteLesefassungmitFehlerkorrekturenStand31.07.2024_20250403_20240403.docx | ||
OUTPUT_DIR=./ebd_toolchain/machine-readable_entscheidungsbaumdiagramme/FV2404 | ||
KROKI_PORT=8125 | ||
KROKI_HOST=kroki |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# mypy: disable-error-code="call-arg" | ||
import pytest | ||
from _pytest.monkeypatch import MonkeyPatch | ||
from pydantic import ValidationError | ||
|
||
from ebd_toolchain.main import Settings | ||
|
||
|
||
def test_settings_from_env(monkeypatch: MonkeyPatch) -> None: | ||
# Mock environment variables to simulate the .env behavior | ||
monkeypatch.setenv("KROKI_PORT", "8000") | ||
monkeypatch.setenv("KROKI_HOST", "localhost") | ||
|
||
# Instantiate the Settings class | ||
settings = Settings() | ||
|
||
# Assert the settings have loaded correctly from environment | ||
assert settings.kroki_port == 8000 | ||
assert settings.kroki_host == "localhost" | ||
|
||
|
||
def test_settings_missing_required_fields(monkeypatch: MonkeyPatch) -> None: | ||
# Ensure no environment variables are set | ||
monkeypatch.delenv("KROKI_PORT", raising=False) | ||
monkeypatch.delenv("KROKI_HOST", raising=False) | ||
|
||
# Expecting ValidationError due to missing required environment variables | ||
with pytest.raises(ValidationError): | ||
Settings(_env_file="foo.env") # change env file to avoid loading from .env | ||
|
||
|
||
def test_invalid_port_value(monkeypatch: MonkeyPatch) -> None: | ||
# Set invalid environment variables | ||
monkeypatch.setenv("KROKI_PORT", "not_an_integer") | ||
monkeypatch.setenv("KROKI_HOST", "localhost") | ||
|
||
# Expecting ValidationError because KROKI_PORT is not a valid integer | ||
with pytest.raises(ValidationError): | ||
Settings() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hf-krechan was macht man denn anstatt der der docker-compose? also konkret geht es mir ums setup hier: https://github.com/Hochfrequenz/edi_energy_mirror/blob/master/ebd-tooling/docker-compose.yaml was mache ich da stattdessen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
den Schritt braucht man hier nicht, da wir kein Image von GH laden.
Außer du willst das docker image welches mit der Dockerfile hier im repo beschrieben wird auch in die GH Container Registry ablegen.