Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows CI failing with: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release #21674

Closed
ogrisel opened this issue Nov 15, 2021 · 6 comments · Fixed by #21676

Comments

@ogrisel
Copy link
Member

ogrisel commented Nov 15, 2021

The windows build py37_conda_forge_mkl gets setuptools 59.1.0 that makes our CHECK_WARNINGS: 'true' setting fail.

Other CI jobs configured with CHECK_WARNINGS: 'true' will start to fail as soon as the upgrade from setuptools 58 to 59.

Log of an example failing job:

https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=35004&view=logs&j=55156e43-4792-506d-3947-cdbc5ace0742&t=6d510dcd-35d3-5892-347a-3b74433a7ac4&l=6742

@ogrisel ogrisel changed the title MAINT DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release Windows CI failing with: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release Nov 15, 2021
@ogrisel
Copy link
Member Author

ogrisel commented Nov 15, 2021

This is caused by the fact that it's trying to fallback to LegacyVersion when facing an invalid version number:

https://github.com/pypa/setuptools/blob/main/pkg_resources/_vendor/packaging/version.py#L42-L51

But our log linked above is getting an invalid version on the string c:\\miniconda\\envs\\testvenv\\lib\\site which is not a version number at all:

https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=35004&view=logs&j=55156e43-4792-506d-3947-cdbc5ace0742&t=6d510dcd-35d3-5892-347a-3b74433a7ac4&l=5997

but I do not understand yet why we get this when importing setuptools.

@ogrisel
Copy link
Member Author

ogrisel commented Nov 15, 2021

It seems that it's caused by the atomicwrites-1.4.0 package that has invalid version info in its dist-info metadata in this build.

Edit: I have no idea how this code can possibly work without raising a warning and an invalidversion exception. It seems broken to me and it's not related to invalid metadata in the atomicwrites package.

@adrinjalali
Copy link
Member

And it doesn't seem like an active repo, not sure how long it'll take for them to fix and have a release. Are you planning to wrap our import and catch warnings there?

@ogrisel
Copy link
Member Author

ogrisel commented Nov 15, 2021

The root cause issue has been reported here: pypa/setuptools#2885

Maybe we can setup a workaround when importing setuptools in the scikit-learn code base for the time being.

@ogrisel
Copy link
Member Author

ogrisel commented Nov 15, 2021

Let's see if #21676 works as expected.

@thomasjpfan
Copy link
Member

thomasjpfan commented Nov 16, 2021

Looks like the issue was fixed in pypa/setuptools#2889 and setuptools==v59.1.1 was tagged with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants