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

chore(distutils): remove distutils usages #336

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

stegayet
Copy link
Contributor

@stegayet stegayet commented May 13, 2023

Description

distutils module usage is deprecated since Python 3.10 and will be removed in Python 3.12, this PR gets rid of remaining usages of this module.

Replacements are taken from https://peps.python.org/pep-0632/#migration-advice and https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html.

How this has been tested ?

To be checked

@stegayet stegayet force-pushed the chore/remove-distutils-usage branch 2 times, most recently from c9c83a5 to 0400105 Compare May 13, 2023 22:08
@stegayet stegayet marked this pull request as ready for review May 13, 2023 22:09
@stegayet
Copy link
Contributor Author

from distutils.command.clean import clean is discontinued and has no replacement solution as per pypa/setuptools#2838, I need to dig into this issue.

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! Some initial suggestions which may help out...

setup.cfg Outdated Show resolved Hide resolved
from distutils import log
from distutils.command.clean import clean
import logging
from setuptools.command.clean import clean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used for type checking, so I think you could leave it as distutils and put it under an if TYPE_CHECKING guard?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be used not only for typing as it breaks the CI, trying to use vendorized version of distutils in the meantime.

@stegayet stegayet force-pushed the chore/remove-distutils-usage branch from 0400105 to 7fd029d Compare May 15, 2023 21:48
@davidhewitt
Copy link
Member

@stegayet I've merged #337 which fixed a lot of CI issues, you may find it helpful to rebase.

@davidhewitt davidhewitt force-pushed the chore/remove-distutils-usage branch from 7fd029d to e46b7c3 Compare August 6, 2023 20:42
@davidhewitt
Copy link
Member

For now I've rebased and removed the import of clean (just going to duck-type it).

@davidhewitt davidhewitt merged commit 646857a into PyO3:main Aug 11, 2023
@stegayet stegayet deleted the chore/remove-distutils-usage branch August 15, 2023 13:18
@stegayet
Copy link
Contributor Author

Did not have time to keep this work going further, sorry for that 👍

kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 15, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: b400ef172c3e10828391957570cdd57234f1590e)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 16, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: b400ef172c3e10828391957570cdd57234f1590e)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 16, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: b400ef172c3e10828391957570cdd57234f1590e)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 16, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: 550dce75d0a9ff1196f62970b726b67b4eadd9c5)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 18, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: 550dce75d0a9ff1196f62970b726b67b4eadd9c5)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 18, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: 768c884d34e60033ba36bb35122a1904aee9987d)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 19, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: f80986b33bff2b66719d7754d65412d925dc37e3)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: fd3069559579e72cc20fad13f758621832326e1c)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: fd3069559579e72cc20fad13f758621832326e1c)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Dec 20, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kraj pushed a commit to YoeDistro/poky that referenced this pull request Dec 21, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: fd3069559579e72cc20fad13f758621832326e1c)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Dec 21, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Dec 21, 2023
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hsteinhaus pushed a commit to emobotics-dev/poky that referenced this pull request Feb 23, 2024
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
daregit pushed a commit to daregit/yocto-combined that referenced this pull request May 22, 2024
As allowed by PyO3/setuptools-rust#336

(From OE-Core rev: ca452dd6b1b6799cf70dac93f7fac0746d8c43bc)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants