~mitya57/ubuntu/trusty/dh-python/tests-dependencies

« back to all changes in this revision

Viewing changes to dhpython/__init__.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2013-07-07 21:47:50 UTC
  • Revision ID: package-import@ubuntu.com-20130707214750-d6wmodmuzp78kt75
Tags: upstream-1.0~b1
Import upstream version 1.0~b1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright © 2010-2013 Piotr Ożarowski <piotr@debian.org>
 
2
#
 
3
# Permission is hereby granted, free of charge, to any person obtaining a copy
 
4
# of this software and associated documentation files (the "Software"), to deal
 
5
# in the Software without restriction, including without limitation the rights
 
6
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
7
# copies of the Software, and to permit persons to whom the Software is
 
8
# furnished to do so, subject to the following conditions:
 
9
#
 
10
# The above copyright notice and this permission notice shall be included in
 
11
# all copies or substantial portions of the Software.
 
12
#
 
13
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
14
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
15
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
16
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
17
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
18
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
19
# THE SOFTWARE.
 
20
 
 
21
import re
 
22
 
 
23
PKG_PREFIX_MAP = {'cpython2': 'python',
 
24
                  'cpython3': 'python3',
 
25
                  'pypy': 'pypy'}
 
26
 
 
27
# minimum version required for compile/clean scripts:
 
28
MINPYCDEP = {'cpython2': 'python (>= 2.6.6-3)',
 
29
             'cpython3': 'python3 (>= 3.2.3-3~)',
 
30
             'pypy': 'pypy'}
 
31
 
 
32
PUBLIC_DIR_RE = {
 
33
    'cpython2': re.compile(r'.*?/usr/lib/python(2\.\d)(?:/|$)'),
 
34
    'cpython3': re.compile(r'.*?/usr/lib/python(3(?:\.\d+)?)(?:/|$)'),
 
35
    'pypy': re.compile(r'.*?/usr/lib/pypy(?:/|$)')}
 
36
 
 
37
INTERPRETER_DIR_TPLS = {
 
38
    'cpython2': r'.*/python2\.\d/',
 
39
    'cpython3': r'.*/python3(?:\.\d+)?/',
 
40
    'pypy': r'.*/pypy/'}
 
41
 
 
42
# Interpreter site-directories
 
43
OLD_SITE_DIRS = {
 
44
    'cpython2': [
 
45
        '/usr/local/lib/python{}/site-packages',
 
46
        '/usr/local/lib/python{}/dist-packages',
 
47
        '/var/lib/python-support/python{}',
 
48
        '/usr/lib/pymodules/python{}',
 
49
        lambda version: '/usr/lib/python{}/site-packages'.format(version)
 
50
                        if version >= '2.6' else None],
 
51
    'cpython3': [
 
52
        '/usr/local/lib/python{}/site-packages',
 
53
        '/usr/local/lib/python{}/dist-packages',
 
54
        '/usr/lib/python{}/site-packages',
 
55
        '/usr/lib/python{}/dist-packages',
 
56
        '/var/lib/python-support/python{}',
 
57
        '/usr/lib/pymodules/python{}'],
 
58
    'pypy': [
 
59
        '/usr/local/lib/pypy/site-packages',
 
60
        '/usr/local/lib/pypy/dist-packages',
 
61
        '/usr/lib/pypy/site-packages']}
 
62
 
 
63
# PyDist related
 
64
PYDIST_DIRS = {
 
65
    'cpython2': '/usr/share/python/dist/',
 
66
    'cpython3': '/usr/share/python3/dist/',
 
67
    'pypy': '/usr/share/pypy/dist/'}
 
68
 
 
69
PYDIST_OVERRIDES_FNAMES = {
 
70
    'cpython2': 'debian/pydist-overrides',
 
71
    'cpython3': 'debian/py3dist-overrides',
 
72
    'pypy': 'debian/pypydist-overrides'}
 
73
 
 
74
PYDIST_DPKG_SEARCH_TPLS = {
 
75
    'cpython2': "*/%s-?*\.egg-info | grep '/python2\../\|/pyshared/'",
 
76
    'cpython3': '*python3/*/{}-?*\.egg-info',
 
77
    'pypy': '*pypy/*/{}-?\.egg-info'}
 
78
 
 
79
# DebHelper related
 
80
PKG_NAME_TPLS = {
 
81
    'cpython2': ('python-', 'python2.'),
 
82
    'cpython3': ('python3-', 'python3.'),
 
83
    'pypy': ('pypy-',)
 
84
}
 
85
RT_LOCATIONS = {
 
86
    'cpython2': '/usr/share/python/runtime.d/',
 
87
    'cpython3': '/usr/share/python3/runtime.d/',
 
88
    'pypy': '/usr/share/pypy/runtime.d/',
 
89
}
 
90
RT_TPLS = {
 
91
    'cpython2': '''
 
92
if [ "$1" = rtupdate ]; then
 
93
\tpyclean {pkg_arg} {dname}
 
94
\tpycompile {pkg_arg} {args} {dname}
 
95
fi''',
 
96
    'cpython3': '''
 
97
if [ "$1" = rtupdate ]; then
 
98
\tpy3clean {pkg_arg} {dname}
 
99
\tpy3compile {pkg_arg} {args} {dname}
 
100
fi''',
 
101
    'pypy': ''
 
102
}