Description: Migrate to PEP 517 build system and keep Python 3.6 compatibility Introduce pyproject.toml with [build-system] using setuptools.build_meta to drive builds through the PEP 517 interface. This eliminates the "setup.py install is deprecated" warnings triggered by frontend tools like pip and pybuild. To retain Python 3.6 support, the build requirement is lowered to setuptools>=40.8, as setuptools 59.7.0 officially dropped Python 3.6. Because these older setuptools versions cannot parse PEP 621 [project] tables, all package metadata must remain in setup.py. . The module-level version import in setup.py is replaced with a hardcoded string to prevent a ModuleNotFoundError during PEP 517 isolated builds. The set_version.sh script is updated to keep this version synchronized alongside cpuset/version.py on every release. Finally, the non-existent ChangeLog entry is removed from MANIFEST.in to clear build warnings, and the License classifier is omitted from setup.py to avoid deprecation warnings on modern setuptools. From: Fukui Daichi Last-Update: 2026-06-30 Forwarded: https://github.com/SUSE/cpuset/pull/56 --- MANIFEST.in | 2 +- cpuset/version.py | 2 +- pyproject.toml | 3 +++ set_version.sh | 3 ++- setup.py | 40 ++++++++++++++++++++-------------------- 5 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 pyproject.toml diff --git a/MANIFEST.in b/MANIFEST.in index 0a8a5c5..b18a1e4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ -include README Makefile MANIFEST MANIFEST.in AUTHORS COPYING INSTALL NEWS ChangeLog cset.init.d +include README Makefile MANIFEST MANIFEST.in AUTHORS COPYING INSTALL NEWS cset.init.d include t/README include doc/*.txt doc/Makefile doc/*.conf doc/callouts.xsl doc/*.1 doc/*.html diff --git a/cpuset/version.py b/cpuset/version.py index 7e3e6e9..fed4248 100644 --- a/cpuset/version.py +++ b/cpuset/version.py @@ -17,4 +17,4 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -version = '1.6' +version = '1.6.2' diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..706473a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=40.8"] +build-backend = "setuptools.build_meta" diff --git a/set_version.sh b/set_version.sh index 23efd80..ebd12e8 100755 --- a/set_version.sh +++ b/set_version.sh @@ -8,6 +8,7 @@ sed -i "4s/.*/v$VER, $DATE_SHORT/" doc/cset{,-proc,-set,-shield}.txt sed -i "s/cset v\([[:digit:]]\+\.\)\+[[:digit:]]\+ /cset v$VER /" doc/tutorial.txt sed -i "s/^\(Version:[[:space:]]*\).*/\1$VER/" cpuset.spec sed -i "s/^\(version = '*\).*\('[[:space:]]*$\)/\1$VER\2/" cpuset/version.py +sed -i "s/^VERSION = .*/VERSION = \"$VER\"/" setup.py sed -i "1i \ ============================================================\n\ Cpuset $VER ($DATE)\n\ @@ -18,7 +19,7 @@ http://download.opensuse.org/hardware/cpuset/\n\ ${EDITOR:-vi} NEWS TEMP=$(mktemp) sed '6,/^===/{/^=/d;p};d' NEWS > $TEMP -git commit -s -t $TEMP cpuset.spec cpuset/version.py NEWS \ +git commit -s -t $TEMP cpuset.spec cpuset/version.py setup.py NEWS \ doc/cset{,-proc,-set,-shield}.txt doc/tutorial.txt rm -f $TEMP git tag v$VER diff --git a/setup.py b/setup.py index 1ee6bc7..4dbdc82 100755 --- a/setup.py +++ b/setup.py @@ -1,20 +1,20 @@ #!/usr/bin/env python import glob -from distutils.core import setup +from setuptools import setup -from cpuset.version import version +VERSION = "1.6.2" -setup(name = 'cpuset', - version = version, - license = 'GPLv2', - author = 'Alex Tsariounov', - author_email = 'tsariounov@gmail.com', - maintainer = 'Michal Koutny', - maintainer_email = 'mkoutny@suse.com', - url = 'https://github.com/SUSE/cpuset', - description = 'Allows manipulation of cpusets and provides higher level functions.', - long_description = \ +setup(name='cpuset', + version=VERSION, + license='GPL-2.0-only', + author='Alex Tsariounov', + author_email='tsariounov@gmail.com', + maintainer='Michal Koutny', + maintainer_email='mkoutny@suse.com', + url='https://github.com/SUSE/cpuset', + description='Allows manipulation of cpusets and provides higher level functions.', + long_description= 'Cpuset is a Python application to make using the cpusets facilities in the Linux\n' 'kernel easier. The actual included command is called cset and it allows\n' 'manipulation of cpusets on the system and provides higher level functions such as\n' @@ -23,16 +23,16 @@ setup(name = 'cpuset', 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 3', 'Topic :: System :: Systems Administration', ], - scripts = ['cset'], - packages = ['cpuset', 'cpuset.commands'], - data_files = [ - ('share/doc/packages/cpuset', ['README', 'COPYING', 'AUTHORS', 'NEWS', 'INSTALL']), - ('share/doc/packages/cpuset', glob.glob('doc/*.html')), - ('share/doc/packages/cpuset', glob.glob('doc/*.txt')), - ] + python_requires='>=3.6', + scripts=['cset'], + packages=['cpuset', 'cpuset.commands'], + data_files=[ + ('share/doc/packages/cpuset', ['README', 'COPYING', 'AUTHORS', 'NEWS', 'INSTALL']), + ('share/doc/packages/cpuset', glob.glob('doc/*.txt')), + ('share/doc/packages/cpuset/html', glob.glob('doc/*.html')), + ] ) -- 2.53.0