Skip to content

Commit

Permalink
More cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Jun 24, 2024
1 parent 0c70b01 commit b29a4bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 6 additions & 1 deletion custodian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
"""

import os
from importlib.metadata import PackageNotFoundError, version

from .custodian import Custodian

__author__ = (
"Shyue Ping Ong, William Davidson Richards, Stephen Dacek, Xiaohui Qu, Matthew Horton, "
"Samuel M. Blau, Janosh Riebesell"
)
__version__ = "2024.4.18"
try:
__version__ = version("pymatgen")
except PackageNotFoundError: # pragma: no cover
# package is not installed
pass


PKG_DIR = os.path.dirname(__file__)
Expand Down
6 changes: 0 additions & 6 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ def test(ctx) -> None:

@task
def set_ver(ctx) -> None:
with open("custodian/__init__.py") as file:
lines = [f'__version__ = "{NEW_VER}"' if "__version__" in line else line.rstrip() for line in file]

with open("custodian/__init__.py", "w") as file:
file.write("\n".join(lines) + "\n")

with open("pyproject.toml") as file:
lines = [re.sub(r"^version = \"([^,]+)\"", f'version = "{NEW_VER}"', line.rstrip()) for line in file]

Expand Down

0 comments on commit b29a4bf

Please sign in to comment.