Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 65 lines (55 sloc) 1.626 kb
671c65e @exhuma Initial incomplete version
authored
1 from setuptools import setup, find_packages
f8ae940 @exhuma Clarified/simplified install documentation
authored
2 from setuptools.command.install import install
3 from os.path import join
4 from sys import prefix
5 import os
671c65e @exhuma Initial incomplete version
authored
6
7 PACKAGE = "mypi"
8 NAME = "mypi"
9 DESCRIPTION = "Private Python Package Index"
10 AUTHOR = "Michel Albert"
11 AUTHOR_EMAIL = "michel@albert.lu"
12 VERSION = __import__(PACKAGE).__version__
13
f8ae940 @exhuma Clarified/simplified install documentation
authored
14 def get_data_files(root, prefix=None) :
15 """
16 Returns a list readily formed for the ``data_files`` parameter in
17 ``setup``.
18
19 prefix
20 prefix all target folders with this value
21 """
22 out = []
23 for path, dirs, files in os.walk('db_repo'):
24
25 if prefix:
26 tgt_path = join(prefix, path)
27 else:
28 tgt_path = path
29
30 out.append((tgt_path, [join(path, _) for _ in files]))
31 return out
32
33 db_repo_files = get_data_files('db_repo', prefix=join(prefix,
34 'usr/share/docs/mypi'))
35
36 class MypiInstall(install):
37 def run(self):
38 install.run(self)
39 # TODO: ask the user for WSGI and DB settings
40 pass
41
671c65e @exhuma Initial incomplete version
authored
42 setup(
43 name=NAME,
44 version=VERSION,
45 description=DESCRIPTION,
46 long_description=open("README.rst").read(),
47 author=AUTHOR,
48 author_email=AUTHOR_EMAIL,
49 license="GPL",
9610d37 @exhuma Added the templates to the distributed package
authored
50 include_package_data=True,
671c65e @exhuma Initial incomplete version
authored
51 install_requires = [
52 'Flask==0.8',
a50bfee @exhuma Preliminary DB added with support to register releases.
authored
53 'sqlalchemy-migrate==0.7.2',
54 'SQLAlchemy==0.7.3'
671c65e @exhuma Initial incomplete version
authored
55 ],
56 packages=find_packages(exclude=["tests.*", "tests"]),
f8ae940 @exhuma Clarified/simplified install documentation
authored
57 data_files=[
58 (join(prefix,'usr/share/docs/mypi/examples'),
59 ['mod_wsgi/app.wsgi', 'mod_wsgi/example.apache.conf']),
60 ] + db_repo_files,
61 cmdclass={'install': MypiInstall},
671c65e @exhuma Initial incomplete version
authored
62 zip_safe=False,
63 )
f8ae940 @exhuma Clarified/simplified install documentation
authored
64
Something went wrong with that request. Please try again.