diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 9d80332aa..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "kapitan/reclass"] - path = kapitan/reclass - url = https://github.com/kapicorp/reclass.git diff --git a/Dockerfile b/Dockerfile index 2835ec0d3..a5bb8757b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,8 @@ WORKDIR /kapitan RUN apt-get update \ && apt-get install --no-install-recommends -y \ curl \ - build-essential + build-essential \ + git ENV POETRY_VERSION=1.7.1 ENV VIRTUAL_ENV=/opt/venv diff --git a/kapitan/inventory/inventory.py b/kapitan/inventory/inventory.py index c97d4d3e3..5e2b2f61b 100644 --- a/kapitan/inventory/inventory.py +++ b/kapitan/inventory/inventory.py @@ -13,7 +13,7 @@ from typing import overload, Union from kapitan.errors import KapitanError -from kapitan.reclass.reclass.values import item +from reclass.values import item logger = logging.getLogger(__name__) diff --git a/kapitan/reclass b/kapitan/reclass deleted file mode 160000 index d220e896a..000000000 --- a/kapitan/reclass +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d220e896a2465783abf298d71eb927de1f53a0ac diff --git a/poetry.lock b/poetry.lock index 3d4cb163b..e9ede092f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -386,6 +386,17 @@ ssh = ["bcrypt (>=3.1.5)"] test = ["pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] +[[package]] +name = "ddt" +version = "1.7.1" +description = "Data-Driven/Decorated Tests" +optional = false +python-versions = "*" +files = [ + {file = "ddt-1.7.1-py2.py3-none-any.whl", hash = "sha256:2c4ac421bbdc10d2403b472294500c6f75ca822386c34d9fe82882d7a2ce9682"}, + {file = "ddt-1.7.1.tar.gz", hash = "sha256:1a4472c477bf766f75f7b1efb628656ff3c35ff3f6c821129ae8e328fff8a9a2"}, +] + [[package]] name = "docker" version = "7.0.0" @@ -405,6 +416,18 @@ urllib3 = ">=1.26.0" [package.extras] ssh = ["paramiko (>=2.4.3)"] + +[[package]] +name = "enum34" +version = "1.1.10" +description = "Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4" +optional = false +python-versions = "*" +files = [ + {file = "enum34-1.1.10-py2-none-any.whl", hash = "sha256:a98a201d6de3f2ab3db284e70a33b0f896fbf35f8086594e8c9e74b909058d53"}, + {file = "enum34-1.1.10-py3-none-any.whl", hash = "sha256:c3858660960c984d6ab0ebad691265180da2b43f07e061c0f8dca9ef3cffd328"}, + {file = "enum34-1.1.10.tar.gz", hash = "sha256:cce6a7477ed816bd2542d03d53db9f0db935dd013b70f336a95c73979289f248"}, +] websockets = ["websocket-client (>=1.3.0)"] [[package]] @@ -1139,6 +1162,7 @@ files = [ {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, + {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, @@ -1147,11 +1171,34 @@ files = [ {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, + {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, ] +[[package]] +name = "reclass" +version = "1.6.0" +description = "merge data by recursive descent down an ancestry hierarchy (forked extended version)" +optional = false +python-versions = "*" +files = [] +develop = false + +[package.dependencies] +ddt = "*" +enum34 = "*" +pyparsing = "*" +pyyaml = "*" +six = "*" + +[package.source] +type = "git" +url = "https://github.com/kapicorp/reclass" +reference = "HEAD" +resolved_reference = "856b34cb77811d665c6346883238d436ac5c4924" + [[package]] name = "referencing" version = "0.32.1" @@ -1453,4 +1500,4 @@ test = ["docker"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "9702cab37a1a4e5f2d29fdd23503b299331fc1fb7cae5e7cc222cd88909b96e1" +content-hash = "2fe358199e545c228705fdc013d4d8591be337d462cb95a29f171cb3beeabf9c" diff --git a/pyproject.toml b/pyproject.toml index f7c3d8935..6c6e577c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,6 @@ license = "Apache-2.0" version = "0.33.0" packages = [ { include = "kapitan" }, - { include = "kapitan/reclass" }, ] [tool.poetry.scripts] @@ -63,6 +62,7 @@ packaging = "^23.0" typing-extensions = "^4.0.0" gojsonnet = { version = "^0.20.0", optional = true } docker = { version = ">=5,<8", optional = true } +reclass = {git = "https://github.com/kapicorp/reclass"} [tool.poetry.extras] gojsonnet = ["gojsonnet"] @@ -74,7 +74,6 @@ target-version = ['py310'] exclude = ''' ( /( - .*reclass.* | .*version.py ) ) diff --git a/tests/test_dependency_manager.py b/tests/test_dependency_manager.py index afc9d02ae..bcd17237c 100644 --- a/tests/test_dependency_manager.py +++ b/tests/test_dependency_manager.py @@ -79,79 +79,6 @@ def test_clone_repo_subdir(self): rmtree(temp_dir) rmtree(output_dir) - def test_clone_repo_submodules_false(self): - """ - Tests cloning git repo and check that submodule folder is empty - """ - temp_dir = tempfile.mkdtemp() - output_dir = tempfile.mkdtemp() - source = "https://github.com/kapicorp/kapitan.git" - dep = [ - { - "output_path": output_dir, - "ref": "master", - "submodules": False, - } - ] - fetch_git_dependency((source, dep), temp_dir, force=False) - self.assertEqual(os.listdir(os.path.join(output_dir, "kapitan", "reclass")), []) - rmtree(temp_dir) - rmtree(output_dir) - - def test_clone_repo_without_submodules(self): - """ - Tests cloning a git repo without any submodules - """ - temp_dir = tempfile.mkdtemp() - output_dir = tempfile.mkdtemp() - source = "https://github.com/kapicorp/reclass.git" - dep = [ - { - "output_path": output_dir, - "ref": "master", - } - ] - fetch_git_dependency((source, dep), temp_dir, force=False) - self.assertTrue(os.path.isdir(os.path.join(output_dir, "reclass"))) - rmtree(temp_dir) - rmtree(output_dir) - - def test_clone_repo_with_submodules(self): - """ - Tests cloning git repo and initialize its' submodule - """ - temp_dir = tempfile.mkdtemp() - output_dir = tempfile.mkdtemp() - source = "https://github.com/kapicorp/kapitan.git" - dep = [ - { - "output_path": output_dir, - "ref": "master", - } - ] - fetch_git_dependency((source, dep), temp_dir, force=False) - self.assertTrue(os.listdir(os.path.join(output_dir, "kapitan", "reclass"))) - rmtree(temp_dir) - rmtree(output_dir) - - def test_clone_repo_with_submodule_subdir(self): - """ - Tests cloning subdir in a git repo and initialize its' submodule - """ - temp_dir = tempfile.mkdtemp() - output_dir = tempfile.mkdtemp() - source = "https://github.com/kapicorp/kapitan.git" - dep = [ - { - "output_path": output_dir, - "ref": "master", - "subdir": "kapitan", - } - ] - fetch_git_dependency((source, dep), temp_dir, force=False) - self.assertTrue(os.listdir(os.path.join(output_dir, "reclass"))) - rmtree(temp_dir) - rmtree(output_dir) def test_fetch_helm_chart(self): """