From 18d5cc0c6d17eafeb36d40512e8967c4c1678c53 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Tue, 20 Aug 2024 17:34:23 -0400 Subject: [PATCH 1/3] adding app to the toml (#183) --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 273ea25e..fb54d2ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,9 @@ classifiers = [ 'Topic :: Scientific/Engineering :: Chemistry', ] +[project.scripts] +pdfgui = "diffpy.pdfgui.pdfgui:main" + [project.urls] Homepage = "https://github.com/diffpy/diffpy.pdfgui/" Issues = "https://github.com/diffpy/diffpy.pdfgui/issues/" From 9177637cc36cab4b48d2d2289c32d8d8f617d9a7 Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Tue, 20 Aug 2024 23:06:44 -0400 Subject: [PATCH 2/3] fix app dir in toml (#185) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fb54d2ca..f1926b11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ classifiers = [ ] [project.scripts] -pdfgui = "diffpy.pdfgui.pdfgui:main" +pdfgui = "diffpy.pdfgui.applications.pdfgui:main" [project.urls] Homepage = "https://github.com/diffpy/diffpy.pdfgui/" From aeca43d80bbfcf45b025eb8c2e363e2016b09493 Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:10:40 -0400 Subject: [PATCH 3/3] try version fix (#191) --- src/diffpy/pdfgui/version.py | 40 ++++++------------------------------ 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/src/diffpy/pdfgui/version.py b/src/diffpy/pdfgui/version.py index 037c944b..faf07aea 100644 --- a/src/diffpy/pdfgui/version.py +++ b/src/diffpy/pdfgui/version.py @@ -13,41 +13,13 @@ # ############################################################################## -""" -Definition of __version__, __date__, __timestamp__, __git_commit__. +"""Definition of __version__ and __date__.""" -Notes ------ -Variable `__gitsha__` is deprecated as of version 1.2. -Use `__git_commit__` instead. -""" +import os +import time +from importlib.metadata import distribution, version -__all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] - -import os.path -from importlib.resources import files - -# obtain version information from the version.cfg file -cp = dict(version="", date="", commit="", timestamp="0") -fcfg = str(files(__name__).joinpath("version.cfg")) -if not os.path.isfile(fcfg): # pragma: no cover - from warnings import warn - - warn("Package metadata not found.") - fcfg = os.devnull -with open(fcfg) as fp: - kwords = [[w.strip() for w in line.split(" = ", 1)] for line in fp if line[:1].isalpha() and " = " in line] -assert all(w[0] in cp for w in kwords), "received unrecognized keyword" -cp.update(kwords) - -__version__ = cp["version"] -__date__ = cp["date"] -__git_commit__ = cp["commit"] -__timestamp__ = int(cp["timestamp"]) - -# TODO remove deprecated __gitsha__ in version 1.3. -__gitsha__ = __git_commit__ - -del cp, fcfg, fp, kwords +__date__ = time.ctime(os.path.getctime(distribution("diffpy.pdfgui")._path)) +__version__ = version("diffpy.pdfgui") # End of file