Skip to content

Commit

Permalink
Modify specs import
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Nov 28, 2023
1 parent fa66da9 commit ab45c5a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libmambapy/src/libmambapy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import libmambapy.bindings.specs
# Import all submodules so that one can use them directly with `import libmambapy`
import libmambapy.version
import libmambapy.specs

# Legacy which used to combine everything
from libmambapy.bindings.legacy import * # noqa: F403

# Define top-level attributes
__version__ = libmambapy.version.__version__

specs = libmambapy.bindings.specs
2 changes: 2 additions & 0 deletions libmambapy/src/libmambapy/specs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file exists on its own rather than in `__init__.py` to make `import libmambapy.specs` work.
from libmambapy.bindings.specs import * # noqa: F403
14 changes: 14 additions & 0 deletions libmambapy/tests/test_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@
import libmambapy


def test_import_submodule():
import libmambapy.specs as specs

# Dummy execution
_p = specs.Platform.noarch


def test_import_recursive():
import libmambapy as mamba

# Dummy execution
_p = mamba.specs.Platform.noarch


def test_Platform():
Platform = libmambapy.specs.Platform

Expand Down

0 comments on commit ab45c5a

Please sign in to comment.