1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
1
3
"""
4
+ A setuptools based setup module.
5
+
2
6
See:
3
7
https://packaging.python.org/en/latest/distributing.html
4
8
https://github.com/pypa/sampleproject
9
+ https://github.com/kennethreitz/setup.py
10
+
11
+ Note: To use the 'upload' functionality of this file, you must:
12
+ $ pip install twine
5
13
"""
14
+ from __future__ import print_function
15
+ import io
16
+ import sys
17
+ from os import path , system
18
+ from shutil import rmtree
6
19
7
20
# Always prefer setuptools over distutils
8
- from setuptools import find_packages , setup
21
+ from setuptools import find_packages , setup , Command
22
+
23
+ here = path .abspath (path .dirname (__file__ ))
24
+
25
+ # Import the README.rst and use it as the long-description.
26
+ with io .open (path .join (here , 'README.rst' ), encoding = 'utf-8' ) as f :
27
+ long_description = '\n ' + f .read ()
28
+
29
+
30
+ class PublishCommand (Command ):
31
+ """Support setup.py publish."""
32
+
33
+ description = 'Build and publish the package.'
34
+ user_options = []
35
+
36
+ @staticmethod
37
+ def status (s ):
38
+ """Prints things in bold."""
39
+ print ('\033 [1m{0}\033 [0m' .format (s ))
40
+
41
+ def initialize_options (self ):
42
+ pass
43
+
44
+ def finalize_options (self ):
45
+ pass
46
+
47
+ def run (self ):
48
+ try :
49
+ self .status ('Removing previous builds…' )
50
+ rmtree (path .join (here , 'dist' ))
51
+ except OSError :
52
+ pass
9
53
54
+ self .status ('Building Source and Wheel (universal) distribution…' )
55
+ system ('{0} setup.py sdist bdist_wheel --universal' .format (sys .executable ))
56
+
57
+ self .status ('Uploading the package to PyPi via Twine…' )
58
+ system ('twine upload dist/*' )
59
+
60
+ sys .exit ()
61
+
62
+
63
+ # Where the magic happens:
10
64
setup (
11
65
name = 'pizzapi' ,
12
66
16
70
version = '0.0.1' ,
17
71
18
72
description = 'A Python wrapper for the Dominos Pizza API' ,
73
+ long_description = long_description ,
19
74
20
75
# The project's main homepage.
21
76
url = 'https://github.com/aluttik/pizzapi' ,
22
77
23
78
# Author details
24
79
author = 'aluttik' ,
25
- author_email = '' ,
80
+
26
81
27
82
# What does your project relate to?
28
83
keywords = 'dominos pizza api' ,
29
84
85
+ # Choose your license
86
+ license = 'MIT' ,
87
+
88
+ # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
89
+ classifiers = [
90
+ # How mature is this project? Common values are
91
+ # 3 - Alpha
92
+ # 4 - Beta
93
+ # 5 - Production/Stable
94
+ 'Development Status :: 3 - Alpha' ,
95
+
96
+ # Pick your license as you wish (should match "license" above)
97
+ 'License :: OSI Approved :: MIT License' ,
98
+
99
+ # TODO: Add testing/support for more python versions
100
+ # Specify the Python versions you support here. In particular, ensure
101
+ # that you indicate whether you support Python 2, Python 3 or both.
102
+ 'Programming Language :: Python' ,
103
+ # 'Programming Language :: Python :: 2.6',
104
+ 'Programming Language :: Python :: 2.7' ,
105
+ # 'Programming Language :: Python :: 3',
106
+ # 'Programming Language :: Python :: 3.3',
107
+ # 'Programming Language :: Python :: 3.4',
108
+ # 'Programming Language :: Python :: 3.5',
109
+ 'Programming Language :: Python :: 3.6' ,
110
+ 'Programming Language :: Python :: Implementation :: CPython' ,
111
+ 'Programming Language :: Python :: Implementation :: PyPy'
112
+ ],
113
+
30
114
# You can just specify the packages manually here if your project is
31
115
# simple. Or you can use find_packages().
32
116
packages = find_packages (exclude = ['tests' ]),
33
117
118
+ # TODO: Add a command line tool
119
+ # To provide executable scripts, use entry points in preference to the
120
+ # "scripts" keyword. Entry points provide cross-platform support and allow
121
+ # pip to create the appropriate form of executable for the target platform.
122
+ # entry_points={
123
+ # 'console_scripts': [
124
+ # 'pizzapi=pizzapi:main'
125
+ # ],
126
+ # },
127
+
34
128
# List run-time dependencies here. These will be installed by pip when
35
129
# your project is installed. For an analysis of "install_requires" vs pip's
36
130
# requirements files see:
37
131
# https://packaging.python.org/en/latest/requirements.html
38
132
install_requires = ['requests' , 'xmltodict' ],
39
- extras_require = {
40
- 'test' : ['mock' , 'PyHamcrest' , 'pytest' ],
133
+ include_package_data = True ,
134
+
135
+ # setup.py publish support.
136
+ cmdclass = {
137
+ 'publish' : PublishCommand ,
41
138
},
42
- )
139
+ )
0 commit comments