dkriegner / xrayutilities

xrayutilities - a package with useful scripts for X-ray diffraction physicists
http://xrayutilities.sourceforge.io
GNU General Public License v2.0
81 stars 29 forks source link

installation with pyproject.toml produce a warning about the data #142

Closed picca closed 1 year ago

picca commented 1 year ago

Hello, I am preparing a new package for Debian with the latests setuptools and I have this warning

I have this warning

writing manifest file 'lib/xrayutilities.egg-info/SOURCES.txt'
/usr/lib/python3/dist-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'xrayutilities.materials.data' as data is dep\
recated, please list it in `packages`.
    !!

    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'xrayutilities.materials.data' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    'xrayutilities.materials.data' has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).

    Please make sure that 'xrayutilities.materials.data' is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" and "data files" on setuptools
    documentation page.

!!

  check.warn(importable)

will it be possible to do a release when this will be fixed ?

thanks

Fred

dkriegner commented 1 year ago

Hello, sure I can release something when this is fixed. It took me a moment to realize that the problem only appears when using pip and not when using setup.py directly. I think I just had to remove an offending option in setup.py since the mentioned data files are otherwise already included correctly (maybe even duplicated in setup.py and MANIFEST.in).

Can you confirm commit 8c7e3eb fixes the issue for you? cheers Dominik

picca commented 1 year ago

I can confirm that with this patch the datas are installed and there is no more warning.

thanks

picca commented 1 year ago

Just for info I have these warnings during the tests

=============================== warnings summary ===============================
xrayutilities/analysis/sample_align.py:32
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_xrayutilities/build/xrayutilities/analysis/sample_align.py:32: DeprecationWarning: Please use `center_of_mass` from the `scipy.ndimage` namespace, the `scipy.ndimage.measurements` namespace is deprecated.
    from scipy.ndimage.measurements import center_of_mass

tests/test_examples.py:70
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_xrayutilities/build/tests/test_examples.py:70: PytestCollectionWarning: cannot collect test class 'TestExampleScriptsMeta' because it has a __init__ constructor (from: .pybuild/cpython3_3.10_xrayutilities/build/tests/test_examples.py)
    class TestExampleScriptsMeta(type):

../../../../../../usr/lib/python3/dist-packages/past/builtins/misc.py:45
  /usr/lib/python3/dist-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
    from imp import reload

.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_gaussfit
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_gaussfit_linear
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_lorentzfit
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_lorentzfit_linear
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_pvoigtfit
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_pvoigtfit_linear
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_xrayutilities/build/xrayutilities/math/fit.py:132: DeprecationWarning: Please use `Model` from the `scipy.odr` namespace, the `scipy.odr.odrpack` namespace is deprecated.
    peak = odr.Model(gfunc, fjacd=gfunc_dx, fjacb=gfunc_dp)

.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_gaussfit
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_gaussfit_linear
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_lorentzfit
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_lorentzfit_linear
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_pvoigtfit
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_pvoigtfit_linear
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_xrayutilities/build/xrayutilities/math/fit.py:136: DeprecationWarning: Please use `RealData` from the `scipy.odr` namespace, the `scipy.odr.odrpack` namespace is deprecated.
    mydata = odr.RealData(xdata, ydata, sy=sy)

.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_gaussfit
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_gaussfit_linear
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_lorentzfit
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_lorentzfit_linear
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_pvoigtfit
.pybuild/cpython3_3.10_xrayutilities/build/tests/test_math_peak_fit.py::TestPeakFit::test_pvoigtfit_linear
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_xrayutilities/build/xrayutilities/math/fit.py:138: DeprecationWarning: Please use `ODR` from the `scipy.odr` namespace, the `scipy.odr.odrpack` namespace is deprecated.
    myodr = odr.ODR(mydata, peak, beta0=iparams, maxit=maxit)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========== 175 passed, 69 skipped, 21 warnings in 142.09s (0:02:22) ===========
dkriegner commented 1 year ago

Most of these warnings I have already taken care of, and they should reduce with the new release. thanks for reporting the issue. Let me know in case of more problems after the new release (should be online today)