Skip to content

Commit

Permalink
Add version import (#180)
Browse files Browse the repository at this point in the history
* add version import

* import on runtime and add test of import

* add write_to

* Fix package name

* Flake fixes

* setuptools_scm defaults?

* remove unnecssary extra arg

---------

Co-authored-by: Giacomo Galloni <[email protected]>
  • Loading branch information
itrharrison and ggalloni authored Jul 18, 2024
1 parent 3e67d03 commit 4b414cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions soliket/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("soliket")
except PackageNotFoundError:
# package is not installed
pass

from .bandpass import BandPass
from .bias import Bias, Linear_bias
from .ccl import CCL
Expand Down
8 changes: 8 additions & 0 deletions soliket/tests/test_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def test_soliket_import():
import soliket # noqa: F401


def test_soliket_version():
import soliket

assert soliket.__version__

0 comments on commit 4b414cb

Please sign in to comment.