Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [python] PEP 517 migration
Date: Mon, 17 Jan 2022 10:12:50
Message-Id: 02896eacb2c9289c3c474564014b2963b50332ec.camel@gentoo.org
1 Hi, everyone.
2
3 I've added a short PEP 517 migration guide to the docs [1]. This should
4 work for the vast majority of packages using distutils-r1, as long as
5 they don't use too many hacks. For things like numpy or pillow we'll
6 have to figure out individual solutions.
7
8 In general, there's no need for urgent migration. I'm slowly migrating
9 Python packages on version bumps. Note that the dependencies haven't
10 been keyworded on ~alpha yet.
11
12 Long story short, to migrate you:
13
14 1. Add DISTUTILS_USE_PEP517=<build-system> with the list of supported
15 build systems being defined in the eclassdoc (right now: flit, pdm,
16 poetry, setuptools). For pure distutils we also use setuptools.
17 Don't use standalone, that's internal python@ stuff.
18
19 2. Remove DISTUTILS_USE_SETUPTOOLS. If you still need RDEPEND
20 on setuptools (i.e. the package imports setuptools or pkg_resources),
21 add it explicitly.
22
23 3. Remove distutils_install_for_testing (or --install arg to
24 distutils_enable_tests). This should no longer be necessary, we supply
25 venv-style install tree out of the box.
26
27 IMPORTANT: please verify installed file list, Python upstream doesn't
28 care much about backwards compatibility and this can break stuff.
29 app-portage/iwdevtools can be helpful in checking file list on bumps.
30
31 Please lemme know if you hit any issues.
32
33
34 [1]
35 https://dev.gentoo.org/~mgorny/python-guide/migration.html#migrating-to-pep-517-builds
36
37 --
38 Best regards,
39 Michał Górny