Skip to content

#6: Implemented conda install packages#25

Merged
tomuben merged 27 commits intomainfrom
feature/6_implement_conda_install
Feb 5, 2026
Merged

#6: Implemented conda install packages#25
tomuben merged 27 commits intomainfrom
feature/6_implement_conda_install

Conversation

@sgn4sangar
Copy link
Copy Markdown
Collaborator

fixes #6

log: CommandLogger,
) -> int:
if len(conda_packages.packages) > 0:
cmd_n_errs = prepare_all_cmds(conda_packages, conda_binary)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that you also need to set the following environment variables:
MAMBA_EXE="/bin/micromamba";
MAMBA_ROOT_PREFIX="/opt/conda';
CONDA_ROOT_PREFIX="/opt/conda';

For now, you can set it using hard-coded values. Later the values will be stored in the Pydantic model.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgn4sangar you probably need to add a new parameter to the CommandExecutor to pass these environment variables. Popen accepts a dictionary with environment variables

@tomuben tomuben temporarily deployed to manual-approval February 4, 2026 13:20 — with GitHub Actions Inactive
…onda_install

# Conflicts:
#	doc/changes/unreleased.md
#	exasol/exaslpm/pkg_mgmt/install_micromamba.py
#	exasol/exaslpm/pkg_mgmt/install_packages.py
#	exasol/exaslpm/pkg_mgmt/micromamba_env.py
#	test/integration/docker_test_environment/docker_test_container.py
#	test/integration/package_fixtures.py
#	test/integration/test_install_micromamba_via_binary.py
#	test/integration/test_install_micromamba_via_command_executor.py
#	test/unit/pkg_mgmt/test_install_micromamba.py
#	test/unit/pkg_mgmt/test_install_packages.py
@tomuben tomuben temporarily deployed to manual-approval February 4, 2026 17:05 — with GitHub Actions Inactive
@tomuben tomuben temporarily deployed to manual-approval February 4, 2026 17:08 — with GitHub Actions Inactive
Comment thread test/integration/package_fixtures.py
"exasol-db-api @ https://exasol.org/exasol-db-api\n"
)

assert context_with_python_env.binary_checker.check_binary.mock_calls == [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Came into my mind that it would be good to test this, when writing the conda install packages test. So , I added same check here.

2. Activated negative test for install conda packages
@tomuben tomuben temporarily deployed to manual-approval February 4, 2026 17:19 — with GitHub Actions Inactive
@tomuben tomuben temporarily deployed to manual-approval February 4, 2026 17:20 — with GitHub Actions Inactive
@tomuben tomuben changed the title #6: Implemented conda install #6: Implemented conda install packages Feb 4, 2026
Comment thread exasol/exaslpm/pkg_mgmt/install_conda_packages.py Outdated
packages = json.loads(out.strip())
return [
CondaPackage(
name=pkg["name"], version=pkg["version"], channel=pkg["channel"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you get the build parsed out of the json?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, added it.

Comment thread test/integration/package_fixtures.py
Comment thread exasol/exaslpm/pkg_mgmt/install_conda_packages.py Outdated
@tomuben tomuben temporarily deployed to manual-approval February 5, 2026 09:44 — with GitHub Actions Inactive
@tomuben tomuben temporarily deployed to manual-approval February 5, 2026 10:08 — with GitHub Actions Inactive
@tomuben tomuben temporarily deployed to manual-approval February 5, 2026 10:26 — with GitHub Actions Inactive
output_file: TextIOBase, all_packages: list[CondaPackage]
) -> None:
for package in all_packages:
channel_str = f"{package.channel}::" if package.channel else ""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually meant to extract the construction of a single package string, because then you can test this properly with unit tests, but it is good enough this way

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As dicsussed offline, lets do it later.

Comment thread test/integration/package_utils.py Outdated
if expected.channel and expected.channel != installed.channel:
return False

if expected.build and expected.build != installed.build:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected build could be in theory a string with wildcards. I guess you didn't use a build string in the tests.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the numpy package definition in integration test to:

CondaPackage(
                                    name="numpy", version=">=2.3.0,<3", channel="main", build="py314*"
                                ),

and adjusted the ContainsCondaPackages class to work with wildcards in build string.

@tomuben tomuben temporarily deployed to manual-approval February 5, 2026 13:43 — with GitHub Actions Inactive
@tomuben tomuben temporarily deployed to manual-approval February 5, 2026 13:44 — with GitHub Actions Inactive
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 5, 2026

@tomuben tomuben merged commit 984023e into main Feb 5, 2026
30 checks passed
@tomuben tomuben deleted the feature/6_implement_conda_install branch February 5, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement install command for Conda

3 participants