Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 2657cf4

Browse files
committed
Remove non-functional last-install of komodo-shims
This is a partial fix, as Komodo currently can't build if komodo-shims is included.
1 parent 7068726 commit 2657cf4

2 files changed

Lines changed: 0 additions & 59 deletions

File tree

komodo/cli.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,9 @@ def pip_shell_command(
292292
makeopts,
293293
]
294294

295-
komodo_shims: Optional[Tuple[str, str]] = None
296295
for pkg, ver in release_file_content.items():
297296
if pkg == LAST_PIP_PACKAGE_TO_INSTALL:
298297
# This is a magic package name that will always be installed after all other pip packages if found.
299-
komodo_shims = (pkg, ver)
300298
continue
301299
pkg_data = repository_file_content[pkg][ver]
302300
if pkg_data["make"] != "pip":
@@ -307,9 +305,6 @@ def pip_shell_command(
307305
)
308306
print(shell(shell_input))
309307

310-
if komodo_shims is not None:
311-
print(shell(pip_shell_command(komodo_shims[0], komodo_shims[1], None)))
312-
313308

314309
def run_post_installation_scripts_if_set(
315310
postinst: Optional[str], release_path: Path

tests/test_cli.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
import shutil
33
import sys
44
from pathlib import Path
5-
from unittest.mock import Mock, patch
65

76
import pytest
8-
import yaml
97

10-
from komodo import cli
118
from komodo.cli import cli_main
129
from tests import _get_test_root
1310

@@ -237,54 +234,3 @@ def count_release_folders_to_be_deleted() -> int:
237234
assert count_release_folders_to_be_deleted() == len(test_dirs)
238235
cli_main()
239236
assert count_release_folders_to_be_deleted() == 0
240-
241-
242-
def test_komodo_shims_is_installed_at_the_end(tmpdir):
243-
(Path(tmpdir) / "release.yml").write_text(
244-
"komodo-shims: 1.0.0\npython: 3-builtin\ntreelib: 1.7.0", encoding="utf-8"
245-
)
246-
repo = {
247-
"python": {
248-
"3-builtin": {
249-
"make": "pip", # because why not
250-
"maintainer": "foo",
251-
}
252-
},
253-
"treelib": {
254-
"1.7.0": {
255-
"source": "pypi",
256-
"make": "pip",
257-
"maintainer": "bar",
258-
"depends": ["python"],
259-
}
260-
},
261-
"komodo-shims": {
262-
"1.0.0": {"source": "pypi", "make": "pip", "maintainer": "com"}
263-
},
264-
}
265-
(Path(tmpdir) / "repository.yml").write_text(yaml.dump(repo), encoding="utf-8")
266-
sys.argv = [
267-
"kmd",
268-
"--workspace",
269-
str(tmpdir),
270-
str(tmpdir / "release.yml"),
271-
str(tmpdir / "repository.yml"),
272-
"--release",
273-
"a_komodo_release_with_shims",
274-
"--prefix",
275-
str(tmpdir),
276-
]
277-
278-
mocked_shell = Mock(return_value=b"")
279-
mocked_fetch = Mock(return_value={})
280-
with patch.object(cli, "shell", mocked_shell), patch.object(
281-
cli, "fetch", mocked_fetch
282-
):
283-
cli_main()
284-
pip_install_calls = [
285-
shell_call
286-
for shell_call in mocked_shell.mock_calls
287-
if "'pip', 'install " in str(shell_call.args[0])
288-
]
289-
assert len(pip_install_calls) == 3
290-
assert "komodo-shims" in str(pip_install_calls[-1])

0 commit comments

Comments
 (0)