[Pkg-privacy-commits] [Git][pkg-privacy-team/mat2][master] 21 commits: debian/control: BD: Add python3-setuptools
Jonas Meurer
gitlab at salsa.debian.org
Thu Oct 4 22:40:38 BST 2018
Jonas Meurer pushed to branch master at Privacy Maintainers / mat2
Commits:
4989fae1 by Georg Faerber at 2018-10-03T18:14:09Z
debian/control: BD: Add python3-setuptools
- - - - -
4fc8a363 by Georg Faerber at 2018-10-03T18:14:09Z
debian/control: Vcs-*: mat2 is team-maintained by the pkg-privacy-team
- - - - -
0632fd9f by Georg Faerber at 2018-10-03T18:14:09Z
debian/control: Bump Standards-Version to 4.2.1, no changes required
- - - - -
9785b9d7 by Georg Faerber at 2018-10-03T18:14:09Z
debian/rules: Use 'pybuild' as the build system
- - - - -
ba74b02a by Georg Faerber at 2018-10-03T18:14:10Z
debian/rules: Make the build verbose
- - - - -
57e17a37 by Georg Faerber at 2018-10-03T18:14:10Z
debian/patches: Drop patches, released upstream
- - - - -
9a820184 by Georg Faerber at 2018-10-04T19:54:16Z
debian/patches: Add patch to fix tests if invoked via autopkgtest
- - - - -
0e3084b6 by Georg Faerber at 2018-10-04T19:54:51Z
debian/patches: Add patch to fix shebang, forwarded upstream
- - - - -
45f92091 by Georg Faerber at 2018-10-04T19:54:53Z
debian/control: Depends: Drop python-nautilus, see bug #907591
- - - - -
e1f06d01 by Georg Faerber at 2018-10-04T19:54:53Z
debian/mat2.install: Don't install nautilus extension for now (#907591)
- - - - -
96f9741f by Georg Faerber at 2018-10-04T19:54:53Z
debian/mat2.install: Rename mat2.py to mat2
- - - - -
0a1b87d5 by Georg Faerber at 2018-10-04T19:54:54Z
debian/mat2.manpages: Install manpage for mat2
- - - - -
6c62e793 by Georg Faerber at 2018-10-04T19:54:54Z
debian/rules: Check $DEB_BUILD_OPTIONS for 'nocheck'
- - - - -
1d1611ee by Georg Faerber at 2018-10-04T19:54:54Z
debian/control: Section: Use 'utils' instead of 'python'
- - - - -
667f7a03 by Georg Faerber at 2018-10-04T19:54:54Z
debian/control: BD: Require debhelper >= 11~
- - - - -
59c6cadd by Georg Faerber at 2018-10-04T19:54:54Z
debian/control: Depend on packages, instead of only recommending them
For a related discussion, see: https://lists.debian.org/debian-ci/2018/06/msg00016.html
- - - - -
45f95467 by Georg Faerber at 2018-10-04T19:54:54Z
debian/tests/control: Drop deprecated 'needs-recommends' restriction
For the related discussion, see https://lists.debian.org/debian-ci/2018/06/msg00016.html
- - - - -
b7f88030 by Georg Faerber at 2018-10-04T19:58:56Z
debian/tests/test-installed: Export env var to call /usr/bin/env mat2
- - - - -
60ad7c88 by Georg Faerber at 2018-10-04T19:59:02Z
debian/changelog: Debian release 0.4.0-1
- - - - -
29de691a by Jonas Meurer at 2018-10-04T21:35:48Z
Use 'pytest-3' to run testsuite by autopkgtest
- - - - -
367444e4 by Jonas Meurer at 2018-10-04T21:39:42Z
d/changelog: update for upload
- - - - -
13 changed files:
- debian/changelog
- debian/control
- debian/mat2.install
- + debian/mat2.manpages
- − debian/patches/0001-Rename-some-files-to-simplify-packaging.patch
- + debian/patches/0001-autopkgtest-fix-tests.patch
- + debian/patches/0002-fix-shebang.patch
- − debian/patches/0002-libmat2-__init__.py-Fix-path-to-env.patch
- − debian/patches/0003-libmat2-Fix-importing-packages-when-installed-in-glo.patch
- debian/patches/series
- debian/rules
- debian/tests/control
- − debian/tests/test-installed
Changes:
=====================================
debian/changelog
=====================================
@@ -1,5 +1,6 @@
-mat2 (0.1.1-1) unstable; urgency=medium
+mat2 (0.4.0-1) unstable; urgency=medium
+ [ Georg Faerber + Jonas Meurer ]
* Initial release. (Closes: #898622)
- -- Jonas Meurer <jonas at freesources.org> Fri, 18 May 2018 21:14:19 +0200
+ -- Georg Faerber <georg at riseup.net> Thu, 04 Oct 2018 23:39:09 +0200
=====================================
debian/control
=====================================
@@ -1,10 +1,10 @@
Source: mat2
-Section: python
+Section: utils
Priority: optional
Maintainer: Debian Privacy Tools Maintainers <pkg-privacy-maintainers at lists.alioth.debian.org>
Uploaders: Georg Faerber <georg at riseup.net>,
Jonas Meurer <jonas at freesources.org>,
-Build-Depends: debhelper (>= 11),
+Build-Depends: debhelper (>= 11~),
dh-exec,
dh-python,
gir1.2-gdkpixbuf-2.0,
@@ -13,21 +13,22 @@ Build-Depends: debhelper (>= 11),
python3,
python3-gi-cairo,
python3-mutagen,
-Standards-Version: 4.1.4
+ python3-setuptools,
+Standards-Version: 4.2.1
X-Python3-Version: >= 3.5
Homepage: https://0xacab.org/jvoisin/mat2
-Vcs-Git: https://salsa.debian.org/debian/mat2.git
-Vcs-Browser: https://salsa.debian.org/debian/mat2
+Vcs-Git: https://salsa.debian.org/pkg-privacy-team/mat2.git
+Vcs-Browser: https://salsa.debian.org/pkg-privacy-team/mat2
Package: mat2
Architecture: all
-Depends: ${misc:Depends}, ${python3:Depends}
-Recommends: gir1.2-gdkpixbuf-2.0,
- gir1.2-poppler-0.18,
- libimage-exiftool-perl,
- python-nautilus,
- python3-gi-cairo,
- python3-mutagen,
+Depends: gir1.2-gdkpixbuf-2.0,
+ gir1.2-poppler-0.18,
+ libimage-exiftool-perl,
+ python3-gi-cairo,
+ python3-mutagen,
+ ${misc:Depends},
+ ${python3:Depends},
Description: Metadata anonymisation toolkit v2
Metadata consist of information that characterizes data. Metadata are
used to provide documentation for data products. In essence, metadata
=====================================
debian/mat2.install
=====================================
@@ -1,3 +1,2 @@
#!/usr/bin/dh-exec
-mat2.py => /usr/bin/mat2
-nautilus/nautilus_mat2.py => /usr/share/nautilus-python/extensions/mat2.py
+mat2 => /usr/bin/mat2
=====================================
debian/mat2.manpages
=====================================
@@ -0,0 +1 @@
+doc/mat2.1
=====================================
debian/patches/0001-Rename-some-files-to-simplify-packaging.patch deleted
=====================================
@@ -1,299 +0,0 @@
-From: jvoisin <julien.voisin at dustri.org>
-Date: Fri, 18 May 2018 23:52:40 +0200
-Subject: Rename some files to simplify packaging
-
-- the `src` folder is now `libmat2`
-- the `main.py` script is now `mat2.py`
----
- .gitlab-ci.yml | 6 +++---
- README.md | 2 +-
- {src => libmat2}/__init__.py | 0
- {src => libmat2}/abstract.py | 0
- {src => libmat2}/audio.py | 0
- {src => libmat2}/harmless.py | 0
- {src => libmat2}/images.py | 0
- {src => libmat2}/office.py | 0
- {src => libmat2}/parser_factory.py | 6 +++---
- {src => libmat2}/pdf.py | 0
- {src => libmat2}/torrent.py | 0
- main.py => mat2.py | 2 +-
- tests/test_climat2.py | 44 +++++++++++++++++++-------------------
- tests/test_libmat2.py | 2 +-
- 14 files changed, 31 insertions(+), 31 deletions(-)
- rename {src => libmat2}/__init__.py (100%)
- rename {src => libmat2}/abstract.py (100%)
- rename {src => libmat2}/audio.py (100%)
- rename {src => libmat2}/harmless.py (100%)
- rename {src => libmat2}/images.py (100%)
- rename {src => libmat2}/office.py (100%)
- rename {src => libmat2}/parser_factory.py (86%)
- rename {src => libmat2}/pdf.py (100%)
- rename {src => libmat2}/torrent.py (100%)
- rename main.py => mat2.py (98%)
-
-diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
-index 90596a5..37f3b01 100644
---- a/.gitlab-ci.yml
-+++ b/.gitlab-ci.yml
-@@ -9,14 +9,14 @@ bandit:
- script:
- - apt-get -qqy update
- - apt-get -qqy install --no-install-recommends python3-bandit
-- - bandit -r ./src --format txt --skip B404,B603
-+ - bandit -r ./libmat2 --format txt --skip B404,B603
-
- pyflakes:
- stage: linting
- script:
- - apt-get -qqy update
- - apt-get -qqy install --no-install-recommends pyflakes3
-- - pyflakes3 ./src
-+ - pyflakes3 ./libmat2
-
- tests:
- stage: test
-@@ -24,4 +24,4 @@ tests:
- - apt-get -qqy update
- - apt-get -qqy install --no-install-recommends python3-mutagen python3-gi-cairo gir1.2-poppler-0.18 gir1.2-gdkpixbuf-2.0 libimage-exiftool-perl python3-coverage
- - python3-coverage run -m unittest discover -s tests/
-- - python3-coverage report -m --include 'src/*'
-+ - python3-coverage report -m --include 'libmat2/*'
-diff --git a/README.md b/README.md
-index 51f3c63..0499372 100644
---- a/README.md
-+++ b/README.md
-@@ -47,7 +47,7 @@ $ python3 -m unittest discover -v
- # Supported formats
-
- ```bash
--$ python3 ./main.py -l
-+$ python3 ./mat2.py -l
- ```
-
- # Related softwares
-diff --git a/src/__init__.py b/libmat2/__init__.py
-similarity index 100%
-rename from src/__init__.py
-rename to libmat2/__init__.py
-diff --git a/src/abstract.py b/libmat2/abstract.py
-similarity index 100%
-rename from src/abstract.py
-rename to libmat2/abstract.py
-diff --git a/src/audio.py b/libmat2/audio.py
-similarity index 100%
-rename from src/audio.py
-rename to libmat2/audio.py
-diff --git a/src/harmless.py b/libmat2/harmless.py
-similarity index 100%
-rename from src/harmless.py
-rename to libmat2/harmless.py
-diff --git a/src/images.py b/libmat2/images.py
-similarity index 100%
-rename from src/images.py
-rename to libmat2/images.py
-diff --git a/src/office.py b/libmat2/office.py
-similarity index 100%
-rename from src/office.py
-rename to libmat2/office.py
-diff --git a/src/parser_factory.py b/libmat2/parser_factory.py
-similarity index 86%
-rename from src/parser_factory.py
-rename to libmat2/parser_factory.py
-index 48616b0..dbe68b9 100644
---- a/src/parser_factory.py
-+++ b/libmat2/parser_factory.py
-@@ -10,10 +10,10 @@ from . import abstract, unsupported_extensions
- T = TypeVar('T', bound='abstract.AbstractParser')
-
- # This loads every parser in a dynamic way
--for module_loader, name, ispkg in pkgutil.walk_packages('.src'):
-- if not name.startswith('src.'):
-+for module_loader, name, ispkg in pkgutil.walk_packages('.libmat2'):
-+ if not name.startswith('libmat2.'):
- continue
-- elif name == 'src.abstract':
-+ elif name == 'libmat2.abstract':
- continue
- importlib.import_module(name)
-
-diff --git a/src/pdf.py b/libmat2/pdf.py
-similarity index 100%
-rename from src/pdf.py
-rename to libmat2/pdf.py
-diff --git a/src/torrent.py b/libmat2/torrent.py
-similarity index 100%
-rename from src/torrent.py
-rename to libmat2/torrent.py
-diff --git a/main.py b/mat2.py
-similarity index 98%
-rename from main.py
-rename to mat2.py
-index 55489be..aa213ab 100755
---- a/main.py
-+++ b/mat2.py
-@@ -8,7 +8,7 @@ import mimetypes
- import argparse
- import multiprocessing
-
--from src import parser_factory, unsupported_extensions
-+from libmat2 import parser_factory, unsupported_extensions
-
- __version__ = '0.1.1'
-
-diff --git a/tests/test_climat2.py b/tests/test_climat2.py
-index 864ee0d..36973bf 100644
---- a/tests/test_climat2.py
-+++ b/tests/test_climat2.py
-@@ -6,43 +6,43 @@ import unittest
-
- class TestHelp(unittest.TestCase):
- def test_help(self):
-- proc = subprocess.Popen(['./main.py', '--help'], stdout=subprocess.PIPE)
-+ proc = subprocess.Popen(['./mat2.py', '--help'], stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
-- self.assertIn(b'usage: main.py [-h] [-v] [-l] [-c | -s | -L] [files [files ...]]', stdout)
-+ self.assertIn(b'usage: mat2.py [-h] [-v] [-l] [-c | -s | -L] [files [files ...]]', stdout)
-
- def test_no_arg(self):
-- proc = subprocess.Popen(['./main.py'], stdout=subprocess.PIPE)
-+ proc = subprocess.Popen(['./mat2.py'], stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
-- self.assertIn(b'usage: main.py [-h] [-v] [-l] [-c | -s | -L] [files [files ...]]', stdout)
-+ self.assertIn(b'usage: mat2.py [-h] [-v] [-l] [-c | -s | -L] [files [files ...]]', stdout)
-
-
- class TestVersion(unittest.TestCase):
- def test_version(self):
-- proc = subprocess.Popen(['./main.py', '--version'], stdout=subprocess.PIPE)
-+ proc = subprocess.Popen(['./mat2.py', '--version'], stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertTrue(stdout.startswith(b'MAT2 '))
-
-
- class TestExclusiveArgs(unittest.TestCase):
- def test_version(self):
-- proc = subprocess.Popen(['./main.py', '-s', '-c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-+ proc = subprocess.Popen(['./mat2.py', '-s', '-c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = proc.communicate()
-- self.assertIn(b'main.py: error: argument -c/--check: not allowed with argument -s/--show', stderr)
-+ self.assertIn(b'mat2.py: error: argument -c/--check: not allowed with argument -s/--show', stderr)
-
-
- class TestReturnValue(unittest.TestCase):
- def test_nonzero(self):
-- ret = subprocess.call(['./main.py', './main.py'], stdout=subprocess.DEVNULL)
-+ ret = subprocess.call(['./mat2.py', './mat2.py'], stdout=subprocess.DEVNULL)
- self.assertEqual(255, ret)
-
-- ret = subprocess.call(['./main.py', '--whololo'], stderr=subprocess.DEVNULL)
-+ ret = subprocess.call(['./mat2.py', '--whololo'], stderr=subprocess.DEVNULL)
- self.assertEqual(2, ret)
-
- def test_zero(self):
-- ret = subprocess.call(['./main.py'], stdout=subprocess.DEVNULL)
-+ ret = subprocess.call(['./mat2.py'], stdout=subprocess.DEVNULL)
- self.assertEqual(0, ret)
-
-- ret = subprocess.call(['./main.py', '--show', './main.py'], stdout=subprocess.DEVNULL)
-+ ret = subprocess.call(['./mat2.py', '--show', './mat2.py'], stdout=subprocess.DEVNULL)
- self.assertEqual(0, ret)
-
-
-@@ -50,16 +50,16 @@ class TestCleanMeta(unittest.TestCase):
- def test_jpg(self):
- shutil.copy('./tests/data/dirty.jpg', './tests/data/clean.jpg')
-
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/clean.jpg'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/clean.jpg'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertIn(b'Comment: Created with GIMP', stdout)
-
-- proc = subprocess.Popen(['./main.py', './tests/data/clean.jpg'],
-+ proc = subprocess.Popen(['./mat2.py', './tests/data/clean.jpg'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
-
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/clean.cleaned.jpg'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/clean.cleaned.jpg'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertNotIn(b'Comment: Created with GIMP', stdout)
-@@ -69,25 +69,25 @@ class TestCleanMeta(unittest.TestCase):
-
- class TestGetMeta(unittest.TestCase):
- def test_pdf(self):
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.pdf'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/dirty.pdf'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertIn(b'producer: pdfTeX-1.40.14', stdout)
-
- def test_png(self):
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.png'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/dirty.png'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertIn(b'Comment: This is a comment, be careful!', stdout)
-
- def test_jpg(self):
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.jpg'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/dirty.jpg'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertIn(b'Comment: Created with GIMP', stdout)
-
- def test_docx(self):
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.docx'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/dirty.docx'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertIn(b'Application: LibreOffice/5.4.5.1$Linux_X86_64', stdout)
-@@ -95,7 +95,7 @@ class TestGetMeta(unittest.TestCase):
- self.assertIn(b'revision: 1', stdout)
-
- def test_odt(self):
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.odt'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/dirty.odt'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertIn(b'generator: LibreOffice/3.3$Unix', stdout)
-@@ -103,14 +103,14 @@ class TestGetMeta(unittest.TestCase):
- self.assertIn(b'date_time: 2011-07-26 02:40:16', stdout)
-
- def test_mp3(self):
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.mp3'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/dirty.mp3'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertIn(b'TALB: harmfull', stdout)
- self.assertIn(b'COMM::: Thank you for using MAT !', stdout)
-
- def test_flac(self):
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.flac'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/dirty.flac'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertIn(b'comments: Thank you for using MAT !', stdout)
-@@ -118,7 +118,7 @@ class TestGetMeta(unittest.TestCase):
- self.assertIn(b'title: I am so', stdout)
-
- def test_ogg(self):
-- proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.ogg'],
-+ proc = subprocess.Popen(['./mat2.py', '--show', './tests/data/dirty.ogg'],
- stdout=subprocess.PIPE)
- stdout, _ = proc.communicate()
- self.assertIn(b'comments: Thank you for using MAT !', stdout)
-diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py
-index f3e11d9..89a5811 100644
---- a/tests/test_libmat2.py
-+++ b/tests/test_libmat2.py
-@@ -6,7 +6,7 @@ import os
- import zipfile
- import tempfile
-
--from src import pdf, images, audio, office, parser_factory, torrent
-+from libmat2 import pdf, images, audio, office, parser_factory, torrent
-
-
- class TestParserFactory(unittest.TestCase):
=====================================
debian/patches/0001-autopkgtest-fix-tests.patch
=====================================
@@ -0,0 +1,194 @@
+Description: autopkgtest: fix tests
+ Some tests invoke the mat2 binary via './mat2'. This fails during
+ autopkgtest, as the software "as installed" should be tested, and
+ therefore, the 'tests' directory and the binary are not stored in the
+ same directory. The following upstream patch fixes this via
+ introducing an environment variable, which, if set, calls the binary
+ stored in '/usr/bin/'.
+
+Author: Georg Faerber <georg at riseup.net>
+Upstream: https://0xacab.org/jvoisin/mat2/issues/16#note_153878
+Last-Update: 2018-10-04
+--
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/tests/test_climat2.py
++++ b/tests/test_climat2.py
+@@ -4,16 +4,24 @@
+ import unittest
+
+
++mat2_binary = ['./mat2']
++
++if 'MAT2_GLOBAL_PATH_TESTSUITE' in os.environ:
++ # Debian runs tests after installing the package
++ # https://0xacab.org/jvoisin/mat2/issues/16#note_153878
++ mat2_binary = ['/usr/bin/env', 'mat2']
++
++
+ class TestHelp(unittest.TestCase):
+ def test_help(self):
+- proc = subprocess.Popen(['./mat2', '--help'], stdout=subprocess.PIPE)
++ proc = subprocess.Popen(mat2_binary + ['--help'], stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'usage: mat2 [-h] [-v] [-l] [--check-dependencies] [-V]',
+ stdout)
+ self.assertIn(b'[--unknown-members policy] [-s | -L]', stdout)
+
+ def test_no_arg(self):
+- proc = subprocess.Popen(['./mat2'], stdout=subprocess.PIPE)
++ proc = subprocess.Popen(mat2_binary, stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'usage: mat2 [-h] [-v] [-l] [--check-dependencies] [-V]',
+ stdout)
+@@ -22,29 +30,29 @@
+
+ class TestVersion(unittest.TestCase):
+ def test_version(self):
+- proc = subprocess.Popen(['./mat2', '--version'], stdout=subprocess.PIPE)
++ proc = subprocess.Popen(mat2_binary + ['--version'], stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertTrue(stdout.startswith(b'MAT2 '))
+
+ class TestDependencies(unittest.TestCase):
+ def test_dependencies(self):
+- proc = subprocess.Popen(['./mat2', '--check-dependencies'], stdout=subprocess.PIPE)
++ proc = subprocess.Popen(mat2_binary + ['--check-dependencies'], stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertTrue(b'MAT2' in stdout)
+
+ class TestReturnValue(unittest.TestCase):
+ def test_nonzero(self):
+- ret = subprocess.call(['./mat2', './mat2'], stdout=subprocess.DEVNULL)
++ ret = subprocess.call(mat2_binary + ['mat2'], stdout=subprocess.DEVNULL)
+ self.assertEqual(255, ret)
+
+- ret = subprocess.call(['./mat2', '--whololo'], stderr=subprocess.DEVNULL)
++ ret = subprocess.call(mat2_binary + ['--whololo'], stderr=subprocess.DEVNULL)
+ self.assertEqual(2, ret)
+
+ def test_zero(self):
+- ret = subprocess.call(['./mat2'], stdout=subprocess.DEVNULL)
++ ret = subprocess.call(mat2_binary, stdout=subprocess.DEVNULL)
+ self.assertEqual(0, ret)
+
+- ret = subprocess.call(['./mat2', '--show', './mat2'], stdout=subprocess.DEVNULL)
++ ret = subprocess.call(mat2_binary + ['--show', 'mat2'], stdout=subprocess.DEVNULL)
+ self.assertEqual(0, ret)
+
+
+@@ -57,19 +65,19 @@
+ shutil.copy('./tests/data/dirty.jpg', './tests/data/folder/clean1.jpg')
+ shutil.copy('./tests/data/dirty.jpg', './tests/data/folder/clean2.jpg')
+
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/folder/'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/folder/'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'Comment: Created with GIMP', stdout)
+
+- proc = subprocess.Popen(['./mat2', './tests/data/folder/'],
++ proc = subprocess.Popen(mat2_binary + ['./tests/data/folder/'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+
+ os.remove('./tests/data/folder/clean1.jpg')
+ os.remove('./tests/data/folder/clean2.jpg')
+
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/folder/'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/folder/'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertNotIn(b'Comment: Created with GIMP', stdout)
+@@ -81,16 +89,16 @@
+ def test_jpg(self):
+ shutil.copy('./tests/data/dirty.jpg', './tests/data/clean.jpg')
+
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/clean.jpg'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/clean.jpg'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'Comment: Created with GIMP', stdout)
+
+- proc = subprocess.Popen(['./mat2', './tests/data/clean.jpg'],
++ proc = subprocess.Popen(mat2_binary + ['./tests/data/clean.jpg'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/clean.cleaned.jpg'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/clean.cleaned.jpg'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertNotIn(b'Comment: Created with GIMP', stdout)
+@@ -100,32 +108,32 @@
+
+ class TestIsSupported(unittest.TestCase):
+ def test_pdf(self):
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/dirty.pdf'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/dirty.pdf'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertNotIn(b"isn't supported", stdout)
+
+ class TestGetMeta(unittest.TestCase):
+ def test_pdf(self):
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/dirty.pdf'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/dirty.pdf'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'producer: pdfTeX-1.40.14', stdout)
+
+ def test_png(self):
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/dirty.png'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/dirty.png'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'Comment: This is a comment, be careful!', stdout)
+
+ def test_jpg(self):
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/dirty.jpg'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/dirty.jpg'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'Comment: Created with GIMP', stdout)
+
+ def test_docx(self):
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/dirty.docx'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/dirty.docx'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'Application: LibreOffice/5.4.5.1$Linux_X86_64', stdout)
+@@ -133,7 +141,7 @@
+ self.assertIn(b'revision: 1', stdout)
+
+ def test_odt(self):
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/dirty.odt'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/dirty.odt'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'generator: LibreOffice/3.3$Unix', stdout)
+@@ -141,14 +149,14 @@
+ self.assertIn(b'date_time: 2011-07-26 02:40:16', stdout)
+
+ def test_mp3(self):
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/dirty.mp3'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/dirty.mp3'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'TALB: harmfull', stdout)
+ self.assertIn(b'COMM::: Thank you for using MAT !', stdout)
+
+ def test_flac(self):
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/dirty.flac'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/dirty.flac'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'comments: Thank you for using MAT !', stdout)
+@@ -156,7 +164,7 @@
+ self.assertIn(b'title: I am so', stdout)
+
+ def test_ogg(self):
+- proc = subprocess.Popen(['./mat2', '--show', './tests/data/dirty.ogg'],
++ proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/dirty.ogg'],
+ stdout=subprocess.PIPE)
+ stdout, _ = proc.communicate()
+ self.assertIn(b'comments: Thank you for using MAT !', stdout)
=====================================
debian/patches/0002-fix-shebang.patch
=====================================
@@ -0,0 +1,14 @@
+Description: fix shebang
+Author: Georg Faerber <georg at riseup.net>
+Forwarded: https://0xacab.org/jvoisin/mat2/merge_requests/19
+Last-Update: 2018-10-03
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/libmat2/__init__.py
++++ b/libmat2/__init__.py
+@@ -1,4 +1,4 @@
+-#!/bin/env python3
++#!/usr/bin/env python3
+
+ import os
+ import collections
=====================================
debian/patches/0002-libmat2-__init__.py-Fix-path-to-env.patch deleted
=====================================
@@ -1,18 +0,0 @@
-From: Jonas Meurer <jonas at freesources.org>
-Date: Sat, 19 May 2018 17:08:59 +0200
-Subject: libmat2/__init__.py: Fix path to env
-
----
- libmat2/__init__.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/libmat2/__init__.py b/libmat2/__init__.py
-index 07d3036..d660e90 100644
---- a/libmat2/__init__.py
-+++ b/libmat2/__init__.py
-@@ -1,4 +1,4 @@
--#!/bin/env python3
-+#!/usr/bin/env python3
-
- # A set of extension that aren't supported, despite matching a supported mimetype
- unsupported_extensions = set(['bat', 'c', 'h', 'ksh', 'pl', 'txt', 'asc',
=====================================
debian/patches/0003-libmat2-Fix-importing-packages-when-installed-in-glo.patch deleted
=====================================
@@ -1,150 +0,0 @@
-From: Jonas Meurer <jonas at freesources.org>
-Date: Sun, 20 May 2018 20:16:36 +0200
-Subject: libmat2/*: Fix importing packages when installed in global python3
- path
-
----
- libmat2/audio.py | 4 ++--
- libmat2/harmless.py | 4 ++--
- libmat2/images.py | 6 +++---
- libmat2/office.py | 5 +++--
- libmat2/parser_factory.py | 7 ++++---
- libmat2/pdf.py | 4 ++--
- libmat2/torrent.py | 4 ++--
- 7 files changed, 18 insertions(+), 16 deletions(-)
-
-diff --git a/libmat2/audio.py b/libmat2/audio.py
-index 3a6aa79..d64cb73 100644
---- a/libmat2/audio.py
-+++ b/libmat2/audio.py
-@@ -2,10 +2,10 @@ import shutil
-
- import mutagen
-
--from . import abstract
-+import libmat2.abstract
-
-
--class MutagenParser(abstract.AbstractParser):
-+class MutagenParser(libmat2.abstract.AbstractParser):
- def get_meta(self):
- f = mutagen.File(self.filename)
- if f.tags:
-diff --git a/libmat2/harmless.py b/libmat2/harmless.py
-index aa00582..fcf20cc 100644
---- a/libmat2/harmless.py
-+++ b/libmat2/harmless.py
-@@ -1,7 +1,7 @@
--from . import abstract
-+import libmat2.abstract
-
-
--class HarmlessParser(abstract.AbstractParser):
-+class HarmlessParser(libmat2.abstract.AbstractParser):
- """ This is the parser for filetypes that do not contain metadata. """
- mimetypes = {'application/xml', 'text/plain'}
-
-diff --git a/libmat2/images.py b/libmat2/images.py
-index c84952a..8c172f0 100644
---- a/libmat2/images.py
-+++ b/libmat2/images.py
-@@ -8,10 +8,10 @@ import gi
- gi.require_version('GdkPixbuf', '2.0')
- from gi.repository import GdkPixbuf
-
--from . import abstract
-+import libmat2.abstract
-
-
--class PNGParser(abstract.AbstractParser):
-+class PNGParser(libmat2.abstract.AbstractParser):
- mimetypes = {'image/png', }
- meta_whitelist = {'SourceFile', 'ExifToolVersion', 'FileName',
- 'Directory', 'FileSize', 'FileModifyDate',
-@@ -41,7 +41,7 @@ class PNGParser(abstract.AbstractParser):
- return True
-
-
--class GdkPixbufAbstractParser(abstract.AbstractParser):
-+class GdkPixbufAbstractParser(libmat2.abstract.AbstractParser):
- """ GdkPixbuf can handle a lot of surfaces, so we're rending images on it,
- this has the side-effect of removing metadata completely.
- """
-diff --git a/libmat2/office.py b/libmat2/office.py
-index 749fc7d..1b2a221 100644
---- a/libmat2/office.py
-+++ b/libmat2/office.py
-@@ -5,10 +5,11 @@ import tempfile
- import datetime
- import zipfile
-
--from . import abstract, parser_factory
-+import libmat2.abstract
-+from . import parser_factory
-
-
--class ArchiveBasedAbstractParser(abstract.AbstractParser):
-+class ArchiveBasedAbstractParser(libmat2.abstract.AbstractParser):
- def _clean_zipinfo(self, zipinfo: zipfile.ZipInfo) -> zipfile.ZipInfo:
- zipinfo.compress_type = zipfile.ZIP_DEFLATED
- zipinfo.create_system = 3 # Linux
-diff --git a/libmat2/parser_factory.py b/libmat2/parser_factory.py
-index dbe68b9..3068ab4 100644
---- a/libmat2/parser_factory.py
-+++ b/libmat2/parser_factory.py
-@@ -4,10 +4,11 @@ import importlib
- import pkgutil
- from typing import TypeVar
-
--from . import abstract, unsupported_extensions
-+import libmat2.abstract
-+from . import unsupported_extensions
-
-
--T = TypeVar('T', bound='abstract.AbstractParser')
-+T = TypeVar('T', bound='libmat2.abstract.AbstractParser')
-
- # This loads every parser in a dynamic way
- for module_loader, name, ispkg in pkgutil.walk_packages('.libmat2'):
-@@ -23,7 +24,7 @@ def _get_parsers() -> list:
- def __get_parsers(cls):
- return cls.__subclasses__() + \
- [g for s in cls.__subclasses__() for g in __get_parsers(s)]
-- return __get_parsers(abstract.AbstractParser)
-+ return __get_parsers(libmat2.abstract.AbstractParser)
-
-
- def get_parser(filename: str) -> (T, str):
-diff --git a/libmat2/pdf.py b/libmat2/pdf.py
-index 5b99192..54c420f 100644
---- a/libmat2/pdf.py
-+++ b/libmat2/pdf.py
-@@ -13,12 +13,12 @@ import gi
- gi.require_version('Poppler', '0.18')
- from gi.repository import Poppler, GLib
-
--from . import abstract
-+import libmat2.abstract
-
- logging.basicConfig(level=logging.DEBUG)
-
-
--class PDFParser(abstract.AbstractParser):
-+class PDFParser(libmat2.abstract.AbstractParser):
- mimetypes = {'application/pdf', }
- meta_list = {'author', 'creation-date', 'creator', 'format', 'keywords',
- 'metadata', 'mod-date', 'producer', 'subject', 'title',
-diff --git a/libmat2/torrent.py b/libmat2/torrent.py
-index cb4b5e3..90cd421 100644
---- a/libmat2/torrent.py
-+++ b/libmat2/torrent.py
-@@ -1,7 +1,7 @@
--from . import abstract
-+import libmat2.abstract
-
-
--class TorrentParser(abstract.AbstractParser):
-+class TorrentParser(libmat2.abstract.AbstractParser):
- mimetypes = {'application/x-bittorrent', }
- whitelist = {b'announce', b'announce-list', b'info'}
-
=====================================
debian/patches/series
=====================================
@@ -1,3 +1,2 @@
-0001-Rename-some-files-to-simplify-packaging.patch
-0002-libmat2-__init__.py-Fix-path-to-env.patch
-0003-libmat2-Fix-importing-packages-when-installed-in-glo.patch
+0002-fix-shebang.patch
+0001-autopkgtest-fix-tests.patch
=====================================
debian/rules
=====================================
@@ -1,8 +1,11 @@
#!/usr/bin/make -f
+export DH_VERBOSE=1
+
%:
- dh $@ --with python3
+ dh $@ --with python3 --buildsystem=pybuild
override_dh_auto_test:
- python3 -m unittest discover
- dh_auto_test
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ python3 -m unittest discover -v
+endif
=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
-Tests: test-installed
-Depends: @
-Restrictions: allow-stderr, needs-recommends
+Test-Command: pytest-3
+Depends: @,
+ python3-pytest
=====================================
debian/tests/test-installed deleted
=====================================
@@ -1,10 +0,0 @@
-#!/bin/sh
-# autopkgtest check: Run MAT2 testsuite with installed version outside of
-# source tree
-set -e
-
-WORKDIR=$(mktemp -d)
-cp -prv test/* $WORKDIR
-trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
-cd $WORKDIR
-python3 -m unittest discover -v
View it on GitLab: https://salsa.debian.org/pkg-privacy-team/mat2/compare/5a6382c701004e45f5985511158481311377c5df...367444e47db56a34c10307f07b94f832dc8b4470
--
View it on GitLab: https://salsa.debian.org/pkg-privacy-team/mat2/compare/5a6382c701004e45f5985511158481311377c5df...367444e47db56a34c10307f07b94f832dc8b4470
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-privacy-commits/attachments/20181004/d58db08b/attachment-0001.html>
More information about the Pkg-privacy-commits
mailing list