[Python-modules-commits] [ujson] 01/01: run tests at build time + misc fixes

Sandro Tosi morph at moszumanska.debian.org
Mon Jun 29 21:05:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository ujson.

commit d81da58af643d591a20402a15fd636d8751951be
Author: Sandro Tosi <morph at debian.org>
Date:   Mon Jun 29 17:05:39 2015 -0400

    run tests at build time + misc fixes
---
 debian/control                             |  6 ++++--
 debian/copyright                           |  2 +-
 debian/patches/dont-remove-build-dir.patch | 16 ++++++++++++++++
 debian/patches/series                      |  1 +
 debian/rules                               | 23 +++++++++++++++++++----
 5 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/debian/control b/debian/control
index 780f8a8..9cb6ff2 100644
--- a/debian/control
+++ b/debian/control
@@ -1,5 +1,5 @@
 Source: ujson
-Section: unknown
+Section: python
 Priority: optional
 Maintainer: Sandro Tosi <morph at debian.org>
 Build-Depends: debhelper (>= 9), python-all-dev, python-all-dbg, python3-all-dev, python3-all-dbg, dh-python
@@ -24,7 +24,7 @@ Description: ultra fast JSON encoder and decoder for Python 2 (debug ext)
  UltraJSON is an ultra fast JSON encoder and decoder written in pure C with
  bindings for Python.
  .
- This package contains the debug extention for python-ujson.
+ This package contains the debug extension for python-ujson.
 
 Package: python3-ujson
 Architecture: any
@@ -36,6 +36,8 @@ Description: ultra fast JSON encoder and decoder for Python 3
  This package contains the Python 3 module of ujson.
 
 Package: python3-ujson-dbg
+Priority: extra
+Section: debug
 Architecture: any
 Depends: python3-dbg, ${misc:Depends}, ${shlibs:Depends}, python3-ujson (= ${binary:Version})
 Description: ultra fast JSON encoder and decoder for Python 3 (debug ext)
diff --git a/debian/copyright b/debian/copyright
index ba83d61..5756e92 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,6 +1,6 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: ujson
-Source: <url://example.com>
+Source: http://github.com/esnme/ultrajson
 
 Files: *
 Copyright: Copyright (c) 2011-2013, ESN Social Software AB and Jonas Tarnstrom
diff --git a/debian/patches/dont-remove-build-dir.patch b/debian/patches/dont-remove-build-dir.patch
new file mode 100644
index 0000000..0ddc5a7
--- /dev/null
+++ b/debian/patches/dont-remove-build-dir.patch
@@ -0,0 +1,16 @@
+Index: ujson/setup.py
+===================================================================
+--- ujson.orig/setup.py
++++ ujson/setup.py
+@@ -22,11 +22,6 @@ Programming Language :: Python :: 3
+ Programming Language :: Python :: 3.2
+ """.splitlines()))
+ 
+-try:
+-    shutil.rmtree("./build")
+-except(OSError):
+-    pass
+-
+ module1 = Extension('ujson',
+                     sources = ['./python/ujson.c', 
+                                './python/objToJSON.c', 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..80a6738
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+dont-remove-build-dir.patch
diff --git a/debian/rules b/debian/rules
index c21f4ce..fc2ed2a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,5 @@
 #!/usr/bin/make -f
 
-export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-
 PYTHON2=$(shell pyversions -r)
 PYTHON3=$(shell py3versions -r)
 
@@ -36,6 +34,23 @@ override_dh_installdocs:
 	dh_installdocs -ppython-ujson-dbg  --link-doc=python-ujson
 	dh_installdocs -ppython3-ujson-dbg --link-doc=python3-ujson
 	dh_installdocs
-	dh_installdocs -A README.rst
-
+	dh_installdocs README.rst
 
+override_dh_auto_test:
+ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
+	set -e; \
+	for python in $(PYTHON2); do \
+		LIB=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_platlib)") ; \
+		PYTHONPATH=$(CURDIR)/$$LIB $$python tests/tests.py ; \
+		LIB=$$($$python-dbg -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_platlib)") ; \
+		PYTHONPATH=$(CURDIR)/$$LIB $$python-dbg tests/tests.py ; \
+	done
+	2to3 --no-diffs -n --add-suffix='3' -w tests/tests.py
+	-for python in $(PYTHON3); do \
+		LIB=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_platlib)") ; \
+		PYTHONPATH=$(CURDIR)/$$LIB $$python tests/tests.py3 ; \
+		LIB=$$($$python-dbg -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_platlib)") ; \
+		PYTHONPATH=$(CURDIR)/$$LIB $$python-dbg tests/tests.py3 ; \
+	done
+	rm tests/tests.py3
+endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/ujson.git



More information about the Python-modules-commits mailing list