Upload to pypi
This commit is contained in:
68
setup.py
68
setup.py
@@ -1,54 +1,20 @@
|
|||||||
#!/usr/bin/env python
|
from setuptools import setup
|
||||||
import os
|
|
||||||
|
|
||||||
|
version = '0.2'
|
||||||
|
|
||||||
def fullsplit(path, result=None):
|
setup(
|
||||||
"""
|
name='mailbox',
|
||||||
Split a pathname into components (the opposite of os.path.join) in a
|
version=version,
|
||||||
platform-neutral way.
|
description="Python library for reading IMAP email boxes and parsing the content to JSON",
|
||||||
"""
|
long_description= open('README.md').read(),
|
||||||
if result is None:
|
keywords='email, IMAP, email to json',
|
||||||
result = []
|
author='Martin Rusev',
|
||||||
head, tail = os.path.split(path)
|
author_email='martinrusev@live.com',
|
||||||
if head == '':
|
url='https://github.com/martinrusev/mailbox',
|
||||||
return [tail] + result
|
license='MIT',
|
||||||
if head == path:
|
packages=['mailbox'],
|
||||||
return result
|
package_dir={'mailbox':'mailbox'},
|
||||||
return fullsplit(head, [tail] + result)
|
zip_safe=False,
|
||||||
|
install_requires=[],
|
||||||
|
|
||||||
def read(filename):
|
)
|
||||||
return open(os.path.join(os.path.dirname(__file__), filename)).read()
|
|
||||||
|
|
||||||
packages, data_files = [], []
|
|
||||||
root_dir = os.path.dirname(__file__)
|
|
||||||
|
|
||||||
for dirpath, dirnames, filenames in os.walk(root_dir):
|
|
||||||
# Ignore dirnames that start with '.'
|
|
||||||
for i, dirname in enumerate(dirnames):
|
|
||||||
if dirname.startswith('.'): del dirnames[i]
|
|
||||||
if '__init__.py' in filenames:
|
|
||||||
packages.append('.'.join(fullsplit(dirpath)))
|
|
||||||
elif filenames:
|
|
||||||
data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
|
|
||||||
|
|
||||||
|
|
||||||
sdict = {
|
|
||||||
'name' : 'mailbox',
|
|
||||||
'version' : 0.1,
|
|
||||||
'long_description' : read('README.md'),
|
|
||||||
'author' : 'Martin Rusev',
|
|
||||||
'author_email' : 'martinrusev@live.com',
|
|
||||||
'packages' : packages,
|
|
||||||
'data_files' : data_files,
|
|
||||||
'install_requires':
|
|
||||||
[
|
|
||||||
'pip',
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
|
||||||
from setuptools import setup
|
|
||||||
except ImportError:
|
|
||||||
from distutils.core import setup
|
|
||||||
|
|
||||||
setup(**sdict)
|
|
||||||
Reference in New Issue
Block a user