Skip to content

Commit a6c0e0f

Browse files
authored
Merge pull request #151 from stevenhua0320/scikit-update-3
skpkg: change version build file.
2 parents 3d87783 + d352c09 commit a6c0e0f

File tree

6 files changed

+18
-20
lines changed

6 files changed

+18
-20
lines changed

src/diffpy/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,3 @@
1414
# See LICENSE.rst for license information.
1515
#
1616
##############################################################################
17-
"""diffpy - tools for structure analysis by diffraction.
18-
19-
Blank namespace package for module diffpy."""
20-
21-
22-
from pkgutil import extend_path
23-
24-
__path__ = extend_path(__path__, __name__)
25-
26-
# End of file

src/diffpy/pdffit2/version.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@
77
# File coded by: Billinge Group members and community contributors.
88
#
99
# See GitHub contributions for a more detailed list of contributors.
10-
# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors
10+
# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors # noqa: E501
1111
#
1212
# See LICENSE.rst for license information.
1313
#
1414
##############################################################################
1515
"""Definition of __version__."""
1616

17+
# We do not use the other three variables, but can be added back if needed.
18+
# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"]
19+
1720
import datetime
1821
import json
1922
import urllib.request
20-
from importlib.metadata import version
23+
24+
# obtain version information
25+
from importlib.metadata import PackageNotFoundError, version
2126
from pathlib import Path
2227

2328

@@ -57,9 +62,9 @@ def get_pypi_release_date(package_name, timeout=5):
5762
return str(release_date)
5863

5964

60-
__version__ = version("diffpy.pdffit2")
6165
__date__ = get_pypi_release_date("diffpy.pdffit2")
6266

63-
# End of file
64-
65-
# Release date: 2025-02-07
67+
try:
68+
__version__ = version("diffpy.pdffit2")
69+
except PackageNotFoundError:
70+
__version__ = "unknown"

tests/test_exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
import pytest
2020

21-
from diffpy.pdffit2 import PdfFit, pdffit2
21+
from diffpy.pdffit2 import pdffit2
22+
from diffpy.pdffit2.pdffit import PdfFit
2223

2324

2425
class read_structExceptions(unittest.TestCase):

tests/test_pdffit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
import pytest
88

9-
from diffpy.pdffit2 import PdfFit, pdffit2
9+
from diffpy.pdffit2 import pdffit2
10+
from diffpy.pdffit2.pdffit import PdfFit
1011
from diffpy.structure import loadStructure
1112

1213
# ----------------------------------------------------------------------------

tests/test_phase_fractions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import pytest
88

9-
from diffpy.pdffit2 import PdfFit
9+
from diffpy.pdffit2.pdffit import PdfFit
1010

1111

1212
##############################################################################

tests/test_shape_factors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import numpy
99
import pytest
1010

11-
from diffpy.pdffit2 import PdfFit, pdffit2
11+
from diffpy.pdffit2 import pdffit2
12+
from diffpy.pdffit2.pdffit import PdfFit
1213

1314

1415
def spherefactor(r, d):

0 commit comments

Comments
 (0)