phlo-testing 0.3.0__tar.gz → 0.4.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.
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/PKG-INFO +4 -1
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/pyproject.toml +4 -1
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/__init__.py +1 -1
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/profile_harness.py +8 -3
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing.egg-info/PKG-INFO +4 -1
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing.egg-info/requires.txt +3 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/tests/test_profile_harness.py +42 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/README.md +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/setup.cfg +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/conftest_template.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/execution.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/fixtures.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/hooks.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/local_mode.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/mock_dlt.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/mock_iceberg.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/mock_trino.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/non_versioned_profile_harness.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/placeholders.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing/utils.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing.egg-info/SOURCES.txt +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing.egg-info/dependency_links.txt +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/src/phlo_testing.egg-info/top_level.txt +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/tests/test_integration_testing.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/tests/test_non_versioned_profile_harness.py +0 -0
- {phlo_testing-0.3.0 → phlo_testing-0.4.0}/tests/test_testing_infrastructure.py +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: phlo-testing
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Testing utilities for Phlo
|
|
5
5
|
Author-email: Phlo Team <team@phlo.dev>
|
|
6
6
|
License: MIT
|
|
7
7
|
Requires-Python: >=3.11
|
|
8
8
|
Description-Content-Type: text/plain
|
|
9
|
+
Requires-Dist: dagster<1.14,>=1.13
|
|
10
|
+
Requires-Dist: dagster-graphql<1.14,>=1.13
|
|
9
11
|
Requires-Dist: phlo>=0.1.0
|
|
10
12
|
Requires-Dist: phlo-postgres>=0.1.0
|
|
11
13
|
Requires-Dist: duckdb>=0.9.0
|
|
@@ -14,6 +16,7 @@ Requires-Dist: pyiceberg>=0.10.0
|
|
|
14
16
|
Requires-Dist: pandas>=2.3.3
|
|
15
17
|
Requires-Dist: pandera>=0.26.1
|
|
16
18
|
Requires-Dist: dlt>=1.18.2
|
|
19
|
+
Requires-Dist: requests>=2.32.5
|
|
17
20
|
Provides-Extra: dev
|
|
18
21
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
19
22
|
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
@@ -7,6 +7,8 @@ requires = [
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
dependencies = [
|
|
10
|
+
"dagster>=1.13,<1.14",
|
|
11
|
+
"dagster-graphql>=1.13,<1.14",
|
|
10
12
|
"phlo>=0.1.0",
|
|
11
13
|
"phlo-postgres>=0.1.0",
|
|
12
14
|
"duckdb>=0.9.0",
|
|
@@ -15,11 +17,12 @@ dependencies = [
|
|
|
15
17
|
"pandas>=2.3.3",
|
|
16
18
|
"pandera>=0.26.1",
|
|
17
19
|
"dlt>=1.18.2",
|
|
20
|
+
"requests>=2.32.5",
|
|
18
21
|
]
|
|
19
22
|
description = "Testing utilities for Phlo"
|
|
20
23
|
name = "phlo-testing"
|
|
21
24
|
requires-python = ">=3.11"
|
|
22
|
-
version = "0.
|
|
25
|
+
version = "0.4.0"
|
|
23
26
|
|
|
24
27
|
[[project.authors]]
|
|
25
28
|
email = "team@phlo.dev"
|
|
@@ -639,14 +639,19 @@ class BundledStackHarness:
|
|
|
639
639
|
)
|
|
640
640
|
|
|
641
641
|
def read_env(self) -> dict[str, str]:
|
|
642
|
-
"""Read environment variables from the project's .phlo
|
|
642
|
+
"""Read resolved environment variables from the project's .phlo files.
|
|
643
643
|
|
|
644
644
|
Returns:
|
|
645
|
-
Dictionary of environment variables.
|
|
645
|
+
Dictionary of environment variables with .env.local overriding .env.
|
|
646
646
|
|
|
647
647
|
"""
|
|
648
648
|
utils = _load_golden_path_module()
|
|
649
|
-
|
|
649
|
+
phlo_dir = self.project_dir / ".phlo"
|
|
650
|
+
env_vars = cast(dict[str, str], utils.read_env_file(phlo_dir / ".env"))
|
|
651
|
+
local_env_path = phlo_dir / ".env.local"
|
|
652
|
+
if local_env_path.exists():
|
|
653
|
+
env_vars.update(cast(dict[str, str], utils.read_env_file(local_env_path)))
|
|
654
|
+
return env_vars
|
|
650
655
|
|
|
651
656
|
def default_partition_date(self) -> str:
|
|
652
657
|
"""Return a default partition date (yesterday).
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: phlo-testing
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Testing utilities for Phlo
|
|
5
5
|
Author-email: Phlo Team <team@phlo.dev>
|
|
6
6
|
License: MIT
|
|
7
7
|
Requires-Python: >=3.11
|
|
8
8
|
Description-Content-Type: text/plain
|
|
9
|
+
Requires-Dist: dagster<1.14,>=1.13
|
|
10
|
+
Requires-Dist: dagster-graphql<1.14,>=1.13
|
|
9
11
|
Requires-Dist: phlo>=0.1.0
|
|
10
12
|
Requires-Dist: phlo-postgres>=0.1.0
|
|
11
13
|
Requires-Dist: duckdb>=0.9.0
|
|
@@ -14,6 +16,7 @@ Requires-Dist: pyiceberg>=0.10.0
|
|
|
14
16
|
Requires-Dist: pandas>=2.3.3
|
|
15
17
|
Requires-Dist: pandera>=0.26.1
|
|
16
18
|
Requires-Dist: dlt>=1.18.2
|
|
19
|
+
Requires-Dist: requests>=2.32.5
|
|
17
20
|
Provides-Extra: dev
|
|
18
21
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
19
22
|
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
@@ -111,6 +111,48 @@ def test_bundled_stack_harness_materialize_adds_partition(monkeypatch) -> None:
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
|
|
114
|
+
def test_bundled_stack_harness_read_env_merges_local_secrets(monkeypatch, tmp_path) -> None:
|
|
115
|
+
phlo_dir = tmp_path / ".phlo"
|
|
116
|
+
phlo_dir.mkdir()
|
|
117
|
+
(phlo_dir / ".env").write_text(
|
|
118
|
+
"POSTGRES_USER=phlo\nPOSTGRES_PASSWORD=phlo\nPOSTGRES_DB=phlo\n",
|
|
119
|
+
encoding="utf-8",
|
|
120
|
+
)
|
|
121
|
+
(phlo_dir / ".env.local").write_text(
|
|
122
|
+
"POSTGRES_PASSWORD=secret\nMINIO_ROOT_PASSWORD=minio-secret\n",
|
|
123
|
+
encoding="utf-8",
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
monkeypatch.setattr(
|
|
127
|
+
"phlo_testing.profile_harness._load_golden_path_module",
|
|
128
|
+
lambda: type(
|
|
129
|
+
"StubGoldenPathModule",
|
|
130
|
+
(),
|
|
131
|
+
{
|
|
132
|
+
"read_env_file": staticmethod(
|
|
133
|
+
lambda path: dict(
|
|
134
|
+
line.split("=", 1)
|
|
135
|
+
for line in Path(path).read_text(encoding="utf-8").splitlines()
|
|
136
|
+
if line
|
|
137
|
+
)
|
|
138
|
+
)
|
|
139
|
+
},
|
|
140
|
+
)(),
|
|
141
|
+
)
|
|
142
|
+
harness = BundledStackHarness(
|
|
143
|
+
project_dir=tmp_path,
|
|
144
|
+
phlo_source=Path("/tmp/source"),
|
|
145
|
+
python_executable=Path("/tmp/project/.venv/bin/python"),
|
|
146
|
+
ports=BundledStackPorts(phlo_api=54000, dagster=3000),
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
env_vars = harness.read_env()
|
|
150
|
+
|
|
151
|
+
assert env_vars["POSTGRES_USER"] == "phlo"
|
|
152
|
+
assert env_vars["POSTGRES_PASSWORD"] == "secret"
|
|
153
|
+
assert env_vars["MINIO_ROOT_PASSWORD"] == "minio-secret"
|
|
154
|
+
|
|
155
|
+
|
|
114
156
|
def test_bundled_stack_harness_cleanup_skips_kept_stack(monkeypatch) -> None:
|
|
115
157
|
stop_calls: list[bool] = []
|
|
116
158
|
removed_paths: list[Path] = []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|