setup.py


Log

Author Commit Date CI Message
Evgenii Kliuchnikov 29e040b8 2025-08-06T06:17:04 use static init to reduce encoder library size PiperOrigin-RevId: 791661871
Benjamin Leff 0e0ed5f0 2025-05-27T08:53:51 perf: conditionally install pkgconfig if using system brotli
gorloffslava 0ea9927a 2024-11-21T16:11:26 + Improved setup.py formatting + Updated dependency resolution for edge cases in setup.py
Benjamin Leff b93502da 2024-08-29T19:17:37 fix: renamed print
gorloffslava 2a01fd8f 2024-07-29T20:05:34 + Added ability to build Brotli Python bindings against system-provided brotli instead of vendored one
Cosimo Lupo 2ce85662 2023-09-07T10:28:09 setup.py: add long_description (#1073) twine (the tool we use to upload packages to PyPI) is currently failing if the long_description (used to render a project's page on PyPI website) is not set. Somehow it complains that it is not well formatted reStructuredText, but it's simply empty... This looks like a bug, or bad interaction between twince and setuptools, because the field is technically optional. Also see https://github.com/pypa/twine/issues/960 and https://github.com/pypa/twine/issues/908. This issue is currently preventing the upload of newly built Brotli v1.1.0 Python wheels to PyPI: https://github.com/google/brotli-wheels/issues/18#issuecomment-1706910190 Anyway, we may well set the long_description to the content of the README.md file, as it's customary for python projects.
Evgenii Kliuchnikov 27a9a809 2023-07-30T03:44:38 simplify CMake build PiperOrigin-RevId: 552238545
Ma Lin c8df4b30 2022-12-29T21:07:16 Python: use a new output buffer code (#902) Currently, the output buffer is a std::vector<uint8_t>. When the buffer grows, resizing will cause unnecessary memcpy(). This change uses a list of bytes object to represent output buffer, can avoid the extra overhead of resizing. In addition, C++ code can be removed, it's a pure C extension.
Eugene Kliuchnikov 19d86fb9 2021-08-04T14:42:02 Merge-in SharedDictionary feature (#916) Co-authored-by: Eugene Kliuchnikov <eustas@chromium.org>
Eugene Kliuchnikov 223d80cf 2020-08-26T12:32:27 Update (#826) * IMPORTANT: decoder: fix potential overflow when input chunk is >2GiB * simplify max Huffman table size calculation * eliminate symbol duplicates (static arrays in .h files) * minor combing in research/ code
James Hilliard 5c3a9a93 2019-08-16T08:32:14 Fix license in setup.py (#769)
William A. Kennington III fc4d3459 2018-07-09T01:40:08 Fix missing header files (#695) Our dist tarball is missing hash_rolling_inc.h and hash_composite_inc.h, which causes subsequent autotools builds to fail. Fix this by adding it to the sources list. Signed-off-by: William A. Kennington III <william@wkennington.com>
Eugene Kliuchnikov 631fe194 2018-03-20T17:37:41 Update (#651) * fix `bazel` build (ignore switch case fall-through) * add `NPOSTFIX` / `NDIRECT` encoder parameters * fix source file lists (add `params.h`) * fix bug in `durchschlag` * print clarifying messages wheb CLI argument parsing fails
Eugene Kliuchnikov 35e69fc7 2018-02-26T09:04:36 New feature: "Large Window Brotli" (#640) * New feature: "Large Window Brotli" By setting special encoder/decoder flag it is now possible to extend LZ-window up to 30 bits; though produced stream will not be RFC7932 compliant. Added new dictionary generator - "DSH". It combines speed of "Sieve" and quality of "DM". Plus utilities to prepare train corpora (remove unique strings). Improved compression ratio: now two sub-blocks could be stitched: the last copy command could be extended to span the next sub-block. Fixed compression ineffectiveness caused by floating numbers rounding and wrong cost heuristic. Other C changes: - combined / moved `context.h` to `common` - moved transforms to `common` - unified some aspects of code formatting - added an abstraction for encoder (static) dictionary - moved default allocator/deallocator functions to `common` brotli CLI: - window size is auto-adjusted if not specified explicitly Java: - added "eager" decoding both to JNI wrapper and pure decoder - huge speed-up of `DictionaryData` initialization * Add dictionaryless compressed dictionary * Fix `sources.lst` * Fix `sources.lst` and add a note that `libtool` is also required. * Update setup.py * Fix `EagerStreamTest` * Fix BUILD file * Add missing `libdivsufsort` dependency * Fix "unused parameter" warning.
Cosimo Lupo 4f455cac 2017-08-23T19:45:13 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
Eugene Kliuchnikov 6ece1d87 2017-04-23T14:07:08 Move files & update paths (#541) * Move files & update paths * Rename build to scripts. * Fix paths * Fix script.
Eugene Kliuchnikov cdca91b6 2017-03-06T14:22:45 Update common, decoder, encoder, java (#520) Common: * wrap dictionary data into `BrotliDictionary` structure * replace public constant with getter `BrotliGetDictionary` * reformat dictionary data Decoder: * adopt common changes * clarify acceptable instance usage patterns * hold reference to dictionary in state Encoder: * adopt common changes * eliminate PIC spots in `CreateBackwardReferences` * add per-chunk ratio guards for q0 and q1 * precompute relative distances to avoid repeated calculations * prostpone hasher allocation/initialization * refactor Hashers to be class-like structure * further improvements for 1MiB+ inputs * added new hasher type; made hashers more configurable Java: * Pull byte->int magic to `IntReader` from `BitReader`
Eugene Kliuchnikov 11df843c 2017-02-06T14:20:43 Update encoder (#504) * pull `BROTLI_MAX_BACKWARD_LIMIT` to constants * split generic and Zopfli backward references code * pull hashers init and stitch invocation to encoder * make `dictionary_hash` a compilation unit * add `size hint` parameter * add new hasher * use `size hint` to pick new hasher for q4 * modernize clz guard (fix #495) * move `hash to binary tree` to separate file * add `Initialize` and `Cleanup` to all hashers * do not raise OOM if malloc(0) == NULL (fix #500)
Alex Nicksay 89a5b6e6 2016-12-20T08:40:47 Python: Simplify test suite generation by using unittest discovery (#485)
Alex Nicksay f7b5b3dc 2016-09-28T17:26:00 Python: Create native brotli module and move extension to _brotli
Alex Nicksay 6f55ee60 2016-09-28T15:19:49 Python: Clean up setup.py file
Eugene Kliuchnikov 6e2207f4 2016-08-23T14:44:13 Add includedir to setup.py
Eugene Kliuchnikov 81480011 2016-08-23T14:40:33 Move "public" to "include/brotli"
Eugene Kliuchnikov ceddddeb 2016-08-22T15:59:08 Fix setup.py regexp
Eugene Kliuchnikov 2c2d5578 2016-08-22T15:44:12 Use version from common/version.h
Eugene Kliuchnikov 403729c4 2016-08-22T13:59:21 Fix setup.py
Eugene Kliuchnikov 8872d7b4 2016-06-13T15:22:13 Fix CI build.
Eugene Kliuchnikov 2a6b041a 2016-06-03T12:02:01 Update setup.py
Eugene Kliuchnikov db3a1162 2016-06-13T15:22:13 Fix CI build.
Eugene Kliuchnikov 11d1337b 2016-06-03T12:02:01 Update setup.py
eustas 14b32cc3 2016-02-16T15:16:54 Remove obsolete compilation unit
Zoltan Szabadka 47f1eaba 2016-01-11T12:05:18 Add the new source files to setup.py
Cosimo Lupo 8b2ca8ef 2015-12-08T12:33:06 setup.py: don't enable c++0x for gcc
Cosimo Lupo 18a29545 2015-10-06T12:23:57 [setup.py] add PyPI trove classifiers
Cosimo Lupo b2f6c6db 2015-10-01T12:57:50 [setup.py] remove monkey-patch for distutils.msvc9compiler; try to import setuptools required by "Microsoft Visual C++ Compiler for Python 2.7" Cf. http://aka.ms/vcpython27
Zoltan Szabadka b5c92e54 2015-10-02T11:32:42 Add tools/version.h that conatins the brotli version. This can be reused by all of the tools. Set the version to the next git release tag.
Zoltan Szabadka 4c37566f 2015-10-01T15:10:42 Move literal cost computation to where it's used. Move utf8 heuristics functions to their own file.
Zoltan Szabadka 4a7024dc 2015-10-01T12:08:14 Make the brotli encoder C++98 compatible.
Zoltan Szabadka 0cf3a544 2015-09-24T18:35:25 Update brotli decoder with latest improvements.
Cosimo Lupo e88fe7b2 2015-08-12T10:11:30 [setup.py] pass extra compiler flags on OS X to enable support for C++11: -stdlib=libc++ -mmacosx-version-min=10.7
Cosimo Lupo d2c8b277 2015-08-11T10:38:20 [setup.py] retrieve version string from brotlimodule.cc so we don't need to modify it more than once
Cosimo Lupo 54baf43c 2015-08-10T18:04:30 [setup.py] support MINGW32 compiler: fix clashing 'hypot' definition; statically link libgcc and libstdc++
Cosimo Lupo c3540e2b 2015-08-10T18:01:29 [setup.py] use MSVC 10.0 when compiling for Windows Python 2.7 Python 2.7 for Windows is compiled using MS Visaul C++ 9.0 (Visual Studio 2008). However the latter does not support many modern C++ features which are required to compile the Brotli encoder. So we monkey-patch distutils to always look for MSVC version 10.0 instead of 9.0.
Zoltan Szabadka 4b2fd00e 2015-08-10T16:39:50 Use a single lookup table for insert/copy offsets and extra bits. Remove safe_malloc.c since all the bounds checking is done inside decode.c now.
Zoltan Szabadka 66098830 2015-06-12T16:45:17 Use a static hash table to look up dictionary words and transforms. This is used for quality 11, for qualities <= 9 we already have a simpler hash table. The static data size is 252 kB, and this removes the need to initialize a huge hash map at startup, which was the reason why transforms had to be disabled by default. In comparison, the static dictionary itself is 120 kB. This supports every transform, except the kOmitFirstN.
Zoltan Szabadka 83aa24dc 2015-05-07T16:53:43 Speed and memory usage improvements for the decoder. * Change order of members of bit reader state structure. * Remove unused includes for assert. Add BROTLI_DCHECK macros and use it instead of assert. * Do not calculate nbits in common case of ReadSymbol. * Introduce and use PREDICT_TRUE / PREDICT_FALSE macros. * Allocate less memory in the brotli decoder if it knows the result size beforehand. Before this, the decoder would always allocate 16MB if the encoder annotated the window size as 22 bit (which is the default), even if the file is only a few KB uncompressed. Now, it'll only allocate a ringbuffer as large as needed for the result file. But only if it can know the filesize, it's not possible to know that if there are multiple metablocks or too large uncompressed metablock.
Zoltan Szabadka e91a4492 2015-04-23T15:55:43 Add dictionary_hash.h to setup.py.
Zoltan Szabadka 09aa9ca4 2015-04-23T14:35:43 Add the streams.* files to Makefile and setup.py
Cosimo Lupo 77c23995 2015-03-31T09:30:56 [python] moved setup.py to the root of repository