Skip to content

"Package would be ignored" warnings when building the pvlib distribution #1474

Closed
@kandersolar

Description

@kandersolar

Describe the bug

Building the pvlib distribution files emits a handful of warnings like this:

 /opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/setuptools/command/build_py.py:153: SetuptoolsDeprecationWarning:     Installing 'pvlib.bifacial' as data is 
deprecated, please list it in `packages`.
    !!
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'pvlib.bifacial' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.
    'pvlib.bifacial' 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 'pvlib.bifacial' 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)

This warning is emitted for pvlib.bifacial, pvlib.data, pvlib.iotools, pvlib.ivtools, pvlib.spa_c_files, pvlib.spectrum, and pvlib.tests.

To Reproduce
I've not reproduced it locally, but the relevant command is python setup.py sdist bdist_wheel. From the wording of the warning I guess you might need to use a recent version of setuptools to reproduce it. At least the version listed below should reproduce it.

Expected behavior
No scary warnings during the distribution build.

Versions:

  • pvlib.__version__: 0.9.1+33.g177a6e0
  • pandas.__version__:
  • python: 3.8
  • setuptools-62.4.0
  • wheel-0.37.1

Additional context
First noticed in this CI job log: https://github.com/pvlib/pvlib-python/runs/6886769268?check_suite_focus=true#step:6:393

Also as suggested by @wholmgren in #1306 (comment), we may want to split the "test the build" CI job out from the "deploy the build" CI job, as well as enable fail on warnings in the test job if possible. In the style of test-driven development, perhaps that should be done as the first step of fixing these warnings.

We may also want to move away from python setup.py entirely, see https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions