Skip to content

MAINT: setuptools 49.2.0 emits a warning, avoid it#16822

Merged
charris merged 2 commits intonumpy:masterfrom
mattip:setuptools-warning
Jul 12, 2020
Merged

MAINT: setuptools 49.2.0 emits a warning, avoid it#16822
charris merged 2 commits intonumpy:masterfrom
mattip:setuptools-warning

Conversation

@mattip
Copy link
Member

@mattip mattip commented Jul 12, 2020

setuptools 49.2.0, released today, will now emit a warning if distutils is imported before setuptools. This affects the test_api tests, so pre-emtively import setuptools.

@charris
Copy link
Member

charris commented Jul 12, 2020

Hmm, didn't fix the problem. maybe import in the test?

@mattip mattip force-pushed the setuptools-warning branch from 5e064a9 to fe867a5 Compare July 12, 2020 19:51
@mattip
Copy link
Member Author

mattip commented Jul 12, 2020

This time I tested before pushing (a unique idea, I should do it more often). I hope it has a better chance of passing. I also noticed some small C warnings about "warning: function declaration isn't a prototype" so added a void argument to fix those too.

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Jul 12, 2020
@charris
Copy link
Member

charris commented Jul 12, 2020

Travis is hopelessly lagged, so just going to put this in since azure passes. Thanks Matti.

@charris charris merged commit 01b2e2a into numpy:master Jul 12, 2020
@charris
Copy link
Member

charris commented Jul 12, 2020

EDIT: Fixed in #16828.

I still see this that happens during pytest collection

charris@fc [numpy.git (master)]$ python runtests.py -t numpy/tests -- --collect-only
Building, see build.log...
Build OK
/home/charris/.local/lib/python3.8/site-packages/setuptools/distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
  warnings.warn(

Could be in pytest, or maybe pytest is importing some files during collection.

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 12, 2020
@mattip mattip deleted the setuptools-warning branch January 25, 2022 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants