-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: use separate packages for pycriu and crit
Newer versions of pip use an isolated virtual environment when building Python projects. However, when the source code of CRIT is copied into the isolated environment, the symlink for `../lib/py` (pycriu) becomes invalid. As a workaround, we used the `--no-build-isolation` option for `pip install`. However, this functionality has issues in some versions of PIP [1, 2]. To fix this problem, this patch adds separate packages for pycriu and crit, and each package is installed independently. [1] pypa/pip#8221 [2] pypa/pip#8165 (comment) Signed-off-by: Radostin Stoyanov <[email protected]>
- Loading branch information
Showing
29 changed files
with
182 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../lib/py/ | ||
../lib/pycriu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
crit.egg-info/ | ||
build/ | ||
dist/ | ||
version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
PYTHON_EXTERNALLY_MANAGED := $(shell $(PYTHON) -c 'import os, sysconfig; print(int(os.path.isfile(os.path.join(sysconfig.get_path("stdlib"), "EXTERNALLY-MANAGED"))))') | ||
PIP_BREAK_SYSTEM_PACKAGES := 0 | ||
|
||
VERSION_FILE := $(if $(obj),$(addprefix $(obj)/,crit/version.py),crit/version.py) | ||
|
||
all-y += ${VERSION_FILE} | ||
cleanup-y += ${VERSION_FILE} | ||
|
||
${VERSION_FILE}: | ||
$(Q) echo "__version__ = '${CRIU_VERSION}'" > $@ | ||
|
||
install: ${VERSION_FILE} | ||
ifeq ($(PYTHON_EXTERNALLY_MANAGED),1) | ||
ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) | ||
$(E) " SKIP INSTALL crit: Externally managed python environment (See PEP 668 for more information)" | ||
$(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install" | ||
else | ||
$(E) " INSTALL " crit | ||
$(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit | ||
endif | ||
else | ||
$(E) " INSTALL " crit | ||
$(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit | ||
endif | ||
.PHONY: install | ||
|
||
uninstall: | ||
ifeq ($(PYTHON_EXTERNALLY_MANAGED),1) | ||
ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) | ||
$(E) " SKIP UNINSTALL crit: Externally managed python environment (See PEP 668 for more information)" | ||
$(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make uninstall" | ||
else | ||
$(E) " UNINSTALL" crit | ||
$(Q) $(PYTHON) ./scripts/uninstall_module.py --prefix=$(DESTDIR)$(PREFIX) crit | ||
endif | ||
else | ||
$(E) " UNINSTALL" crit | ||
$(Q) $(PYTHON) ./scripts/uninstall_module.py --prefix=$(DESTDIR)$(PREFIX) crit | ||
endif | ||
.PHONY: uninstall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .version import __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
[build-system] | ||
# Minimum requirements for the build system to execute. | ||
requires = ["setuptools", "wheel"] # PEP 508 specifications. | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "crit" | ||
description = "CRiu Image Tool" | ||
authors = [ | ||
{name = "CRIU team", email = "[email protected]"}, | ||
] | ||
license = {text = "GPLv2"} | ||
dynamic = ["version"] | ||
requires-python = ">=3.6" | ||
|
||
[project.scripts] | ||
crit = "crit.__main__:main" | ||
|
||
[tool.setuptools] | ||
packages = ["crit"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "crit.__version__"} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Configuring setuptools using pyproject.toml files was introduced in setuptools 61.0.0 | ||
# https://setuptools.pypa.io/en/latest/history.html#v61-0-0 | ||
# For older versions of setuptools, we need to use the setup.cfg file | ||
# https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#declarative-config | ||
|
||
[metadata] | ||
name = crit | ||
description = CRiu Image Tool | ||
author = CRIU team | ||
author_email = [email protected] | ||
license = GPLv2 | ||
version = attr: crit.__version__ | ||
|
||
[options] | ||
packages = crit | ||
python_requires = >=3.6 | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
crit = crit.__main__:main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
from setuptools import setup, find_packages | ||
import pycriu | ||
#!/usr/bin/env python3 | ||
import setuptools | ||
|
||
setup( | ||
name='crit', | ||
version=pycriu.__version__, | ||
description='CRiu Image Tool', | ||
author='CRIU team', | ||
author_email='[email protected]', | ||
license='GPLv2', | ||
url='https://github.com/checkpoint-restore/criu', | ||
packages=find_packages('.'), | ||
scripts=['crit'], | ||
install_requires=[], | ||
) | ||
|
||
if __name__ == '__main__': | ||
setuptools.setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pycriu.egg-info/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
__pycache__ | ||
*_pb2.py | ||
*.pyc | ||
version.py |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from . import rpc_pb2 as rpc | ||
from . import images | ||
from .criu import * | ||
from .version import __version__ | ||
from .version import __version__ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[build-system] | ||
requires = ["setuptools", "protobuf<4.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pycriu" | ||
description = "Python bindings for CRIU" | ||
authors = [ | ||
{name = "CRIU team", email = "[email protected]"}, | ||
] | ||
license = {text = "GPLv2"} | ||
dynamic = ["version"] | ||
requires-python = ">=3.6" | ||
|
||
[tool.setuptools] | ||
packages = ["pycriu"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "pycriu.__version__"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Configuring setuptools using pyproject.toml files was introduced in setuptools 61.0.0 | ||
# https://setuptools.pypa.io/en/latest/history.html#v61-0-0 | ||
# For older versions of setuptools, we need to use the setup.cfg file | ||
# https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#declarative-config | ||
|
||
[metadata] | ||
name = pycriu | ||
description = Python bindings for CRIU | ||
author = CRIU team | ||
author_email = [email protected] | ||
license = GPLv2 | ||
version = attr: pycriu.__version__ | ||
|
||
[options] | ||
packages = find: | ||
python_requires = >=3.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
import setuptools | ||
|
||
from pycriu import cli | ||
|
||
if __name__ == '__main__': | ||
cli.main() | ||
setuptools.setup() |
Oops, something went wrong.