Skip to content

Commit

Permalink
Fix version numbering (#110)
Browse files Browse the repository at this point in the history
* Use dynamic version numbers

* Update the version information accessing
  • Loading branch information
FanwangM authored Oct 3, 2024
1 parent 9c42c36 commit 3457308
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 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.")
25 changes: 0 additions & 25 deletions atomdb/version.py

This file was deleted.

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 3457308

Please sign in to comment.