mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
crit: fix compatibility with Python 3.12
Python 3.12 includes a few breaking changes, such as the removal of the distutils module [1] and the deprecation of `setup.py install` in favour of pip install [2]. This patch updates the installation script for crit to reflect these changes by replacing the use of `setup.py install` with `pip install` and `distutils` with `setuptools`. In addition, a minimal pyproject.toml file has been added as it is required by the new version of pip [3]. It is worth noting that with this change we are switching from the egg packaging format to wheel [4] and add pip as a build dependency. [1] https://www.python.org/downloads/release/python-3120a2/ [2] https://github.com/pypa/setuptools/pull/2824 [3] https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/ [4] https://packaging.python.org/en/latest/discussions/wheel-vs-egg/ Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
parent
bd0f209c2b
commit
7f0f07599a
14 changed files with 114 additions and 37 deletions
2
crit/.gitignore
vendored
Normal file
2
crit/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
crit.egg-info/
|
||||
build/
|
||||
2
crit/pyproject.toml
Normal file
2
crit/pyproject.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[build-system]
|
||||
requires = ["setuptools"]
|
||||
29
crit/setup.py
Normal file
29
crit/setup.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import os
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
|
||||
def get_version():
|
||||
version = '0.0.1'
|
||||
env = os.environ
|
||||
if 'CRIU_VERSION_MAJOR' in env and 'CRIU_VERSION_MINOR' in env:
|
||||
version = '{}.{}'.format(
|
||||
env['CRIU_VERSION_MAJOR'],
|
||||
env['CRIU_VERSION_MINOR']
|
||||
)
|
||||
if 'CRIU_VERSION_SUBLEVEL' in env and env['CRIU_VERSION_SUBLEVEL']:
|
||||
version += '.' + env['CRIU_VERSION_SUBLEVEL']
|
||||
return version
|
||||
|
||||
|
||||
setup(
|
||||
name='crit',
|
||||
version=get_version(),
|
||||
description='CRiu Image Tool',
|
||||
author='CRIU team',
|
||||
author_email='criu@openvz.org',
|
||||
license='GPLv2',
|
||||
url='https://github.com/checkpoint-restore/criu',
|
||||
packages=find_packages('.'),
|
||||
scripts=['crit'],
|
||||
install_requires=[],
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue