Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twisted recipe #2147

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions pythonforandroid/recipes/twisted/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
import shutil

from pythonforandroid.recipe import CythonRecipe


Expand All @@ -6,15 +9,21 @@ class TwistedRecipe(CythonRecipe):
url = 'https://github.com/twisted/twisted/archive/twisted-{version}.tar.gz'

depends = ['setuptools', 'zope_interface', 'incremental', 'constantly']
patches = ['incremental.patch']
patches = ['incremental.patch', 'remove_tests.patch']

call_hostpython_via_targetpython = False
install_in_hostpython = False

def prebuild_arch(self, arch):
super().prebuild_arch(arch)
# TODO Need to whitelist tty.pyo and termios.so here
print('Should remove twisted tests etc. here, but skipping for now')

# remove the unit test dirs
source_dir = os.path.join(self.get_build_dir(arch.arch), 'src/twisted')
for item in os.walk(source_dir):
if os.path.basename(item[0]) == 'test':
full_path = os.path.join(source_dir, item[0])
shutil.rmtree(full_path, ignore_errors=True)

def get_recipe_env(self, arch):
env = super().get_recipe_env(arch)
Expand Down
16 changes: 16 additions & 0 deletions pythonforandroid/recipes/twisted/remove_tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/src/twisted/python/_setup.py b/src/twisted/python/_setup.py
index 32cb096c7..a607fef07 100644
--- a/src/twisted/python/_setup.py
+++ b/src/twisted/python/_setup.py
@@ -160,11 +160,6 @@ class ConditionalExtension(Extension, object):

# The C extensions used for Twisted.
_EXTENSIONS = [
- ConditionalExtension(
- "twisted.test.raiser",
- sources=["src/twisted/test/raiser.c"],
- condition=lambda _: _isCPython),
-
ConditionalExtension(
"twisted.internet.iocpreactor.iocpsupport",
sources=[