diff options
author | Ask Solem <askh@modwheel.net> | 2009-03-17 12:27:02 +0100 |
---|---|---|
committer | Ask Solem Hoel <askh@opera.com> | 2009-03-17 12:27:02 +0100 |
commit | 7000a3e5791804ceb4cc56a17235c029465a5d9f (patch) | |
tree | ee097b25c86b9f3be3e03e021b84b5b3a49dec23 | |
parent | cbc7295f2ee4b1a6a4c491d8690e1f213abd57fb (diff) | |
download | chishop-7000a3e5791804ceb4cc56a17235c029465a5d9f.tar.bz2 chishop-7000a3e5791804ceb4cc56a17235c029465a5d9f.tar.xz chishop-7000a3e5791804ceb4cc56a17235c029465a5d9f.zip |
Made chishop/media a python package so it's incldued in the repo.
-rw-r--r-- | chishop/media/__init__.py | 0 | ||||
-rw-r--r-- | chishop/media/dists/__init__.py | 0 | ||||
-rw-r--r-- | setup.py | 55 |
3 files changed, 53 insertions, 2 deletions
diff --git a/chishop/media/__init__.py b/chishop/media/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/chishop/media/__init__.py | |||
diff --git a/chishop/media/dists/__init__.py b/chishop/media/dists/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/chishop/media/dists/__init__.py | |||
@@ -10,13 +10,64 @@ except ImportError: | |||
10 | use_setuptools() | 10 | use_setuptools() |
11 | from setuptools import setup, find_packages | 11 | from setuptools import setup, find_packages |
12 | 12 | ||
13 | from distutils.command.install_data import install_data | ||
14 | from distutils.command.install import INSTALL_SCHEMES | ||
15 | import sys | ||
16 | |||
17 | djangopypi = __import__('djangopypi', {}, {}, ['']) | ||
18 | |||
19 | packages, data_files = [], [] | ||
20 | root_dir = os.path.dirname(__file__) | ||
21 | if root_dir != '': | ||
22 | os.chdir(root_dir) | ||
23 | djangopypi_dir = "djangopypi" | ||
24 | |||
25 | def osx_install_data(install_data): | ||
26 | def finalize_options(self): | ||
27 | self.set_undefined_options("install", ("install_lib", "install_dir")) | ||
28 | install_data.finalize_options(self) | ||
29 | |||
30 | #if sys.platform == "darwin": | ||
31 | # cmdclasses = {'install_data': osx_install_data} | ||
32 | #else: | ||
33 | # cmdclasses = {'install_data': install_data} | ||
34 | |||
35 | |||
36 | def fullsplit(path, result=None): | ||
37 | if result is None: | ||
38 | result = [] | ||
39 | head, tail = os.path.split(path) | ||
40 | if head == '': | ||
41 | return [tail] + result | ||
42 | if head == path: | ||
43 | return result | ||
44 | return fullsplit(head, [tail] + result) | ||
45 | |||
46 | |||
47 | for scheme in INSTALL_SCHEMES.values(): | ||
48 | scheme['data'] = scheme['purelib'] | ||
49 | |||
50 | |||
51 | for dirpath, dirnames, filenames in os.walk(djangopypi_dir): | ||
52 | # Ignore dirnames that start with '.' | ||
53 | for i, dirname in enumerate(dirnames): | ||
54 | if dirname.startswith("."): del dirnames[i] | ||
55 | for filename in filenames: | ||
56 | if filename.endswith(".py"): | ||
57 | packages.append('.'.join(fullsplit(dirpath))) | ||
58 | else: | ||
59 | data_files.append([dirpath, [os.path.join(dirpath, f) for f in | ||
60 | filenames]]) | ||
13 | setup( | 61 | setup( |
14 | name='chishop', | 62 | name='chishop', |
15 | version=__import__('djangopypi').__version__, | 63 | version=djangopypi.__version__, |
16 | description='Simple PyPI server written in Django.', | 64 | description='Simple PyPI server written in Django.', |
17 | author='Ask Solem', | 65 | author='Ask Solem', |
18 | author_email='askh@opera.com', | 66 | author_email='askh@opera.com', |
19 | packages=["djangopypi"], | 67 | packages=packages, |
68 | url="http://ask.github.com/chishop", | ||
69 | zip_safe=False, | ||
70 | data_files=data_files, | ||
20 | install_requires=[ | 71 | install_requires=[ |
21 | 'django>=1.0', | 72 | 'django>=1.0', |
22 | ], | 73 | ], |