aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorCosimo Lupo <cosimo@anthrotype.com>2017-08-23 19:45:13 +0100
committerEugene Kliuchnikov <eustas@google.com>2017-08-23 20:45:13 +0200
commit4f455cac329d0c612887123c9dc6de9a66fa8490 (patch)
tree7d4c2d9f96660869bd30fc9d0578bbfafad6f5be /setup.py
parent019091f994c581bbadc3995a97a51488616d2f59 (diff)
downloadbrotli-4f455cac329d0c612887123c9dc6de9a66fa8490.tar.gz
disable buidling/deployment of python wheels (#583)
* [appveyor] remove 'deploy' stage; only test python 2.7 and 3.6 all the other python versions are being built and tested on https://github.com/google/brotli-wheels/blob/d571d63/appveyor.yml * remove terrify submodule as not needed any more * [travis] just test py2.7 and 3.6 on linux; remove extra osx python builds All the other python versions for OSX are being built/tested on: https://github.com/google/brotli-wheels/blob/d571d63/.travis.yml Also, there's no need to build and deploy wheels here, as that's done in the separate repository. * [setup.py] only rebuild if dependency are newer; fix typo in list of 'depends' https://github.com/python/cpython/blob/v3.6.2/Lib/distutils/command/build_ext.py#L485-L500 * [ci] only run 'python setup.py test' if we run 'python setup.py built test', the setuptools 'test' command will forcibly re-run the build_ext subcommand because it wants to pass the --inplace option (it ignores whether it's up to date, just re-runs it all the time). with this we go from running built_ext twice, to running it only once per build * [Makefile] run 'build_ext --inplace' instead of 'develop' as default target The 'develop' command is like 'install' in the sense that it modifies the user's python environment. The default make target should be less intrusive, i.e. just building the extension module in-place without modify anything in the user's environment. We don't need to tell make about the dependency between 'test' and 'build' target as that is baked in the `python setup.py test` command. * [Makefile] add 'develop' target; remove unnecessary 'tests' target `make test` is good enough * [Makefile] `setup.py test` requires setuptools; run `python -m unittest` This will work even if setuptools is not installed, which is unlikely nowadays but still our `setup.py` works with plain distutils, so we may well have our tests work without setuptools. * [python/README.md] add ref to 'develop' target; remove 'tests', just 'make test' * [setup.py] import modules as per nicksay's comment https://github.com/google/brotli/pull/583#discussion_r131981049 * [Makefile] add 'develop' to .PHONY targets remove 'tests' from .PHONY * [appveyor] remove unused setup scripts We don't need to install custom python versions, we are using the pre-installed ones on Appveyor. * [appveyor] remove unneeded setup code
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 6dd513f..a8a2ebe 100644
--- a/setup.py
+++ b/setup.py
@@ -15,6 +15,9 @@ except:
from distutils.core import Extension
from distutils.core import setup
from distutils.command.build_ext import build_ext
+from distutils import errors
+from distutils import dep_util
+from distutils import log
CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
@@ -53,6 +56,20 @@ class BuildExt(build_ext):
return filenames
def build_extension(self, ext):
+ if ext.sources is None or not isinstance(ext.sources, (list, tuple)):
+ raise errors.DistutilsSetupError(
+ "in 'ext_modules' option (extension '%s'), "
+ "'sources' must be present and must be "
+ "a list of source filenames" % ext.name)
+
+ ext_path = self.get_ext_fullpath(ext.name)
+ depends = ext.sources + ext.depends
+ if not (self.force or dep_util.newer_group(depends, ext_path, 'newer')):
+ log.debug("skipping '%s' extension (up-to-date)", ext.name)
+ return
+ else:
+ log.info("building '%s' extension", ext.name)
+
c_sources = []
cxx_sources = []
for source in ext.sources:
@@ -211,7 +228,7 @@ EXT_MODULES = [
'c/enc/cluster_inc.h',
'c/enc/command.h',
'c/enc/compress_fragment.h',
- 'c/enc/compress_fragment_two_pass.h'
+ 'c/enc/compress_fragment_two_pass.h',
'c/enc/context.h',
'c/enc/dictionary_hash.h',
'c/enc/entropy_encode.h',