Menu

#132 SetuptoolsDeprecationWarning

Git
closed-fixed
nobody
None
5
2023-07-12
2023-01-15
No

Got warnings during build for mcomix.images and mcomix.messages.*.LC_MESSAGES:

/usr/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'mcomix.images' as data is deprecated, please list it in `packages`.
    !!


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

    'mcomix.images' 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 'mcomix.images' 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)

Discussion

  • FeRD

    FeRD - 2023-06-28

    Oh, yeah, this can be closed. MR #20 fixed it.

     

    Last edit: FeRD 2023-06-28
  • FeRD

    FeRD - 2023-06-28

    Wait, no! Sorry, should've read past the title! This one's still probably valid.

    The easiest solution is probably just to put an empty __init__.py inside mcomix/images/. ...And all of its subdirs, sigh.

    ...And every dir in the tree under mcomix/messages/, double-sigh.

     

    Last edit: FeRD 2023-06-28
  • FeRD

    FeRD - 2023-06-28

    I just opened MR 33 with that "fix". Now I feel like I need a shower.

     
  • Oddegamra

    Oddegamra - 2023-07-03
    • status: open --> closed-fixed
     
  • Arkadiy Illarionov

    I've built v2.2.0. Warnings are still there with slightly different text

    /usr/lib/python3.11/site-packages/setuptools/command/build_py.py:201: _Warning: Package 'mcomix.images' is absent from the `packages` configuration.
    !!
    
            ********************************************************************************
            ############################
            # Package would be ignored #
            ############################
            Python recognizes 'mcomix.images' as an importable package[^1],
            but it is absent from setuptools' `packages` configuration.
    
            This leads to an ambiguous overall configuration. If you want to distribute this
            package, please make sure that 'mcomix.images' is explicitly added
            to the `packages` configuration field.
    
            Alternatively, you can also rely on setuptools' discovery methods
            (for example by using `find_namespace_packages(...)`/`find_namespace:`
            instead of `find_packages(...)`/`find:`).
    
            You can read more about "package discovery" on setuptools documentation page:
    
            - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
    
            If you don't want 'mcomix.images' to be distributed and are
            already explicitly excluding 'mcomix.images' via
            `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
            you can try to use `exclude_package_data`, or `include-package-data=False` in
            combination with a more fine grained `package-data` configuration.
    
            You can read more about "package data files" on setuptools documentation page:
    
            - https://setuptools.pypa.io/en/latest/userguide/datafiles.html
    
    
            [^1]: For Python, any directory (with suitable naming) can be imported,
                  even if it does not contain any `.py` files.
                  On the other hand, currently there is no concept of package data
                  directory, all directories are treated like packages.
            ********************************************************************************
    
    !!
      check.warn(importable)
    
     

Log in to post a comment.