|
| 1 | +#!/usr/bin/env python |
| 2 | + |
| 3 | +import os |
| 4 | +import re |
| 5 | + |
| 6 | +from setuptools import setup |
| 7 | + |
| 8 | +# Read the version from docx.__version__ without importing the package |
| 9 | +# (and thus attempting to import packages it depends on that may not be |
| 10 | +# installed yet) |
| 11 | +thisdir = os.path.dirname(__file__) |
| 12 | +init_py_path = os.path.join(thisdir, 'docx', '__init__.py') |
| 13 | +version = re.search("__version__ = '([^']+)'", |
| 14 | + open(init_py_path).read()).group(1) |
| 15 | + |
| 16 | + |
| 17 | +NAME = 'python-docx' |
| 18 | +VERSION = version |
| 19 | +DESCRIPTION = ( |
| 20 | + 'Create and update Microsoft Word .docx files.' |
| 21 | +) |
| 22 | +KEYWORDS = 'docx office openxml pptx xslx' |
| 23 | +AUTHOR = 'Steve Canny' |
| 24 | +AUTHOR_EMAIL = 'python-docx@googlegroups.com' |
| 25 | +URL = 'https://github.com/python-openxml/python-docx' |
| 26 | +LICENSE = 'MIT' |
| 27 | +PACKAGES = ['docx'] |
| 28 | + |
| 29 | +INSTALL_REQUIRES = ['lxml'] |
| 30 | +TEST_SUITE = 'tests' |
| 31 | +TESTS_REQUIRE = ['behave', 'mock', 'pytest'] |
| 32 | + |
| 33 | +CLASSIFIERS = [ |
| 34 | + 'Development Status :: 2 - Pre-Alpha', |
| 35 | + 'Environment :: Console', |
| 36 | + 'Intended Audience :: Developers', |
| 37 | + 'License :: OSI Approved :: MIT License', |
| 38 | + 'Operating System :: OS Independent', |
| 39 | + 'Programming Language :: Python', |
| 40 | + 'Programming Language :: Python :: 2', |
| 41 | + 'Programming Language :: Python :: 2.6', |
| 42 | + 'Programming Language :: Python :: 2.7', |
| 43 | + 'Programming Language :: Python :: 3', |
| 44 | + 'Programming Language :: Python :: 3.2', |
| 45 | + 'Programming Language :: Python :: 3.3', |
| 46 | + 'Topic :: Office/Business :: Office Suites', |
| 47 | + 'Topic :: Software Development :: Libraries' |
| 48 | +] |
| 49 | + |
| 50 | +readme = os.path.join(os.path.dirname(__file__), 'README.rst') |
| 51 | +LONG_DESCRIPTION = open(readme).read() |
| 52 | + |
| 53 | + |
| 54 | +params = { |
| 55 | + 'name': NAME, |
| 56 | + 'version': VERSION, |
| 57 | + 'description': DESCRIPTION, |
| 58 | + 'keywords': KEYWORDS, |
| 59 | + 'long_description': LONG_DESCRIPTION, |
| 60 | + 'author': AUTHOR, |
| 61 | + 'author_email': AUTHOR_EMAIL, |
| 62 | + 'url': URL, |
| 63 | + 'license': LICENSE, |
| 64 | + 'packages': PACKAGES, |
| 65 | + 'install_requires': INSTALL_REQUIRES, |
| 66 | + 'tests_require': TESTS_REQUIRE, |
| 67 | + 'test_suite': TEST_SUITE, |
| 68 | + 'classifiers': CLASSIFIERS, |
| 69 | +} |
| 70 | + |
| 71 | +setup(**params) |
0 commit comments