summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py38
1 files changed, 9 insertions, 29 deletions
diff --git a/setup.py b/setup.py
index f944f42..abfaa3f 100755
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-from setuptools import setup
+from setuptools import setup, find_packages
import re
import os
import sys
@@ -19,8 +19,9 @@ install_requires = ['Unidecode>=0.04.16']
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
+ 'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
- 'Operating System :: POSIX',
+ 'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
@@ -41,38 +42,17 @@ def get_version(package):
return re.search("^__version__ = ['\"]([^'\"]+)['\"]", init_py, re.MULTILINE).group(1)
-def get_packages(package):
- """
- Return root package and all sub-packages.
- """
- return [dirpath
- for dirpath, dirnames, filenames in os.walk(package)
- if os.path.exists(os.path.join(dirpath, '__init__.py'))]
-
-
-def get_package_data(package):
- """
- Return all files under the root package, that are not in a
- package themselves.
- """
- 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'))]
-
- filepaths = []
- for base, filenames in walk:
- filepaths.extend([os.path.join(base, filename)
- for filename in filenames])
- return {package: filepaths}
-
+if sys.argv[-1] == 'build':
+ os.system("python setup.py sdist bdist_wheel")
if sys.argv[-1] == 'publish':
- os.system("python setup.py sdist upload")
+ os.system("twine upload dist/*")
args = {'version': get_version(package)}
print("You probably want to also tag the version now:")
print(" git tag -a %(version)s -m 'version %(version)s' && git push --tags" % args)
sys.exit()
+EXCLUDE_FROM_PACKAGES = []
setup(
name=name,
@@ -80,10 +60,10 @@ setup(
url=url,
license=license,
description=description,
+ long_description=description,
author=author,
author_email=author_email,
- packages=get_packages(package),
- package_data=get_package_data(package),
+ packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
install_requires=install_requires,
classifiers=classifiers,
entry_points={'console_scripts': ['slugify=slugify.slugify:main']},