Source: python-stdnum Version: 1.8.1-1 Severity: wishlist Tags: patch User: [email protected] Usertags: randomness X-Debbugs-Cc: [email protected]
Hi, Whilst working on the Reproducible Builds effort [0], we noticed that python-stdnum could not be built reproducibly as it relies on a stable set ordering when generating the documentation. Patch attached. [0] https://reproducible-builds.org/ Regards, -- ,''`. : :' : Chris Lamb `. `'` [email protected] / chris-lamb.co.uk `-
--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/reproducible-build.patch 2018-01-07 08:42:33.299550983 +0000 @@ -0,0 +1,33 @@ +Description: Make the build reproducible +Author: Chris Lamb <[email protected]> +Last-Update: 2018-01-07 + +--- python-stdnum-1.8.1.orig/stdnum/eu/vat.py ++++ python-stdnum-1.8.1/stdnum/eu/vat.py +@@ -43,7 +43,7 @@ from stdnum.exceptions import * + from stdnum.util import clean, get_cc_module, get_soap_client + + +-country_codes = set([ ++_country_codes = set([ + 'at', 'be', 'bg', 'cy', 'cz', 'de', 'dk', 'ee', 'es', 'fi', 'fr', 'gb', + 'gr', 'hr', 'hu', 'ie', 'it', 'lt', 'lu', 'lv', 'mt', 'nl', 'pl', 'pt', + 'ro', 'se', 'si', 'sk', +@@ -63,7 +63,7 @@ def _get_cc_module(cc): + cc = cc.lower() + if cc == 'el': + cc = 'gr' +- if cc not in country_codes: ++ if cc not in _country_codes: + return + if cc not in _country_modules: + _country_modules[cc] = get_cc_module(cc, 'vat') +@@ -105,7 +105,7 @@ def guess_country(number): + for which it is valid. This returns lower case codes and returns gr (not + el) for Greece.""" + return [cc +- for cc in country_codes ++ for cc in _country_codes + if _get_cc_module(cc).is_valid(number)] + + --- a/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/series 2018-01-07 08:36:37.193679324 +0000 @@ -0,0 +1 @@ +reproducible-build.patch

