foundry-dev-tools 1.4.1__tar.gz → 1.4.3__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.
- {foundry_dev_tools-1.4.1/src/foundry_dev_tools.egg-info → foundry_dev_tools-1.4.3}/PKG-INFO +1 -1
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/changelog.md +11 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/config.py +4 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/repo.py +36 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3/src/foundry_dev_tools.egg-info}/PKG-INFO +1 -1
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/transforms/api/_dataset.py +2 -23
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_utils_repo.py +45 -22
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/utils.py +33 -1
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.github/ISSUE_TEMPLATE/blank_issue.yml +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.github/pull_request_template.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.github/workflows/ci.yml +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.github/workflows/docs.yml +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.gitignore +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.pre-commit-config.yaml +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/LICENSE +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/README.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/Configuration_usage.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/FoundryFileSystem_usage.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/FoundryRestClient_usage.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/SSO_usage.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/_static/.gitignore +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/architecture.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/cli.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/conf.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/contributors.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/develop.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/index.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/installation.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/license.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/pictures/mermaid-diagram-already-cached-dark.svg +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/pictures/mermaid-diagram-already-cached-light.svg +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/pictures/mermaid-diagram-new-transaction-dark.svg +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/pictures/mermaid-diagram-new-transaction-light.svg +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/pictures/tpa_config.png +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/requirements.txt +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/s3.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/docs/usage_and_examples.md +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/pyproject.toml +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/setup.cfg +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/setup.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/__about__.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/__init__.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/cached_foundry_client.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/cli/__init__.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/cli/build.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/cli/info.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/cli/main.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/cli/s3.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/foundry_api_client.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/fsspec_impl.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/__init__.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/async_s3.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/caches/__init__.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/caches/metadata_store.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/caches/spark_caches.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/converter/__init__.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/converter/foundry_spark.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/importer.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/misc.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/s3.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/spark.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/token_provider.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/SOURCES.txt +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/dependency_links.txt +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/entry_points.txt +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/not-zip-safe +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/requires.txt +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/top_level.txt +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/transforms/__init__.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/transforms/api/__init__.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/transforms/api/_configure.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/transforms/api/_decorators.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/transforms/api/_transform.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/__init__.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/conftest.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/foundry_mock_client.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_cached_foundry_client.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_cached_foundry_client_integration.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_cli_build.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_cli_info.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_config.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_data/binary_dataset/bin +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_data/iris/iris.csv +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_foundry_api.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_foundry_local_deprecation.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_foundry_mock.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_foundry_spark_converters.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_foundry_sql_client.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_fsspec_impl.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_importer.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_multipass_tpa.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_s3.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_spark_caches.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_token_provider.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_transforms.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_transforms_integration.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_utils_misc.py +0 -0
- {foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: foundry-dev-tools
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.3
|
|
4
4
|
Summary: Seamlessly run your Palantir Foundry Repository transforms code on your local machine.
|
|
5
5
|
Author-email: Nicolas Renkamp <nicolas.renkamp@merckgroup.com>, Jonas Wunderlich <jonas.wunderlich@merckgroup.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog],
|
|
6
6
|
and this project adheres to [Semantic Versioning].
|
|
7
7
|
|
|
8
|
+
## [1.4.3] - 2024-07-11
|
|
9
|
+
|
|
10
|
+
## Fixed
|
|
11
|
+
- Also check current working directory for project specific config, useful for Jupyter notebooks
|
|
12
|
+
|
|
13
|
+
## [1.4.2] - 2024-06-03
|
|
14
|
+
|
|
15
|
+
## Added
|
|
16
|
+
- Support for git submodules in transforms (#57)
|
|
17
|
+
|
|
8
18
|
## [1.4.1] - 2024-05-29
|
|
9
19
|
|
|
10
20
|
## Added
|
|
@@ -204,6 +214,7 @@ and this project adheres to [Semantic Versioning].
|
|
|
204
214
|
[Keep a Changelog]: https://keepachangelog.com/en/1.0.0/
|
|
205
215
|
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html
|
|
206
216
|
|
|
217
|
+
[1.4.2]: https://github.com/emdgroup/foundry-dev-tools/compare/v1.4.1...v1.4.2
|
|
207
218
|
[1.4.1]: https://github.com/emdgroup/foundry-dev-tools/compare/v1.4.0...v1.4.1
|
|
208
219
|
[1.4.0]: https://github.com/emdgroup/foundry-dev-tools/compare/v1.3.5...v1.4.0
|
|
209
220
|
[1.3.5]: https://github.com/emdgroup/foundry-dev-tools/compare/v1.3.4...v1.3.5
|
|
@@ -9,6 +9,7 @@ Usage:
|
|
|
9
9
|
Configuration.get('transforms_sql_sample_row_limit')
|
|
10
10
|
|
|
11
11
|
"""
|
|
12
|
+
|
|
12
13
|
import inspect
|
|
13
14
|
import logging
|
|
14
15
|
import os
|
|
@@ -135,6 +136,9 @@ def initial_config(
|
|
|
135
136
|
if not project_dir:
|
|
136
137
|
caller_filename = inspect.stack()[-1].filename
|
|
137
138
|
project_config_file = find_project_config_file(Path(caller_filename).parent)
|
|
139
|
+
# check also the cwd, useful for Jupyter Notebooks
|
|
140
|
+
if not project_config_file:
|
|
141
|
+
project_config_file = find_project_config_file(Path.cwd())
|
|
138
142
|
else:
|
|
139
143
|
project_config_file = find_project_config_file(project_dir)
|
|
140
144
|
if project_config_file:
|
|
@@ -121,6 +121,42 @@ def git_toplevel_dir(
|
|
|
121
121
|
return None
|
|
122
122
|
|
|
123
123
|
|
|
124
|
+
def get_branch(caller_filename: Path) -> str:
|
|
125
|
+
"""Get name of current checked out git branch as defined in the git HEAD file.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
caller_filename (Path): Path of file that calls the function
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
str: Name of checked out branch
|
|
132
|
+
"""
|
|
133
|
+
git_dir = git_toplevel_dir(caller_filename)
|
|
134
|
+
if not git_dir:
|
|
135
|
+
# fallback for VS Interactive Console
|
|
136
|
+
# or Jupyter lab on Windows
|
|
137
|
+
git_dir = Path.cwd()
|
|
138
|
+
|
|
139
|
+
if git_dir.joinpath(".git").is_file():
|
|
140
|
+
# Infer branch from git submodule
|
|
141
|
+
with git_dir.joinpath(".git").open() as gf:
|
|
142
|
+
rel_submodule_git_dir = gf.read().strip().replace("gitdir: ", "")
|
|
143
|
+
head_file = git_dir.joinpath(rel_submodule_git_dir, "HEAD").resolve()
|
|
144
|
+
else:
|
|
145
|
+
head_file = git_dir.joinpath(".git", "HEAD")
|
|
146
|
+
|
|
147
|
+
if head_file.is_file():
|
|
148
|
+
with head_file.open() as hf:
|
|
149
|
+
ref = hf.read().strip()
|
|
150
|
+
|
|
151
|
+
if ref.startswith("ref: refs/heads/"):
|
|
152
|
+
return ref[16:]
|
|
153
|
+
|
|
154
|
+
return "HEAD" # immitate behaviour of `git rev-parse --abbrev-ref HEAD`
|
|
155
|
+
|
|
156
|
+
warnings.warn("Could not detect git branch of project, falling back to 'master'.")
|
|
157
|
+
return "master"
|
|
158
|
+
|
|
159
|
+
|
|
124
160
|
def find_project_config_file(
|
|
125
161
|
project_directory: "Path | None" = None, use_git: bool = False
|
|
126
162
|
) -> "Path | None":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: foundry-dev-tools
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.3
|
|
4
4
|
Summary: Seamlessly run your Palantir Foundry Repository transforms code on your local machine.
|
|
5
5
|
Author-email: Nicolas Renkamp <nicolas.renkamp@merckgroup.com>, Jonas Wunderlich <jonas.wunderlich@merckgroup.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -23,7 +23,7 @@ from foundry_dev_tools.foundry_api_client import (
|
|
|
23
23
|
)
|
|
24
24
|
from foundry_dev_tools.utils.caches.spark_caches import DiskPersistenceBackedSparkCache
|
|
25
25
|
from foundry_dev_tools.utils.misc import is_dataset_a_view
|
|
26
|
-
from foundry_dev_tools.utils.repo import
|
|
26
|
+
from foundry_dev_tools.utils.repo import get_branch
|
|
27
27
|
|
|
28
28
|
LOGGER = logging.getLogger(__name__)
|
|
29
29
|
|
|
@@ -87,7 +87,7 @@ class Input:
|
|
|
87
87
|
self._cache = DiskPersistenceBackedSparkCache(**self.config)
|
|
88
88
|
self._spark_df = None
|
|
89
89
|
if branch is None:
|
|
90
|
-
branch =
|
|
90
|
+
branch = get_branch(Path(caller_filename))
|
|
91
91
|
|
|
92
92
|
if self._is_online:
|
|
93
93
|
(
|
|
@@ -279,27 +279,6 @@ class Input:
|
|
|
279
279
|
)
|
|
280
280
|
|
|
281
281
|
|
|
282
|
-
def _get_branch(caller_filename: Path) -> str:
|
|
283
|
-
git_dir = git_toplevel_dir(caller_filename)
|
|
284
|
-
if not git_dir:
|
|
285
|
-
# fallback for VS Interactive Console
|
|
286
|
-
# or Jupyter lab on Windows
|
|
287
|
-
git_dir = Path.cwd()
|
|
288
|
-
|
|
289
|
-
head_file = git_dir.joinpath(".git", "HEAD")
|
|
290
|
-
if head_file.is_file():
|
|
291
|
-
with head_file.open() as hf:
|
|
292
|
-
ref = hf.read().strip()
|
|
293
|
-
|
|
294
|
-
if ref.startswith("ref: refs/heads/"):
|
|
295
|
-
return ref[16:]
|
|
296
|
-
|
|
297
|
-
return "HEAD" # immitate behaviour of `git rev-parse --abbrev-ref HEAD`
|
|
298
|
-
|
|
299
|
-
warnings.warn("Could not detect git branch of project, falling back to 'master'.")
|
|
300
|
-
return "master"
|
|
301
|
-
|
|
302
|
-
|
|
303
282
|
class Output:
|
|
304
283
|
"""Specification of a transform dataset output.
|
|
305
284
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import subprocess
|
|
2
3
|
import uuid
|
|
3
4
|
from pathlib import Path
|
|
@@ -5,7 +6,8 @@ from typing import TYPE_CHECKING
|
|
|
5
6
|
|
|
6
7
|
import pytest
|
|
7
8
|
|
|
8
|
-
from foundry_dev_tools.utils.repo import get_repo, git_toplevel_dir
|
|
9
|
+
from foundry_dev_tools.utils.repo import get_branch, get_repo, git_toplevel_dir
|
|
10
|
+
from tests.utils import add_git_submodule
|
|
9
11
|
|
|
10
12
|
if TYPE_CHECKING:
|
|
11
13
|
import py.path
|
|
@@ -24,44 +26,65 @@ def test_git_toplevel_dir(use_git: bool, tmpdir: "py.path.LocalPath", git_env: d
|
|
|
24
26
|
assert git_dir_cwd == toplevel
|
|
25
27
|
|
|
26
28
|
# Test if git submodules can be recognized as toplevel_dir
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
submodule_name = "dummy_submodule"
|
|
30
|
+
add_git_submodule(git_dir=toplevel, submodule_name=submodule_name, git_env=git_env)
|
|
31
|
+
toplevel_submodule = toplevel.joinpath(submodule_name)
|
|
32
|
+
git_dir_submodule = git_toplevel_dir(
|
|
33
|
+
Path(tmpdir.mkdir(submodule_name, "submodule_subdirectory")), use_git=use_git
|
|
34
|
+
)
|
|
35
|
+
assert git_dir_submodule == toplevel_submodule
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def test_get_branch(tmpdir: "py.path.LocalPath", git_env: dict):
|
|
39
|
+
toplevel = Path(tmpdir)
|
|
40
|
+
|
|
41
|
+
# Test without git submodule
|
|
42
|
+
parent_repo_name = "parent_repo"
|
|
43
|
+
target_branch_name_parent = "parent_repo_main"
|
|
29
44
|
subprocess.check_call(
|
|
30
45
|
[
|
|
31
46
|
"git",
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
"-
|
|
35
|
-
"Initialize",
|
|
47
|
+
"init",
|
|
48
|
+
parent_repo_name,
|
|
49
|
+
f"--initial-branch={target_branch_name_parent}",
|
|
36
50
|
],
|
|
37
|
-
cwd=toplevel
|
|
51
|
+
cwd=toplevel,
|
|
38
52
|
env=git_env,
|
|
39
53
|
)
|
|
54
|
+
branch_name = get_branch(toplevel.joinpath(parent_repo_name))
|
|
55
|
+
assert branch_name == target_branch_name_parent
|
|
40
56
|
|
|
41
|
-
#
|
|
57
|
+
# Test for git submodule
|
|
58
|
+
# Add an empty submodule
|
|
59
|
+
submodule_name = "dummy_submodule"
|
|
60
|
+
add_git_submodule(
|
|
61
|
+
git_dir=toplevel.joinpath(parent_repo_name),
|
|
62
|
+
submodule_name=submodule_name,
|
|
63
|
+
git_env=git_env,
|
|
64
|
+
)
|
|
65
|
+
# Checkout and test new branch from submodule
|
|
66
|
+
target_branch_name_sub = "submodule_repo_dev"
|
|
67
|
+
git_dir_submodule = toplevel.joinpath(parent_repo_name, submodule_name)
|
|
42
68
|
subprocess.check_call(
|
|
43
69
|
[
|
|
44
70
|
"git",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
"add",
|
|
49
|
-
"./dummy_repo",
|
|
50
|
-
"dummy_submodule",
|
|
71
|
+
"checkout",
|
|
72
|
+
"-b",
|
|
73
|
+
target_branch_name_sub,
|
|
51
74
|
],
|
|
52
|
-
cwd=
|
|
53
|
-
|
|
54
|
-
toplevel_submodule = toplevel.joinpath("dummy_submodule")
|
|
55
|
-
git_dir_submodule = git_toplevel_dir(
|
|
56
|
-
Path(tmpdir.mkdir("dummy_submodule", "submodule_subdirectory")), use_git=use_git
|
|
75
|
+
cwd=git_dir_submodule,
|
|
76
|
+
env=git_env,
|
|
57
77
|
)
|
|
58
|
-
assert git_dir_submodule
|
|
78
|
+
assert os.path.isfile(git_dir_submodule.joinpath(".git"))
|
|
79
|
+
|
|
80
|
+
branch_name = get_branch(git_dir_submodule)
|
|
81
|
+
assert branch_name == target_branch_name_sub
|
|
59
82
|
|
|
60
83
|
|
|
61
84
|
def test_get_repo(tmpdir: "py.path.LocalPath", git_env: dict):
|
|
62
85
|
repo_rid = f"ri.stemma.main.repository{uuid.uuid4()}"
|
|
63
86
|
git_dir = Path(tmpdir)
|
|
64
|
-
subprocess.check_call(["git", "init"], cwd=git_dir)
|
|
87
|
+
subprocess.check_call(["git", "init"], cwd=git_dir, env=git_env)
|
|
65
88
|
with git_dir.joinpath("gradle.properties").open("w+") as gradle_prop:
|
|
66
89
|
gradle_prop.write(f"transformsRepoRid = {repo_rid}")
|
|
67
90
|
|
|
@@ -3,9 +3,10 @@ import glob
|
|
|
3
3
|
import os
|
|
4
4
|
import os.path
|
|
5
5
|
import random
|
|
6
|
+
import subprocess
|
|
6
7
|
from decimal import Decimal
|
|
7
8
|
from pathlib import Path, PurePosixPath
|
|
8
|
-
from typing import TYPE_CHECKING
|
|
9
|
+
from typing import TYPE_CHECKING, Dict
|
|
9
10
|
|
|
10
11
|
import numpy as np
|
|
11
12
|
|
|
@@ -401,3 +402,34 @@ def generate_test_dataset(spark_session, output_folder, n_rows=50000):
|
|
|
401
402
|
df = spark_session.createDataFrame(pdf, schema=schema).repartition(10)
|
|
402
403
|
spark_write_path = f"{output_folder}/spark"
|
|
403
404
|
df.write.format("parquet").save(path=spark_write_path)
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
def add_git_submodule(git_dir: Path, submodule_name: str, git_env: Dict) -> None:
|
|
408
|
+
# First create an empty local repository and initialize it
|
|
409
|
+
subprocess.check_call(["git", "init", "dummy_repo"], cwd=git_dir, env=git_env)
|
|
410
|
+
subprocess.check_call(
|
|
411
|
+
[
|
|
412
|
+
"git",
|
|
413
|
+
"commit",
|
|
414
|
+
"--allow-empty",
|
|
415
|
+
"-m",
|
|
416
|
+
"Initialize",
|
|
417
|
+
],
|
|
418
|
+
cwd=git_dir.joinpath("dummy_repo"),
|
|
419
|
+
env=git_env,
|
|
420
|
+
)
|
|
421
|
+
|
|
422
|
+
# Add local repository as submodule to toplevel repo
|
|
423
|
+
subprocess.check_call(
|
|
424
|
+
[
|
|
425
|
+
"git",
|
|
426
|
+
"-c",
|
|
427
|
+
"protocol.file.allow=always",
|
|
428
|
+
"submodule",
|
|
429
|
+
"add",
|
|
430
|
+
"./dummy_repo",
|
|
431
|
+
submodule_name,
|
|
432
|
+
],
|
|
433
|
+
cwd=git_dir,
|
|
434
|
+
env=git_env,
|
|
435
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/.github/ISSUE_TEMPLATE/feature_request.yml
RENAMED
|
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
|
|
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
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/cached_foundry_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/foundry_api_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/caches/__init__.py
RENAMED
|
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
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools/utils/token_provider.py
RENAMED
|
File without changes
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/requires.txt
RENAMED
|
File without changes
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/src/foundry_dev_tools.egg-info/top_level.txt
RENAMED
|
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
|
{foundry_dev_tools-1.4.1 → foundry_dev_tools-1.4.3}/tests/test_cached_foundry_client_integration.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|