Skip to content

zope_interface no_tests.patch fails #3108

Open
@magowiz

Description

Hi,
I'm aware that there is #3083 that tells issue for the fix-init.patch, so since the change wasn't already done I created a copy of original develop recipe to remove the applying of that non-working patch, by the way I discovered that also the other patch no_tests.patch fails

Here it is my buildozer log:

running patch -t -d /srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/zope_interface/arm64-v8a__ndk_target_21/zope_interface -p1 -i /home/jenkins/workspace/anization_folder_synapse_develop/p4a_recipes/zope_interface/no_tests.patch�[0m
�[1m�[90m[DEBUG]�[39m�[0m:   	patching file setup.py
�[1m�[90m[DEBUG]�[39m�[0m:   	patch unexpectedly ends in middle of line
�[1m�[90m[DEBUG]�[39m�[0m:   	Hunk #1 FAILED at 139.
�[1m�[90m[DEBUG]�[39m�[0m:   	1 out of 1 hunk FAILED -- saving rejects to file setup.py.rej
Exception in thread background thread for pid 496:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 1642, in wrap
    fn(*rgs, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 2644, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 2335, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 823, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/bin/patch -t -d /srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/zope_interface/arm64-v8a__ndk_target_21/zope_interface -p1 -i /home/jenkins/workspace/anization_folder_synapse_develop/p4a_recipes/zope_interface/no_tests.patch

  STDOUT:
patching file setup.py
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 139.
1 out of 1 hunk FAILED -- saving rejects to file setup.py.rej


  STDERR:

�[1m[INFO]�[0m:    STDOUT:
�[33m	patching file setup.py	
patch unexpectedly ends in middle of line	
Hunk #1 FAILED at 139.	
1 out of 1 hunk FAILED -- saving rejects to file setup.py.rej�[39m
�[1m[INFO]�[0m:    STDERR:
�[31m	�[39m
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1246, in <module>
    main()
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/toolchain.py", line 677, in __init__
    getattr(self, command)(args)
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/toolchain.py", line 104, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/toolchain.py", line 163, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/build.py", line 497, in build_recipes
    recipe.apply_patches(arch)
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/recipe.py", line 565, in apply_patches
    self.apply_patch(
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/recipe.py", line 285, in apply_patch
    shprint(sh.patch, "-t", "-d", build_dir, "-p1",
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 879, in __next__
    self.wait()
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 796, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 823, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/bin/patch -t -d /srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/zope_interface/arm64-v8a__ndk_target_21/zope_interface -p1 -i /home/jenkins/workspace/anization_folder_synapse_develop/p4a_recipes/zope_interface/no_tests.patch

  STDOUT:
patching file setup.py
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 139.
1 out of 1 hunk FAILED -- saving rejects to file setup.py.rej


  STDERR:

�[0m�[1;31m# Command failed: ['/usr/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=synapse', '--bootstrap=sdl2', '--requirements=python3,kivy,twisted', '--arch=armeabi-v7a', '--arch=x86_64', '--arch=x86', '--arch=arm64-v8a', '--copy-libs', '--local-recipes', '/home/jenkins/workspace/anization_folder_synapse_develop/p4a_recipes', '--color=always', '--storage-dir=/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a', '--ndk-api=21', '--ignore-setup-py', '--debug']�[0m
�[0m�[1;31m# ENVIRONMENT:�[0m
�[0m�[1;31m#     JENKINS_HOME = '/var/jenkins_home'�[0m
�[0m�[1;31m#     ARCH = 'armeabi-v7a_x86_64_x86_arm64-v8a'�[0m
�[0m�[1;31m#     GIT_PREVIOUS_SUCCESSFUL_COMMIT = '0506de50e460c5cb41b6128ef08b43446521507d'�[0m
�[0m�[1;31m#     PIP_TRUSTED_HOST = 'hephaestus.local'�[0m
�[0m�[1;31m#     CI = 'true'�[0m
�[0m�[1;31m#     HOSTNAME = '4b8cc2021deb'�[0m
�[0m�[1;31m#     RUN_CHANGES_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/59/display/redirect?page=changes'�[0m
�[0m�[1;31m#     NODE_LABELS = 'general x86 zima zimaboard amd64'�[0m
�[0m�[1;31m#     GIT_COMMIT = 'ce7d3ee971f890e1b37f3e8e6fcb8b87fb92b2c3'�[0m
�[0m�[1;31m#     IP_TRUSTED_HOST = '192.168.2.11'�[0m
�[0m�[1;31m#     HUDSON_URL = 'http://jenkins:8080/'�[0m
�[0m�[1;31m#     HOME = '/root'�[0m
�[0m�[1;31m#     BUILD_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/59/'�[0m
�[0m�[1;31m#     JENKINS_SERVER_COOKIE = 'durable-5f5dc3553d5d2cb1ec58d1e9368d725b13421e0a58f7b524f82b952feb80a477'�[0m
�[0m�[1;31m#     WORKSPACE = '/home/jenkins/workspace/anization_folder_synapse_develop'�[0m
�[0m�[1;31m#     NODE_NAME = 'zima'�[0m
�[0m�[1;31m#     VERSION = '0.1'�[0m
�[0m�[1;31m#     PROJECT_NAME = 'synapse'�[0m
�[0m�[1;31m#     LINT_TAG_REGEX = '.*\\[lint\\].*'�[0m
�[0m�[1;31m#     RUN_ARTIFACTS_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/59/display/redirect?page=artifacts'�[0m
�[0m�[1;31m#     ANDROID_KEYSTORE = ****�[0m
�[0m�[1;31m#     EXECUTOR_NUMBER = '0'�[0m
�[0m�[1;31m#     GIT_BRANCH = 'develop'�[0m
�[0m�[1;31m#     STAGE_NAME = 'build_mobile'�[0m
�[0m�[1;31m#     TERM = 'xterm'�[0m
�[0m�[1;31m#     RUN_TESTS_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/59/display/redirect?page=tests'�[0m
�[0m�[1;31m#     BUILD_DISPLAY_NAME = '#59'�[0m
�[0m�[1;31m#     HUDSON_HOME = '/var/jenkins_home'�[0m
�[0m�[1;31m#     JOB_BASE_NAME = 'develop'�[0m
�[0m�[1;31m#     PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin:/root/.cargo/bin'�[0m
�[0m�[1;31m#     PIP_INDEX_URL = 'http://hephaestus.local:5000/index/'�[0m
�[0m�[1;31m#     Dockerfolders = 'android_emulator,build_wheel,buildozer,generate_doc,pytest_x11'�[0m
�[0m�[1;31m#     BUILD_ID = '59'�[0m
�[0m�[1;31m#     BUILD_TAG = 'jenkins-organization folder-synapse-develop-59'�[0m
�[0m�[1;31m#     JENKINS_URL = 'http://jenkins:8080/'�[0m
�[0m�[1;31m#     IP_INDEX_URL = 'http://192.168.2.11:5000/index/'�[0m
�[0m�[1;31m#     GIT_URL = 'http://gitea:3000/magowiz/synapse.git'�[0m
�[0m�[1;31m#     JOB_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/'�[0m
�[0m�[1;31m#     BUILD_NUMBER = '59'�[0m
�[0m�[1;31m#     DEBIAN_FRONTEND = 'noninteractive'�[0m
�[0m�[1;31m#     JENKINS_NODE_COOKIE = '239909cc-af5d-40f7-8e45-5ef311713ff7'�[0m
�[0m�[1;31m#     RUN_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/59/display/redirect'�[0m
�[0m�[1;31m#     HUDSON_SERVER_COOKIE = '90c4dca5545f12e3'�[0m
�[0m�[1;31m#     JOB_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/display/redirect'�[0m
�[0m�[1;31m#     CLASSPATH = ''�[0m
�[0m�[1;31m#     JOB_NAME = 'organization folder/synapse/develop'�[0m
�[0m�[1;31m#     PWD = '/home/jenkins/workspace/anization_folder_synapse_develop'�[0m
�[0m�[1;31m#     GIT_PREVIOUS_COMMIT = '483f5e29fdce0db31ef8bc0bb9b3e248809f6524'�[0m
�[0m�[1;31m#     bundletool = 'java -jar building_apk/bundletool-all-1.11.0.jar'�[0m
�[0m�[1;31m#     WORKSPACE_TMP = '/home/jenkins/workspace/anization_folder_synapse_develop_tmp'�[0m
�[0m�[1;31m#     TZ = 'Europe/Rome'�[0m
�[0m�[1;31m#     BRANCH_NAME = 'develop'�[0m
�[0m�[1;31m#     LC_CTYPE = 'C.UTF-8'�[0m
�[0m�[1;31m#     PACKAGES_PATH = '/root/.buildozer/android/packages'�[0m
�[0m�[1;31m#     ANDROIDSDK = '/root/.buildozer/android/platform/android-sdk'�[0m
�[0m�[1;31m#     ANDROIDNDK = '/root/.buildozer/android/platform/android-ndk-r25b'�[0m
�[0m�[1;31m#     ANDROIDAPI = '31'�[0m
�[0m�[1;31m#     ANDROIDMINAPI = '21'�[0m
�[0m�[1;31m# �[0m
�[0m�[1;31m# Buildozer failed to execute the last command�[0m
�[0m�[1;31m# The error might be hidden in the log above this error�[0m
�[0m�[1;31m# Please read the full log, and search for it before�[0m
�[0m�[1;31m# raising an issue with buildozer itself.�[0m
�[0m�[1;31m# In case of a bug report, please add a full log with log_level = 2�[0m

here it is mine recipe (original one without fix-init.patch applying):

from os.path import join

from pythonforandroid.recipe import PythonRecipe
from pythonforandroid.toolchain import current_directory
from pythonforandroid.util import rmdir


class ZopeInterfaceRecipe(PythonRecipe):
    call_hostpython_via_targetpython = False
    name = 'zope_interface'
    version = '4.1.3'
    url = 'https://pypi.python.org/packages/source/z/zope.interface/zope.interface-{version}.tar.gz'
    site_packages_name = 'zope.interface'
    depends = ['setuptools']
    patches = ['no_tests.patch']

    def build_arch(self, arch):
        super().build_arch(arch)
        # The zope.interface module lacks of the __init__.py file in one of his
        # folders (once is installed), that leads into an ImportError.
        # Here we intentionally apply a patch to solve that, so, in case that
        # this is solved in the future an error will be triggered
        zope_install = join(self.ctx.get_site_packages_dir(arch), 'zope')
        # self.apply_patch('fix-init.patch', arch.arch, build_dir=zope_install)

    def prebuild_arch(self, arch):
        super().prebuild_arch(arch)
        with current_directory(self.get_build_dir(arch.arch)):
            rmdir('src/zope/interface/tests')
            rmdir('src/zope/interface/common/tests')


recipe = ZopeInterfaceRecipe()

So I tried to remove also the other patch, this way: removing it from patches list and in prebuild_arch I removed all from with to the end, by the way the build fails also like this.

[1m�[90m[DEBUG]�[39m�[0m:   �[90m->�[0m running python3 setup.py install -O2 --root=/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/python-installs/synapse/arm64-v8a --install-lib=.�[0m
�[1m�[90m[DEBUG]�[39m�[0m:   	/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/zope_interface/arm64-v8a__ndk_target_21/zope_interface/setup.py:26: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
�[1m�[90m[DEBUG]�[39m�[0m:   	  from distutils.errors import CCompilerError
�[1m�[90m[DEBUG]�[39m�[0m:   	/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/_distutils_hack/__init__.py:11: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
�[1m�[90m[DEBUG]�[39m�[0m:   	  warnings.warn(
�[1m�[90m[DEBUG]�[39m�[0m:   	/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/_distutils_hack/__init__.py:26: UserWarning: Setuptools is replacing distutils.
�[1m�[90m[DEBUG]�[39m�[0m:   	  warnings.warn("Setuptools is replacing distutils.")
�[1m�[90m[DEBUG]�[39m�[0m:   	/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
�[1m�[90m[DEBUG]�[39m�[0m:   	!!
�[1m�[90m[DEBUG]�[39m�[0m:   	
�[1m�[90m[DEBUG]�[39m�[0m:   	        ********************************************************************************
�[1m�[90m[DEBUG]�[39m�[0m:   	        Please avoid running ``setup.py`` directly.
�[1m�[90m[DEBUG]�[39m�[0m:   	        Instead, use pypa/build, pypa/installer or other
�[1m�[90m[DEBUG]�[39m�[0m:   	        standards-based tools.
�[1m�[90m[DEBUG]�[39m�[0m:   	
�[1m�[90m[DEBUG]�[39m�[0m:   	        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
�[1m�[90m[DEBUG]�[39m�[0m:   	        ********************************************************************************
�[1m�[90m[DEBUG]�[39m�[0m:   	
�[1m�[90m[DEBUG]�[39m�[0m:   	!!
�[1m�[90m[DEBUG]�[39m�[0m:   	  self.initialize_options()
�[1m�[90m[DEBUG]�[39m�[0m:   	error: package directory 'src/zope/interface/tests' does not exist
Exception in thread background thread for pid 511:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 1642, in wrap
    fn(*rgs, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 2644, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 2335, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 823, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py install -O2 --root=/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/python-installs/synapse/arm64-v8a --install-lib=.

  STDOUT:
/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/zope_interface/arm64-v8a__ndk_target_21/zope_interface/setup.py:26: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.errors import CCompilerError
/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/_distutils_hack/__init__.py:11: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
  warnings.warn(
/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/_distutils_hack/__init__.py:26: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
error: package directory 'src/zope/interface/tests' does not exist


  STDERR:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1246, in <module>
    main()
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/toolchain.py", line 677, in __init__
    getattr(self, command)(args)
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/toolchain.py", line 104, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/toolchain.py", line 163, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/build.py", line 504, in build_recipes
    recipe.build_arch(arch)
  File "/home/jenkins/workspace/anization_folder_synapse_develop/p4a_recipes/zope_interface/__init__.py", line 18, in build_arch
    super().build_arch(arch)
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/recipe.py", line 967, in build_arch
    self.install_python_package(arch)
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/recipe.py", line 983, in install_python_package
    shprint(hostpython, 'setup.py', 'install', '-O2',
  File "/srv/buildozer_build_dir/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 879, in __next__
    self.wait()
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 796, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 823, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py install -O2 --root=/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/python-installs/synapse/arm64-v8a --install-lib=.

  STDOUT:
/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/zope_interface/arm64-v8a__ndk_target_21/zope_interface/setup.py:26: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.errors import CCompilerError
/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/_distutils_hack/__init__.py:11: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
  warnings.warn(
/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/_distutils_hack/__init__.py:26: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
error: package directory 'src/zope/interface/tests' does not exist


  STDERR:

�[0m�[1;31m# Command failed: ['/usr/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=synapse', '--bootstrap=sdl2', '--requirements=python3,kivy,twisted', '--arch=armeabi-v7a', '--arch=x86_64', '--arch=x86', '--arch=arm64-v8a', '--copy-libs', '--local-recipes', '/home/jenkins/workspace/anization_folder_synapse_develop/p4a_recipes', '--color=always', '--storage-dir=/srv/buildozer_build_dir/android/platform/build-armeabi-v7a_x86_64_x86_arm64-v8a', '--ndk-api=21', '--ignore-setup-py', '--debug']�[0m
�[0m�[1;31m# ENVIRONMENT:�[0m
�[0m�[1;31m#     JENKINS_HOME = '/var/jenkins_home'�[0m
�[0m�[1;31m#     ARCH = 'armeabi-v7a_x86_64_x86_arm64-v8a'�[0m
�[0m�[1;31m#     GIT_PREVIOUS_SUCCESSFUL_COMMIT = '0506de50e460c5cb41b6128ef08b43446521507d'�[0m
�[0m�[1;31m#     PIP_TRUSTED_HOST = 'hephaestus.local'�[0m
�[0m�[1;31m#     CI = 'true'�[0m
�[0m�[1;31m#     HOSTNAME = '461740dcfebf'�[0m
�[0m�[1;31m#     RUN_CHANGES_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/60/display/redirect?page=changes'�[0m
�[0m�[1;31m#     GIT_COMMIT = 'f8f5f38f53b9129b5246061ac3bbce6b192f21c5'�[0m
�[0m�[1;31m#     NODE_LABELS = 'general x86 zima zimaboard amd64'�[0m
�[0m�[1;31m#     IP_TRUSTED_HOST = '192.168.2.11'�[0m
�[0m�[1;31m#     HUDSON_URL = 'http://jenkins:8080/'�[0m
�[0m�[1;31m#     HOME = '/root'�[0m
�[0m�[1;31m#     BUILD_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/60/'�[0m
�[0m�[1;31m#     JENKINS_SERVER_COOKIE = 'durable-5f5dc3553d5d2cb1ec58d1e9368d725b13421e0a58f7b524f82b952feb80a477'�[0m
�[0m�[1;31m#     WORKSPACE = '/home/jenkins/workspace/anization_folder_synapse_develop'�[0m
�[0m�[1;31m#     NODE_NAME = 'zima'�[0m
�[0m�[1;31m#     LINT_TAG_REGEX = '.*\\[lint\\].*'�[0m
�[0m�[1;31m#     PROJECT_NAME = 'synapse'�[0m
�[0m�[1;31m#     VERSION = '0.1'�[0m
�[0m�[1;31m#     RUN_ARTIFACTS_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/60/display/redirect?page=artifacts'�[0m
�[0m�[1;31m#     ANDROID_KEYSTORE = ****�[0m
�[0m�[1;31m#     EXECUTOR_NUMBER = '1'�[0m
�[0m�[1;31m#     GIT_BRANCH = 'develop'�[0m
�[0m�[1;31m#     STAGE_NAME = 'build_mobile'�[0m
�[0m�[1;31m#     TERM = 'xterm'�[0m
�[0m�[1;31m#     BUILD_DISPLAY_NAME = '#60'�[0m
�[0m�[1;31m#     RUN_TESTS_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/60/display/redirect?page=tests'�[0m
�[0m�[1;31m#     JOB_BASE_NAME = 'develop'�[0m
�[0m�[1;31m#     HUDSON_HOME = '/var/jenkins_home'�[0m
�[0m�[1;31m#     PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin:/root/.cargo/bin'�[0m
�[0m�[1;31m#     PIP_INDEX_URL = 'http://hephaestus.local:5000/index/'�[0m
�[0m�[1;31m#     Dockerfolders = 'android_emulator,build_wheel,buildozer,generate_doc,pytest_x11'�[0m
�[0m�[1;31m#     BUILD_ID = '60'�[0m
�[0m�[1;31m#     BUILD_TAG = 'jenkins-organization folder-synapse-develop-60'�[0m
�[0m�[1;31m#     JENKINS_URL = 'http://jenkins:8080/'�[0m
�[0m�[1;31m#     IP_INDEX_URL = 'http://192.168.2.11:5000/index/'�[0m
�[0m�[1;31m#     GIT_URL = 'http://gitea:3000/magowiz/synapse.git'�[0m
�[0m�[1;31m#     JOB_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/'�[0m
�[0m�[1;31m#     BUILD_NUMBER = '60'�[0m
�[0m�[1;31m#     DEBIAN_FRONTEND = 'noninteractive'�[0m
�[0m�[1;31m#     JENKINS_NODE_COOKIE = '77d59b50-b97f-4b67-ba9f-e855a1cb5517'�[0m
�[0m�[1;31m#     RUN_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/60/display/redirect'�[0m
�[0m�[1;31m#     HUDSON_SERVER_COOKIE = '90c4dca5545f12e3'�[0m
�[0m�[1;31m#     JOB_DISPLAY_URL = 'http://jenkins:8080/job/organization%20folder/job/synapse/job/develop/display/redirect'�[0m
�[0m�[1;31m#     CLASSPATH = ''�[0m
�[0m�[1;31m#     JOB_NAME = 'organization folder/synapse/develop'�[0m
�[0m�[1;31m#     PWD = '/home/jenkins/workspace/anization_folder_synapse_develop'�[0m
�[0m�[1;31m#     GIT_PREVIOUS_COMMIT = 'ce7d3ee971f890e1b37f3e8e6fcb8b87fb92b2c3'�[0m
�[0m�[1;31m#     bundletool = 'java -jar building_apk/bundletool-all-1.11.0.jar'�[0m
�[0m�[1;31m#     WORKSPACE_TMP = '/home/jenkins/workspace/anization_folder_synapse_develop_tmp'�[0m
�[0m�[1;31m#     TZ = 'Europe/Rome'�[0m
�[0m�[1;31m#     BRANCH_NAME = 'develop'�[0m
�[0m�[1;31m#     LC_CTYPE = 'C.UTF-8'�[0m
�[0m�[1;31m#     PACKAGES_PATH = '/root/.buildozer/android/packages'�[0m
�[0m�[1;31m#     ANDROIDSDK = '/root/.buildozer/android/platform/android-sdk'�[0m
�[0m�[1;31m#     ANDROIDNDK = '/root/.buildozer/android/platform/android-ndk-r25b'�[0m
�[0m�[1;31m#     ANDROIDAPI = '31'�[0m
�[0m�[1;31m#     ANDROIDMINAPI = '21'�[0m
�[0m�[1;31m# �[0m
�[0m�[1;31m# Buildozer failed to execute the last command�[0m
�[0m�[1;31m# The error might be hidden in the log above this error�[0m
�[0m�[1;31m# Please read the full log, and search for it before�[0m
�[0m�[1;31m# raising an issue with buildozer itself.�[0m
�[0m�[1;31m# In case of a bug report, please add a full log with log_level = 2�[0m

here it is another version of recipe in which I removed no_tests.patch and stuff about removing tests folder:

from os.path import join

from pythonforandroid.recipe import PythonRecipe
from pythonforandroid.toolchain import current_directory
from pythonforandroid.util import rmdir


class ZopeInterfaceRecipe(PythonRecipe):
    call_hostpython_via_targetpython = False
    name = 'zope_interface'
    version = '4.1.3'
    url = 'https://pypi.python.org/packages/source/z/zope.interface/zope.interface-{version}.tar.gz'
    site_packages_name = 'zope.interface'
    depends = ['setuptools']
    patches = []#'no_tests.patch']

    def build_arch(self, arch):
        super().build_arch(arch)
        # The zope.interface module lacks of the __init__.py file in one of his
        # folders (once is installed), that leads into an ImportError.
        # Here we intentionally apply a patch to solve that, so, in case that
        # this is solved in the future an error will be triggered
        zope_install = join(self.ctx.get_site_packages_dir(arch), 'zope')
        # self.apply_patch('fix-init.patch', arch.arch, build_dir=zope_install)

    def prebuild_arch(self, arch):
        super().prebuild_arch(arch)
        # with current_directory(self.get_build_dir(arch.arch)):
            # rmdir('src/zope/interface/tests')
            #rmdir('src/zope/interface/common/tests')



recipe = ZopeInterfaceRecipe()

What can I do to make zope_interface build fine again?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions