[Reproducible-builds] Bug#796196: strip .py suffix from diffoscope within sources repo as well)
On Thu, Aug 20, 2015 at 07:59:50AM -0400, Yaroslav Halchenko wrote: On Thu, 20 Aug 2015, Mattia Rizzolo wrote: ignore the patch I have submitted (done in a rush, incorrect). But what about the idea in general? Umh, but why? Shipped package does not have .py. Also, why should we move the script to an another directory? (and then we would need to set PYTHONPATH to be able to do anything…) Can you elaborate on your rationale? Sure! 1. debian policy on not having suffix is not really Debian-specific -- it is a general recommendation. In your case diffoscope as utility could later be rewritten in some other language etc, which would then reflect itself in changing the suffix That thing relates to the installed binary, and indeed we do not have a suffix in the /usr/bin/diffoscope file name. The git repository is something for the development, and the development of diffoscope depends on the current implementation. 2. There is now a dichotomy between how diffoscope should be executed as installed from debian package (without suffix) and then if someone installs it using setup.py (with the suffix) or just reading your documentation (e.g. README) This to my experience is normal development. stuff in a VCS tends to be a bit different than installed one. The README tells about how to use it out of the vcs clone. I do appreciate though the fact that with such a change and relocation setting of PYTHONPATH is necessary if someone wants to invoke diffoscope without e.g. 'python setup.py develop' (ideally within a virtualenv). Within fail2ban we even made some ugly workaround for such invocations, e.g. if os.path.exists(diffoscope/__init__.py): sys.path.insert(0, .) so someone could invoke directly within source code-base. This is currently really possible and easy to do, just `./diffoscope.py ...`. Alternative to all of the above could be moving that script entirely under diffoscope/ module codebase and just establishing entry points with setuptools' setup() call. E.g. how we do in e.g. datalad https://github.com/datalad/datalad/blob/master/setup.py#L30 which would then allow you to craft a test to verify functionality of the code in the script. The current structure seems really sensible and sane to me, while I wouldn't understand having the program entry point inside the module. Anyways -- decision is yours to make ;) To me your proposals makes really little sense. But let's wait for the main developer to show up :) -- regards, Mattia Rizzolo GPG Key: 66AE 2B4A FCCF 3F52 DA18 4D18 4B04 3FCD B944 4540 .''`. more about me: http://mapreri.org : :' : Launchpad user: https://launchpad.net/~mapreri `. `'` Debian QA page: https://qa.debian.org/developer.php?login=mattia `- signature.asc Description: Digital signature ___ Reproducible-builds mailing list Reproducible-builds@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds
[Reproducible-builds] Bug#796196: strip .py suffix from diffoscope within sources repo as well)
On Thu, 20 Aug 2015, Mattia Rizzolo wrote: ignore the patch I have submitted (done in a rush, incorrect). But what about the idea in general? Umh, but why? Shipped package does not have .py. Also, why should we move the script to an another directory? (and then we would need to set PYTHONPATH to be able to do anything…) Can you elaborate on your rationale? Sure! 1. debian policy on not having suffix is not really Debian-specific -- it is a general recommendation. In your case diffoscope as utility could later be rewritten in some other language etc, which would then reflect itself in changing the suffix 2. There is now a dichotomy between how diffoscope should be executed as installed from debian package (without suffix) and then if someone installs it using setup.py (with the suffix) or just reading your documentation (e.g. README) I do appreciate though the fact that with such a change and relocation setting of PYTHONPATH is necessary if someone wants to invoke diffoscope without e.g. 'python setup.py develop' (ideally within a virtualenv). Within fail2ban we even made some ugly workaround for such invocations, e.g. if os.path.exists(diffoscope/__init__.py): sys.path.insert(0, .) so someone could invoke directly within source code-base. Alternative to all of the above could be moving that script entirely under diffoscope/ module codebase and just establishing entry points with setuptools' setup() call. E.g. how we do in e.g. datalad https://github.com/datalad/datalad/blob/master/setup.py#L30 which would then allow you to craft a test to verify functionality of the code in the script. Anyways -- decision is yours to make ;) Cheers, -- Yaroslav O. Halchenko, Ph.D. http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org Research Scientist,Psychological and Brain Sciences Dept. Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755 Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419 WWW: http://www.linkedin.com/in/yarik ___ Reproducible-builds mailing list Reproducible-builds@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds
[Reproducible-builds] Bug#796196: strip .py suffix from diffoscope within sources repo as well
Package: diffoscope Version: 30 Severity: wishlist Tags: upstream patch For various reasons there should be no .py in diffoscope shipped within the source VCS (let me know if I need to elaborate). Attahed is the patch which should accomplish the mission I guess -- System Information: Debian Release: stretch/sid APT prefers testing APT policy: (900, 'testing'), (600, 'unstable'), (300, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.17-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages diffoscope depends on: ii python 2.7.9-1 ii python-debian0.1.27 ii python-libarchive-c 2.1-1 ii python-magic 1:5.22+15-2 ii python-rpm 4.12.0.1+dfsg1-3 ii python-ssdeep3.1+dfsg-1 pn python:any none Versions of packages diffoscope recommends: ii acl 2.2.52-2 ii binutils-multiarch2.25.1-1 ii bzip2 1.0.6-8 ii cpio 2.11+dfsg-4.1 ii default-jdk [java-sdk]2:1.7-52 ii fontforge-extras 0.3-4 ii genisoimage 9:1.1.11-3 ii gettext 0.19.4-1 ii ghc 7.8.4-9 ii gnupg 1.4.19-3 ii mono-utils3.2.8+dfsg-10 ii openjdk-7-jdk [java-sdk] 7u75-2.5.4-2 ii pdftk 2.02-3 ii poppler-utils 0.26.5-2 ii rpm2cpio 4.12.0.1+dfsg1-3 ii sng 1.0.6-2 ii sqlite3 3.8.11.1-1 ii squashfs-tools1:4.2+20130409-2.1 ii unzip 6.0-17 ii vim-common2:7.4.712-3 ii xz-utils 5.1.1alpha+20120614-2.1 diffoscope suggests no packages. -- no debconf information From 13a9076393bddbc9689069a0ff1dd6803691bf0c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko deb...@onerussian.com Date: Thu, 20 Aug 2015 10:49:45 +0200 Subject: [PATCH] RF: diffoscope.py - diffoscope (implementation language is irrelevant) --- README | 4 +- debian/rules | 6 +-- diffoscope.py| 118 --- diffoscope/diffoscope.py | 118 +++ setup.py | 2 +- 5 files changed, 122 insertions(+), 126 deletions(-) delete mode 100755 diffoscope.py create mode 100755 diffoscope/diffoscope.py mode change 100644 = 100755 setup.py diff --git a/README b/README index c08d152..7bad538 100644 --- a/README +++ b/README @@ -24,7 +24,7 @@ debbindiff. Example --- -$ ./diffoscope.py --html output.html build1.changes build2.changes +$ ./diffoscope --html output.html build1.changes build2.changes This will compare `build1.changes` and `build2.changes` and create `output.html` if there are differences between the two files. @@ -35,7 +35,7 @@ External dependencies The various comparators rely on external commands being available. To get a list of them, please run: -$ ./diffoscope.py --list-tools +$ ./diffoscope --list-tools Contributors diff --git a/debian/rules b/debian/rules index 78ea5ce..8236beb 100755 --- a/debian/rules +++ b/debian/rules @@ -13,14 +13,10 @@ override_dh_auto_build: dh_auto_build -O--buildsystem=pybuild override_dh_gencontrol: - echo diffoscope:Recommends=$$(./diffoscope.py --list-tools | tail -n 1 | \ + echo diffoscope:Recommends=$$(./diffoscope --list-tools | tail -n 1 | \ sed -e 's/\(^\| \)\(coreutils\|diffutils\|e2fsprogs\|findutils\|gzip\)\(,\|$$\)//g') debian/diffoscope.substvars dh_gencontrol -O--buildsystem=pybuild -override_dh_install: - dh_install -O--buildsystem=pybuild - mv debian/diffoscope/usr/bin/diffoscope.py debian/diffoscope/usr/bin/diffoscope - debian/diffoscope.1: debian/diffoscope.1.rst rst2man $ $@ diff --git a/diffoscope.py b/diffoscope.py deleted file mode 100755 index a1a8ccc..000 --- a/diffoscope.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# diffoscope: in-depth comparison of files, archives, and directories -# -# Copyright © 2014-2015 Jérémy Bobbio lu...@debian.org -# -# diffoscope is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# diffoscope is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with diffoscope. If not, see http://www.gnu.org/licenses/. - -from __future__ import print_function -