-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
65 lines (51 loc) · 1.93 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import os
from setuptools import setup, find_packages
import sys
install_requires = ["cssselect"]
if sys.version_info < (3, 4):
install_requires.append("enum34")
tests_require = ["lxml", "pytest"]
def read(filename):
"""Returns the contents of the given package file."""
path = os.path.join(os.path.dirname(__file__), filename)
with open(path) as f:
return f.read()
def get_version():
"""Returns the package version."""
global_vars = {}
# Compile and execute the individual file to prevent
# the package from being automatically loaded.
source = read(os.path.join("xpath", "version.py"))
code = compile(source, "version.py", "exec")
exec(code, global_vars)
return global_vars['__version__']
setup(
name="xpath-py",
version=get_version(),
description="Python library for generating XPath expressions",
long_description=read("README.rst"),
url="https://github.com/elliterate/xpath.py",
author="Ian Lesperance",
author_email="[email protected]",
license="MIT",
keywords="xpath",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Markup :: HTML",
"Topic :: Text Processing :: Markup :: XML",
"Topic :: Utilities"],
packages=find_packages(exclude=["tests*"]),
install_requires=install_requires,
setup_requires=["pytest-runner"],
tests_require=tests_require,
extras_require={
# Expose test dependencies for external scripts, like pip.
"test": tests_require})