File: setup.py

package info (click to toggle)
pyrex 0.9.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,556 kB
  • ctags: 2,601
  • sloc: python: 12,966; ansic: 3,092; makefile: 106; sh: 20; lisp: 12
file content (48 lines) | stat: -rw-r--r-- 1,392 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
#   Pyrex setup file
#

import distutils
from distutils.core import setup
from distutils.sysconfig import get_python_lib
import os, sys
execfile(distutils.util.convert_path('Pyrex/Compiler/Version.py'))

compiler_dir = os.path.join(get_python_lib(prefix=''), 'Pyrex', 'Compiler')

# Workaround for problem with distutils wininst
if sys.platform == "win32" and 'bdist_wininst' in sys.argv:
 compiler_dir = compiler_dir[len(sys.prefix)+1:]


def packages():
    result = []
    def find_packages(dir, parent_names):
        for name in os.listdir(dir):
            subdir = os.path.join(dir, name)
            if os.path.isdir(subdir) and os.path.exists(os.path.join(subdir, "__init__.py")):
                pkg_names = parent_names + [name]
                result.append(".".join(pkg_names))
                find_packages(subdir, pkg_names)
    source_dir = os.path.dirname(__file__) or os.curdir
    find_packages(source_dir, [])
    return result

def scripts():
    if os.name == "posix":
        return ["bin/pyrexc"]
    else:
        return ["pyrexc.py"]

setup(
    name = 'Pyrex', 
    version = version,
    url = 'http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/',
    author = 'Greg Ewing',
    author_email = 'greg.ewing@canterbury.ac.nz',
    scripts = scripts(),
    packages = packages(),
    data_files=[
        (compiler_dir, ['Pyrex/Compiler/Lexicon.pickle'])
    ]
)