tdf#162786, tdf#161947: Add support for setuptools and pip
For that, just unzip the wheel files to the Lib directory Change-Id: I3998e427aeadb840b626ebbb6ce91938de47d2b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180271 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
parent
6986986338
commit
47e110fc66
6
external/lxml/UnpackedTarball_lxml.mk
vendored
6
external/lxml/UnpackedTarball_lxml.mk
vendored
@ -13,10 +13,4 @@ $(eval $(call gb_UnpackedTarball_set_tarball,lxml,$(LXML_TARBALL)))
|
|||||||
|
|
||||||
$(eval $(call gb_UnpackedTarball_set_patchlevel,lxml,0))
|
$(eval $(call gb_UnpackedTarball_set_patchlevel,lxml,0))
|
||||||
|
|
||||||
ifneq ($(OS),MACOSX)
|
|
||||||
$(eval $(call gb_UnpackedTarball_add_patches,lxml, \
|
|
||||||
external/lxml/replace-setuptools-with-distutils.patch.1 \
|
|
||||||
))
|
|
||||||
endif
|
|
||||||
|
|
||||||
# vim: set noet sw=4 ts=4:
|
# vim: set noet sw=4 ts=4:
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
diff -ur lxml.org/setupinfo.py lxml/setupinfo.py
|
|
||||||
--- lxml.org/setupinfo.py 2023-10-20 10:32:17.921500435 +0200
|
|
||||||
+++ lxml/setupinfo.py 2023-10-20 10:33:40.303323572 +0200
|
|
||||||
@@ -4,7 +4,7 @@
|
|
||||||
import os.path
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
-from setuptools.command.build_ext import build_ext as _build_ext
|
|
||||||
+from distutils.command.build_ext import build_ext as _build_ext
|
|
||||||
from distutils.core import Extension
|
|
||||||
from distutils.errors import CompileError, DistutilsOptionError
|
|
||||||
from versioninfo import get_base_dir
|
|
983
external/python3/ExternalPackage_python3.mk
vendored
983
external/python3/ExternalPackage_python3.mk
vendored
File diff suppressed because it is too large
Load Diff
16
external/python3/UnpackedTarball_python3.mk
vendored
16
external/python3/UnpackedTarball_python3.mk
vendored
@ -11,13 +11,17 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,python3))
|
|||||||
|
|
||||||
$(eval $(call gb_UnpackedTarball_set_tarball,python3,$(PYTHON_TARBALL),,python3))
|
$(eval $(call gb_UnpackedTarball_set_tarball,python3,$(PYTHON_TARBALL),,python3))
|
||||||
|
|
||||||
# Since Python 3.11, _freeze_module.vcxproj needs python.exe to build deepfreeze.c
|
# Since Python 3.11, _freeze_module.vcxproj needs python.exe to build deepfreeze.c on Windows
|
||||||
# on Windows
|
# Since a wheel file is just a zip file, unzil them to the Lib directory with the other libraries
|
||||||
ifeq ($(OS),WNT)
|
ifneq ($(OS),MACOSX)
|
||||||
$(eval $(call gb_UnpackedTarball_set_pre_action,python3,\
|
$(eval $(call gb_UnpackedTarball_set_pre_action,python3,\
|
||||||
mkdir -p externals/pythonx86 && \
|
$(if $(filter WNT,$(OS)), \
|
||||||
unzip -q -d externals/pythonx86 -o $(gb_UnpackedTarget_TARFILE_LOCATION)/$(PYTHON_BOOTSTRAP_TARBALL) && \
|
mkdir -p externals/pythonx86 && \
|
||||||
chmod +x externals/pythonx86/tools/* \
|
unzip -q -d externals/pythonx86 -o $(gb_UnpackedTarget_TARFILE_LOCATION)/$(PYTHON_BOOTSTRAP_TARBALL) && \
|
||||||
|
chmod +x externals/pythonx86/tools/* && \
|
||||||
|
) \
|
||||||
|
unzip -q -d Lib/ -o Lib/ensurepip/_bundled/setuptools-65.5.0-py3-none-any.whl && \
|
||||||
|
unzip -q -d Lib/ -o Lib/ensurepip/_bundled/pip-24.0-py3-none-any.whl \
|
||||||
))
|
))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
2
external/python3/generateExternalPackage.py
vendored
2
external/python3/generateExternalPackage.py
vendored
@ -34,7 +34,7 @@ if __name__ == '__main__':
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
for fileName in sorted(files):
|
for fileName in sorted(files):
|
||||||
if fileName.endswith(".pyc"):
|
if not fileName.endswith(".py"):
|
||||||
continue
|
continue
|
||||||
filesList.append(path.join(relPythonDir, fileName))
|
filesList.append(path.join(relPythonDir, fileName))
|
||||||
if filesList:
|
if filesList:
|
||||||
|
@ -49,13 +49,9 @@ endif # SYSTEM_PYTHON
|
|||||||
$(eval $(call gb_Module_add_check_targets,pyuno, \
|
$(eval $(call gb_Module_add_check_targets,pyuno, \
|
||||||
PythonTest_pyuno_pytests_testssl \
|
PythonTest_pyuno_pytests_testssl \
|
||||||
PythonTest_pyuno_pytests_testbz2 \
|
PythonTest_pyuno_pytests_testbz2 \
|
||||||
))
|
PythonTest_pyuno_pytests_testpip \
|
||||||
|
|
||||||
ifeq ($(OS),MACOSX)
|
|
||||||
$(eval $(call gb_Module_add_check_targets,pyuno, \
|
|
||||||
PythonTest_pyuno_pytests_testsetuptools \
|
PythonTest_pyuno_pytests_testsetuptools \
|
||||||
))
|
))
|
||||||
endif
|
|
||||||
|
|
||||||
$(eval $(call gb_Module_add_subsequentcheck_targets,pyuno, \
|
$(eval $(call gb_Module_add_subsequentcheck_targets,pyuno, \
|
||||||
PythonTest_pyuno_pytests_testcollections \
|
PythonTest_pyuno_pytests_testcollections \
|
||||||
|
16
pyuno/PythonTest_pyuno_pytests_testpip.mk
Normal file
16
pyuno/PythonTest_pyuno_pytests_testpip.mk
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
||||||
|
#
|
||||||
|
# This file is part of the LibreOffice project.
|
||||||
|
#
|
||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
#
|
||||||
|
|
||||||
|
$(eval $(call gb_PythonTest_PythonTest,pyuno_pytests_testpip))
|
||||||
|
|
||||||
|
$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testpip,$(SRCDIR)/pyuno/qa/pytests,\
|
||||||
|
testpip \
|
||||||
|
))
|
||||||
|
|
||||||
|
# vim: set noet sw=4 ts=4:
|
14
pyuno/qa/pytests/testpip.py
Normal file
14
pyuno/qa/pytests/testpip.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import os
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
# tdf#162786: make sure importing pip works on all platforms
|
||||||
|
class SetupToolsTest(unittest.TestCase):
|
||||||
|
def test_pip_import(self):
|
||||||
|
import pip
|
||||||
|
|
||||||
|
# use imported pip module for pyflakes
|
||||||
|
with open(os.devnull, "w") as devnull:
|
||||||
|
print(str(pip), file=devnull)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
Loading…
x
Reference in New Issue
Block a user