Skip to content

Commit

Permalink
Remove debug logs etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Hind-M committed Jan 15, 2025
1 parent 1969df7 commit 6d218d8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unix_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
run: |
export TEST_MAMBA_EXE=$(pwd)/build/micromamba/mamba
unset CONDARC # Interferes with tests
python -m pytest micromamba/tests/test_repoquery.py::test_whoneeds_not_installed_with_channel_no_json \
python -m pytest micromamba/tests/ \
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }}
verify_pkg_tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,5 @@ jobs:
$env:TEST_MAMBA_EXE = Join-Path -Path $pwd -ChildPath 'local\bin\mamba.exe'
$env:MAMBA_TEST_SHELL_TYPE='powershell'
Remove-Item -Path "env:CONDARC"
python -m pytest micromamba/tests/test_repoquery.py::test_whoneeds_not_installed_with_channel_no_json `
python -m pytest micromamba/tests/ `
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }}
27 changes: 0 additions & 27 deletions libmamba/src/core/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,10 +586,6 @@ namespace mamba
auto QueryResult::table(std::ostream& out, const std::vector<std::string_view>& columns) const
-> std::ostream&
{
for (auto& col : columns)
{
std::cout << "col: " << col << std::endl;
}
if (m_pkg_id_list.empty())
{
out << "No entries matching \"" << m_query << "\" found" << std::endl;
Expand Down Expand Up @@ -624,13 +620,9 @@ namespace mamba
else
{
auto sfmt = util::split(col, ":", 1);
std::cout << "sfmt[0]: " << sfmt[0] << " sfmt[1]: " << sfmt[1] << std::endl;
headers.emplace_back(sfmt[0]);
cmds.push_back(sfmt[0]);
args.push_back(sfmt[1]);

std::cout << "just after push back, last cmd: " << cmds.back() << std::endl;
std::cout << "just after push back, last arg: " << args.back() << std::endl;
}
// By default, columns are left aligned.
alignments.push_back(printers::alignment::left);
Expand All @@ -639,17 +631,6 @@ namespace mamba
auto format_row =
[&](const specs::PackageInfo& pkg, const std::vector<specs::PackageInfo>& builds)
{
std::cout << " IN format_row, cmds size: " << cmds.size()
<< " args size: " << args.size() << std::endl;
for (auto& c : cmds)
{
std::cout << "cmd: " << c << std::endl;
}
for (auto& a : args)
{
std::cout << "arg: " << a << std::endl;
}
// throw; // stop execution for debugging
std::vector<mamba::printers::FormattedString> row;
for (std::size_t i = 0; i < cmds.size(); ++i)
{
Expand Down Expand Up @@ -686,19 +667,11 @@ namespace mamba
}
else if (cmd == "Depends")
{
std::cout << "CMD is depends" << std::endl;
// std::cout << "pkg name: " << pkg.name
// << " and deps size: " <<
// pkg.dependencies.size() << std::endl;
std::string depends_qualifier;
for (const auto& dep : pkg.dependencies)
{
// std::cout << "dep: " << dep << " args i: " <<
// args[i] << std::endl;
if (util::starts_with(dep, args[i]))
{
// std::cout << "Pushing bak dep " <<
// std::endl;
depends_qualifier = dep;
break;
}
Expand Down
37 changes: 11 additions & 26 deletions micromamba/tests/test_repoquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,33 +162,18 @@ def test_whoneeds_not_installed_with_channel(yaml_env: Path, with_platform):
assert any(x["name"] == "qpot" for x in pkgs)


# @pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
# @pytest.mark.parametrize("spec", ("xtensor", "xtensor=0.24.5"))
# def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path, spec):
# res = helpers.umamba_repoquery("whoneeds", "-c", "conda-forge", spec, "--platform", "osx-64")
# assert "Name Version Build Depends Channel Subdir" in helpers.remove_whitespaces(res)
# if spec == "xtensor=0.24.5": # `Depends` column is empty here (bug?)
# print(res)
# assert "cascade 0.1.1 py38h5ce3968_0 conda-forge osx-64" in helpers.remove_whitespaces(res)
# else:
# print(res)
# assert (
# "cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64"
# in helpers.remove_whitespaces(res)
# )


# @pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path):
res = helpers.umamba_repoquery(
"whoneeds", "-c", "conda-forge", "xtensor", "--platform", "osx-64"
)
@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
@pytest.mark.parametrize("spec", ("xtensor", "xtensor=0.24.5"))
def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path, spec):
res = helpers.umamba_repoquery("whoneeds", "-c", "conda-forge", spec, "--platform", "osx-64")
assert "Name Version Build Depends Channel Subdir" in helpers.remove_whitespaces(res)

print(res)
assert "cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64" in helpers.remove_whitespaces(
res
)
if spec == "xtensor=0.24.5": # `Depends` column is empty here (bug?)
assert "cascade 0.1.1 py38h5ce3968_0 conda-forge osx-64" in helpers.remove_whitespaces(res)
else:
assert (
"cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64"
in helpers.remove_whitespaces(res)
)


@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
Expand Down

0 comments on commit 6d218d8

Please sign in to comment.