From a8d1bf5266b857a2faccb2c97227516858c8f75c Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Sun, 10 Apr 2016 19:36:02 +0100 Subject: [PATCH 1/3] appveyor: also upload source distribution packages to Github Releases This is so that one can do: pip install --find-links https://github.com/google/brotli/releases/latest brotli on any platform, whether or not there are pre-compiled *.whl packages that match the user's python version and anchitecture (e.g. Linux). Pip automatically chooses the correct binary package, and if that isn't available the source distribution (*.tar.gz or *.zip) is downloaded. --- appveyor.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d414425..0b60e82 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,8 +48,8 @@ install: # upgrade pip to avoid out-of-date warnings - "pip install --disable-pip-version-check --user --upgrade pip" - # install wheel to build compiled packages - - "pip install --upgrade wheel" + # install/upgrade setuptools and wheel to build packages + - "pip install --upgrade setuptools wheel" build: false @@ -57,12 +57,15 @@ test_script: - "%WITH_COMPILER% python setup.py build_ext test" after_test: - # if tests are successful, create binary packages for the project + # if tests are successful, create binary and source packages for the project - "%WITH_COMPILER% pip wheel -w dist ." + - "%WITH_COMPILER% python setup.py sdist --formats=gztar,zip" artifacts: # archive the generated packages in the ci.appveyor.com build report - - path: dist\* + - path: dist\*.whl + - path: dist\*.zip + - path: dist\*.tar.gz # For info, see: http://www.appveyor.com/docs/deployment/github From f66c7c5442a9d50ce775a5469b25d936b5726626 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Sun, 10 Apr 2016 20:51:10 +0100 Subject: [PATCH 2/3] python/tests: clean up generated files if successful --- python/tests/compatibility_test.py | 5 ++++- python/tests/custom_dictionary_test.py | 5 +++++ python/tests/roundtrip_test.py | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/python/tests/compatibility_test.py b/python/tests/compatibility_test.py index 668c9ec..b6dbf77 100755 --- a/python/tests/compatibility_test.py +++ b/python/tests/compatibility_test.py @@ -24,4 +24,7 @@ for filename in glob.glob("testdata/*.compressed*"): env=TEST_ENV) if diff_q(uncompressed, expected) != 0: sys.exit(1) - os.unlink(uncompressed) + try: + os.unlink(uncompressed) + except OSError: + pass diff --git a/python/tests/custom_dictionary_test.py b/python/tests/custom_dictionary_test.py index afbf07a..34a44bd 100644 --- a/python/tests/custom_dictionary_test.py +++ b/python/tests/custom_dictionary_test.py @@ -34,3 +34,8 @@ for filename in INPUTS.splitlines(): uncompressed, "--custom-dictionary", filename], env=TEST_ENV) if diff_q(filename, uncompressed) != 0: sys.exit(1) + try: + os.unlink(compressed) + os.unlink(uncompressed) + except OSError: + pass diff --git a/python/tests/roundtrip_test.py b/python/tests/roundtrip_test.py index 719a7b7..02c784d 100755 --- a/python/tests/roundtrip_test.py +++ b/python/tests/roundtrip_test.py @@ -41,3 +41,8 @@ for filename in INPUTS.splitlines(): env=TEST_ENV) if diff_q(filename, uncompressed) != 0: sys.exit(1) + try: + os.unlink(compressed) + os.unlink(uncompressed) + except OSError: + pass From bd88e3cb8d876436d2b81f3fe30c3be052002e53 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Sun, 10 Apr 2016 20:51:21 +0100 Subject: [PATCH 3/3] add MANIFEST.in to ensure source distribution contains all required files Except tests as they are too big... --- MANIFEST.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..179bc6e --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,18 @@ +include CONTRIBUTING.md +include dec/*.c +include dec/*.h +include dec/Makefile +include enc/*.cc +include enc/*.h +include enc/Makefile +include LICENSE +include MANIFEST.in +include python/bro.py +include python/brotlimodule.cc +include python/README.md +include README.md +include setup.py +include shared.mk +include tools/bro.cc +include tools/Makefile +include tools/version.h \ No newline at end of file