Skip to content

Commit

Permalink
Merge pull request #67 from regro/update-deps
Browse files Browse the repository at this point in the history
chore: update requirements
  • Loading branch information
beckermr authored Jan 2, 2025
2 parents e68fd01 + 3fd2c07 commit cf17276
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: configure conda and install code
shell: bash -el {0}
run: |
mamba install --yes --file=requirements.txt
mamba install --yes pytest flaky pip python-build setuptools_scm>=7 setuptools>=45 toml
conda install --yes --file=requirements.txt
conda install --yes pytest flaky pip python-build setuptools_scm>=7 setuptools>=45 toml
pip install -e .
- name: test versions
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests_mamba.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ jobs:
- name: configure conda and install code
shell: bash -el {0}
run: |
mamba install --yes --file=requirements.txt
mamba install --yes pytest flaky pip python-build setuptools_scm>=7 setuptools>=45 toml
conda install --yes --file=requirements.txt
conda install --yes --file=requirements-mamba.txt
conda install --yes pytest flaky pip python-build setuptools_scm>=7 setuptools>=45 toml
pip install -e .
- name: test versions
Expand Down
1 change: 0 additions & 1 deletion conda_forge_feedstock_check_solvable/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flake8: noqa
from ._version import __version__
from .check_solvable import is_recipe_solvable
from .mamba_solver import MambaSolver
9 changes: 6 additions & 3 deletions conda_forge_feedstock_check_solvable/check_solvable.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from ruamel.yaml import YAML

import conda_forge_feedstock_check_solvable.utils
from conda_forge_feedstock_check_solvable.mamba_solver import mamba_solver_factory
from conda_forge_feedstock_check_solvable.rattler_build import invoke_rattler_build
from conda_forge_feedstock_check_solvable.rattler_solver import rattler_solver_factory
from conda_forge_feedstock_check_solvable.utils import (
Expand Down Expand Up @@ -106,7 +105,7 @@ def _is_recipe_solvable(
additional_channels=(),
build_platform=None,
verbosity=1,
solver="mamba",
solver="rattler",
timeout_timer=None,
fail_fast=False,
) -> Tuple[bool, List[str], Dict[str, bool]]:
Expand Down Expand Up @@ -199,7 +198,7 @@ def _is_recipe_solvable_on_platform(
arch,
build_platform_arch=None,
additional_channels=(),
solver_backend="mamba",
solver_backend="rattler",
timeout_timer=None,
fail_fast=False,
):
Expand Down Expand Up @@ -308,6 +307,10 @@ def _is_recipe_solvable_on_platform(
if solver_backend == "rattler":
solver_factory = rattler_solver_factory
elif solver_backend == "mamba":
from conda_forge_feedstock_check_solvable.mamba_solver import (
mamba_solver_factory,
)

solver_factory = mamba_solver_factory
else:
raise ValueError(f"Unknown solver backend {solver_backend}")
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ authors = [
{name = "conda-forge-tick development team", email = "[email protected]"},
]
description = "A mamba-based package to check if a conda-forge feedstock is solvable."
dynamic = ["version", "dependencies"]
dynamic = ["version", "dependencies", "optional-dependencies"]
license = {file = "LICENSE"}
readme = "README.md"

Expand All @@ -21,6 +21,7 @@ home = "https://github.com/regro/conda-forge-feedstock-check-solvable"

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies.mamba = { file = ["requirements-mamba.txt"] }

[tool.setuptools.packages.find]
exclude = ['tests*']
Expand Down
1 change: 1 addition & 0 deletions requirements-mamba.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libmambapy>=1.5.1,<2.0a0
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ conda
conda-package-handling
conda-smithy
conda-build
libmambapy>=1.5.1,<2.0a0
ruamel.yaml.jinja2
conda-forge-metadata>=0.2.0
conda-forge-metadata>=0.11.0
wurlitzer
requests
zstandard
boltons>=23.0.0
py-rattler>=0.6.2,<0.7a0
py-rattler>=0.9.0,<0.10a0
12 changes: 10 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@

import pytest

from conda_forge_feedstock_check_solvable.mamba_solver import mamba_solver_factory
from conda_forge_feedstock_check_solvable.rattler_solver import rattler_solver_factory

try:
from conda_forge_feedstock_check_solvable.mamba_solver import (
mamba_solver_factory,
)
except Exception:
mamba_solver_factory = None

FEEDSTOCK_DIR = os.path.join(os.path.dirname(__file__), "test_feedstock")
ALL_SOLVERS = ["rattler", "mamba"]
ALL_SOLVERS = ["rattler"]
if mamba_solver_factory is not None:
ALL_SOLVERS.append("mamba")


def pytest_addoption(parser):
Expand Down
20 changes: 16 additions & 4 deletions tests/test_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
import pytest
from flaky import flaky

from conda_forge_feedstock_check_solvable.mamba_solver import (
MambaSolver,
mamba_solver_factory,
)
try:
from conda_forge_feedstock_check_solvable.mamba_solver import (
MambaSolver,
mamba_solver_factory,
)
except Exception:
MambaSolver = mamba_solver_factory = None

from conda_forge_feedstock_check_solvable.rattler_solver import (
RattlerSolver,
rattler_solver_factory,
Expand Down Expand Up @@ -227,6 +231,10 @@ def test_solvers_hang(solver_factory):
assert res[0]


@pytest.mark.skipif(
MambaSolver is None or mamba_solver_factory is None,
reason="mamba not available",
)
@pytest.mark.parametrize("mamba_factory", [MambaSolver, mamba_solver_factory])
@pytest.mark.parametrize("rattler_factory", [RattlerSolver, rattler_solver_factory])
def test_solvers_compare_output(mamba_factory, rattler_factory):
Expand Down Expand Up @@ -373,6 +381,10 @@ def test_solvers_compare_output(mamba_factory, rattler_factory):
}


@pytest.mark.skipif(
MambaSolver is None or mamba_solver_factory is None,
reason="mamba not available",
)
@pytest.mark.parametrize("mamba_factory", [MambaSolver, mamba_solver_factory])
@pytest.mark.parametrize("rattler_factory", [RattlerSolver, rattler_solver_factory])
def test_solvers_python(mamba_factory, rattler_factory):
Expand Down

0 comments on commit cf17276

Please sign in to comment.