summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2014-01-20 05:51:09 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2014-01-20 07:55:55 -0500
commit6684edba2f65a99bc04112d43bd02ee60c714190 (patch)
tree287bfbf8ed2cd8531689a3d0a9052b18d49903eb
parenta39e3cc06d6c514eea72f17db17dba6a41db5382 (diff)
downloadpycurl-6684edba2f65a99bc04112d43bd02ee60c714190.tar.gz
Test --avoid-stdio on travis, add PYCURL_SETUP_OPTIONS environment variable to make that work
-rw-r--r--.travis.yml3
-rw-r--r--INSTALL.rst5
-rw-r--r--setup.py13
-rwxr-xr-xtests/travis/run.sh4
4 files changed, 20 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml
index f9d7b63..6b3d25a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,6 +30,9 @@ matrix:
env:
- USECURL=7.34.0
- USESSL=none
+ - python: 2.7
+ env:
+ - AVOIDSTDIO=yes
install: >
./tests/travis/setup.sh
before_script: >
diff --git a/INSTALL.rst b/INSTALL.rst
index 5ca73d6..65475a3 100644
--- a/INSTALL.rst
+++ b/INSTALL.rst
@@ -108,7 +108,10 @@ Additional Windows setup.py options:
CURLOPT_WRITEHEADER options. This option applies only on Python 2; on
Python 3, file objects no longer expose C library FILE pointers and the
C runtime issue does not exist. On Python 3, this option is recognized but
- does nothing.
+ does nothing. You can also give ``--avoid-stdio`` option in
+ PYCURL_SETUP_OPTIONS environment variable as follows::
+
+ PYCURL_SETUP_OPTIONS=--avoid-stdio pip install pycurl
A good ``setup.py`` target to use is ``bdist_wininst`` which produces an
executable installer that you can run to install PycURL.
diff --git a/setup.py b/setup.py
index 5adc91d..0b4d063 100644
--- a/setup.py
+++ b/setup.py
@@ -246,8 +246,7 @@ class ExtensionConfiguration(object):
self.extra_link_args.append("-flat_namespace")
# Recognize --avoid-stdio on Unix so that it can be tested
- if scan_argv('--avoid-stdio') is not None:
- self.extra_compile_args.append("-DAVOID_STDIO")
+ self.check_avoid_stdio()
def configure_windows(self):
@@ -284,8 +283,7 @@ class ExtensionConfiguration(object):
fail("libcurl.lib does not exist at %s.\nCurl directory must point to compiled libcurl (bin/include/lib subdirectories): %s" %(libcurl_lib_path, curl_dir))
self.extra_objects.append(libcurl_lib_path)
- if scan_argv('--avoid-stdio') is not None:
- self.extra_compile_args.append("-DAVOID_STDIO")
+ self.check_avoid_stdio()
# make pycurl binary work on windows xp.
# we use inet_ntop which was added in vista and implement a fallback.
@@ -310,6 +308,13 @@ class ExtensionConfiguration(object):
configure = configure_windows
else:
configure = configure_unix
+
+
+ def check_avoid_stdio(self):
+ if 'PYCURL_SETUP_OPTIONS' in os.environ and '--avoid-stdio' in os.environ['PYCURL_SETUP_OPTIONS']:
+ self.extra_compile_args.append("-DAVOID_STDIO")
+ if scan_argv('--avoid-stdio') is not None:
+ self.extra_compile_args.append("-DAVOID_STDIO")
def get_bdist_msi_version_hack():
# workaround for distutils/msi version requirement per
diff --git a/tests/travis/run.sh b/tests/travis/run.sh
index 035afea..a596588 100755
--- a/tests/travis/run.sh
+++ b/tests/travis/run.sh
@@ -37,4 +37,8 @@ fi
export VSFTPD_PATH=vsftpd
+if test -n "$AVOIDSTDIO"; then
+ export PYCURL_SETUP_OPTIONS=--avoid-stdio
+fi
+
make test