2013-02-16 00:34:16 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*
|
|
|
|
|
|
|
|
from distutils.core import setup
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
def get_packages(package):
|
|
|
|
"""
|
|
|
|
Return root package & all sub-packages.
|
|
|
|
"""
|
2019-10-16 20:20:22 +00:00
|
|
|
return [
|
|
|
|
dirpath for dirpath, dirnames, filenames in os.walk(package)
|
|
|
|
if os.path.exists(os.path.join(dirpath, '__init__.py'))
|
|
|
|
]
|
|
|
|
|
2013-02-16 00:34:16 +00:00
|
|
|
|
|
|
|
def get_package_data(package):
|
|
|
|
"""
|
|
|
|
Return all files under the root package, that are not in a
|
|
|
|
package themselves.
|
|
|
|
"""
|
2019-10-16 20:20:22 +00:00
|
|
|
walk = [
|
|
|
|
(dirpath.replace(package + os.sep, '', 1), filenames)
|
|
|
|
for dirpath, dirnames, filenames in os.walk(package)
|
|
|
|
if not os.path.exists(os.path.join(dirpath, '__init__.py'))
|
|
|
|
]
|
2013-02-16 00:34:16 +00:00
|
|
|
|
|
|
|
filepaths = []
|
|
|
|
for base, filenames in walk:
|
2019-10-16 20:20:22 +00:00
|
|
|
filepaths.extend(
|
|
|
|
[os.path.join(base, filename) for filename in filenames]
|
|
|
|
)
|
2013-02-16 00:34:16 +00:00
|
|
|
return {package: filepaths}
|
|
|
|
|
2019-10-16 20:20:22 +00:00
|
|
|
|
2013-02-16 00:34:16 +00:00
|
|
|
setup(
|
|
|
|
name='mega.py',
|
2013-05-18 00:58:41 +00:00
|
|
|
version='0.9.17',
|
2013-02-16 00:34:16 +00:00
|
|
|
packages=get_packages('mega'),
|
|
|
|
package_data=get_package_data('mega'),
|
|
|
|
description='Python lib for the Mega.co.nz API',
|
|
|
|
author='Richard O\'Dwyer',
|
|
|
|
author_email='richard@richard.do',
|
|
|
|
license='Creative Commons Attribution-Noncommercial-Share Alike license',
|
2013-04-08 13:18:38 +00:00
|
|
|
long_description='https://github.com/richardasaurus/mega.py',
|
2013-04-20 11:45:06 +00:00
|
|
|
install_requires=['pycrypto', 'requests'],
|
2013-02-16 01:04:41 +00:00
|
|
|
classifiers=[
|
|
|
|
'Intended Audience :: Developers',
|
2019-10-16 20:20:22 +00:00
|
|
|
'Operating System :: OS Independent', 'Programming Language :: Python',
|
2013-02-16 01:04:41 +00:00
|
|
|
'Topic :: Internet :: WWW/HTTP'
|
|
|
|
]
|
2013-04-20 11:45:06 +00:00
|
|
|
)
|