Skip to content

Conversation

@stevenhua0320
Copy link
Contributor

@stevenhua0320 stevenhua0320 commented Nov 20, 2025

@sbillinge Ready to a first round review. Note that the file that still needs to be in the next PR are setup.py and tests/conftest.py and I'm not sure where the edits made by package update breaks the test on my local.

(diffpy.pdffit2) ~/dbs/diffpy.pdffit2/diffpy.pdffit2 git:[scikit-update-3]
pytest
==================================================================== test session starts =====================================================================
platform darwin -- Python 3.13.9, pytest-9.0.1, pluggy-1.6.0
rootdir: /Users/huarundong/dbs/diffpy.pdffit2/diffpy.pdffit2
configfile: pyproject.toml
collected 0 items / 5 errors                                                                                                                                 

=========================================================================== ERRORS ===========================================================================
_________________________________________________________ ERROR collecting tests/test_exceptions.py __________________________________________________________
ImportError while importing test module '/Users/huarundong/dbs/diffpy.pdffit2/diffpy.pdffit2/tests/test_exceptions.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/miniconda3/envs/diffpy.pdffit2/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_exceptions.py:21: in <module>
    from diffpy.pdffit2 import PdfFit, pdffit2
E   ModuleNotFoundError: No module named 'diffpy.pdffit2'
___________________________________________________________ ERROR collecting tests/test_pdffit.py ____________________________________________________________
ImportError while importing test module '/Users/huarundong/dbs/diffpy.pdffit2/diffpy.pdffit2/tests/test_pdffit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/miniconda3/envs/diffpy.pdffit2/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_pdffit.py:9: in <module>
    from diffpy.pdffit2 import PdfFit, pdffit2
E   ModuleNotFoundError: No module named 'diffpy.pdffit2'
_______________________________________________________ ERROR collecting tests/test_phase_fractions.py _______________________________________________________
ImportError while importing test module '/Users/huarundong/dbs/diffpy.pdffit2/diffpy.pdffit2/tests/test_phase_fractions.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/miniconda3/envs/diffpy.pdffit2/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_phase_fractions.py:9: in <module>
    from diffpy.pdffit2 import PdfFit
E   ModuleNotFoundError: No module named 'diffpy.pdffit2'
________________________________________________________ ERROR collecting tests/test_shape_factors.py ________________________________________________________
ImportError while importing test module '/Users/huarundong/dbs/diffpy.pdffit2/diffpy.pdffit2/tests/test_shape_factors.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/miniconda3/envs/diffpy.pdffit2/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_shape_factors.py:11: in <module>
    from diffpy.pdffit2 import PdfFit, pdffit2
E   ModuleNotFoundError: No module named 'diffpy.pdffit2'
___________________________________________________________ ERROR collecting tests/test_version.py ___________________________________________________________
ImportError while importing test module '/Users/huarundong/dbs/diffpy.pdffit2/diffpy.pdffit2/tests/test_version.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/miniconda3/envs/diffpy.pdffit2/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_version.py:3: in <module>
    import diffpy.pdffit2  # noqa
    ^^^^^^^^^^^^^^^^^^^^^
E   ModuleNotFoundError: No module named 'diffpy.pdffit2'
================================================================== short test summary info ===================================================================
ERROR tests/test_exceptions.py
ERROR tests/test_pdffit.py
ERROR tests/test_phase_fractions.py
ERROR tests/test_shape_factors.py
ERROR tests/test_version.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 5 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================== 5 errors in 0.21s ======================================================================

which is the same as the breaking CI here. Something that automatically deleted must break the import of the file.

@stevenhua0320
Copy link
Contributor Author

@sbillinge I also commit the setup.py and conftest.py now for targeting where the autommatic update breaks the functionality. Right now the CI will definitely fail.

Copy link
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see comments.

@@ -1,12 +1,8 @@
import io
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want the version of conftest.py from the original, not from skpkg

#!/usr/bin/env python

# Extensions script for diffpy.pdffit2
"""PDFfit2 - real space structure refinement engine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also want the original version of setup.py and not anything added by skpkg. This is needed because we are building c-code in this package.

@stevenhua0320
Copy link
Contributor Author

@sbillinge The CI fails because of the incompatibility in pdffit.py

    def intro():
        """Show introductory message."""
        import re

        from diffpy.pdffit2 import __date__, __version__

        date = __date__[:10]
        d = {"version": __version__, "date": date, "year": date[:4] or "2019"}
        msg = __intro_message__ % d

        def filler(mx):
            return mx.group(0).rstrip(" *").ljust(77) + "*"

        msg_ljust = re.sub("(?m)^(.{1,77}|.{79}.*)$", filler, msg)
        print(msg_ljust, file=output.stdout)
        return

    intro = staticmethod(intro)

here it needs to import the __date__, however, in scikit-package, it only takes __version__ and did not use __date__. So, should we add the attribute of __date__ in version.py?

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.97%. Comparing base (f795440) to head (d352c09).
⚠️ Report is 13 commits behind head on migration.

Additional details and impacted files
@@            Coverage Diff             @@
##           migration     #151   +/-   ##
==========================================
  Coverage      98.97%   98.97%           
==========================================
  Files              6        6           
  Lines           1267     1270    +3     
==========================================
+ Hits            1254     1257    +3     
  Misses            13       13           
Files with missing lines Coverage Δ
tests/test_exceptions.py 99.80% <100.00%> (+<0.01%) ⬆️
tests/test_pdffit.py 99.76% <100.00%> (+<0.01%) ⬆️
tests/test_phase_fractions.py 98.70% <100.00%> (ø)
tests/test_shape_factors.py 99.53% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

##############################################################################
"""PDFfit2 - real space structure refinement program."""

# WARNING: Do NOT remove the isort: off/on comments in this file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep the old code in this module

@sbillinge sbillinge merged commit a6c0e0f into diffpy:migration Nov 22, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants