Skip to content

Commit

Permalink
Update the version information accessing
Browse files Browse the repository at this point in the history
  • Loading branch information
FanwangM committed Oct 3, 2024
1 parent 3a5e3bd commit 2f0d486
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions atomdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

r"""AtomDB, a database of atomic and ionic properties."""

import importlib
from importlib.metadata import PackageNotFoundError

from atomdb.periodic import Element

from atomdb.species import Species
Expand All @@ -27,8 +30,6 @@

from atomdb.promolecule import make_promolecule

from atomdb.version import version


__all__ = [
"Element",
Expand All @@ -41,9 +42,14 @@
"load",
"dump",
"raw_datafile",
"make_promolecule" "version",
"make_promolecule",
]


__version__ = version
r"""AtomDB version string."""

try:
__version__ = importlib.metadata.version("qc-AtomDB")
except PackageNotFoundError:
# Package is not installed
print("Package 'qc-AtomDB' is not installed.")
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
# Module info
#

project = "AtomDB"
project = "qc-AtomDB"

project_copyright = "2024, QC-Devs"

author = "QC-Devs"

version = getattr(module, "version")
version = importlib.metadata.version("qc-AtomDB")

release = version

Expand Down

0 comments on commit 2f0d486

Please # to comment.