setuptools-rust icon indicating copy to clipboard operation
setuptools-rust copied to clipboard

Setuptools deprecation warning with setuptools-rust

Open reaperhulk opened this issue 2 years ago • 4 comments

In cryptography builds we have been getting this deprecation warning for a while:

setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'cryptography.hazmat.bindings._rust' as data is deprecated, please list it in `packages`.
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'cryptography.hazmat.bindings._rust' as an importable package,
      but it is not listed in the `packages` configuration of setuptools.

      'cryptography.hazmat.bindings._rust' 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 'cryptography.hazmat.bindings._rust' 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.

We declare cryptography.hazmat.bindings._rust as the target in our RustExtension call and then use the standard find: mechanisms in our setup.cfg. Is there something setuptools-rust needs to tell setuptools so that it auto-discovers this package without this warning? Or, quite possibly, something we need to do on our end because we've done something dumb? 😄

reaperhulk avatar Feb 12 '23 16:02 reaperhulk

Sorry for the extremely slow reply @reaperhulk. Did you find any answer to this? It's not a problem that I've observed, however if there's new checks in setuptools which can fail when using setuptools-rust it sounds like something which needs further investigation.

davidhewitt avatar Apr 26 '23 20:04 davidhewitt

I don't think we ever got to the bottom of this, still a big question mark.

(As an aside, we're now looking at migrating to maturin, so this may become irrelevant for us.)

On Wed, Apr 26, 2023, 4:40 PM David Hewitt @.***> wrote:

Sorry for the extremely slow reply @reaperhulk https://github.com/reaperhulk. Did you find any answer to this? It's not a problem that I've observed, however if there's new checks in setuptools which can fail when using setuptools-rust it sounds like something which needs further investigation.

— Reply to this email directly, view it on GitHub https://github.com/PyO3/setuptools-rust/issues/313#issuecomment-1524017264, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAGBGUR6ZSL7VGHR2NBRDXDGB2PANCNFSM6AAAAAAUZMU7PM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

alex avatar Apr 26 '23 20:04 alex

In which case I'll wait to see if any other users are noticing this and can provide a minimal repro. It doesn't look like this is blocking anyone at present, and my time is stretched very thin recently.

davidhewitt avatar Apr 26 '23 20:04 davidhewitt

I spent some time investigating this a few months ago and it appeared at the time that there might not be a non-deprecated path available. I haven’t had a chance to follow up.

reaperhulk avatar Apr 26 '23 21:04 reaperhulk