Skip to content

Commit af9536c

Browse files
authored
Merge pull request #43 from roverdotcom/0.2.0-release
0.2.0 release
2 parents 696928a + 86511b1 commit af9536c

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

django_inlinecss/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VERSION = (0, 1, 2)
1+
VERSION = (0, 2, 0)
22

33
__version__ = '.'.join(map(str, VERSION))

setup.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
import io
77
import os
8+
import sys
9+
from shutil import rmtree
810

11+
from setuptools import Command
912
from setuptools import find_packages
1013
from setuptools import setup
1114

@@ -72,6 +75,43 @@
7275
about['__version__'] = VERSION
7376

7477

78+
class UploadCommand(Command):
79+
"""Support setup.py upload."""
80+
81+
description = 'Build and publish the package.'
82+
user_options = []
83+
84+
@staticmethod
85+
def status(s):
86+
"""Prints things in bold."""
87+
print('\033[1m{0}\033[0m'.format(s))
88+
89+
def initialize_options(self):
90+
pass
91+
92+
def finalize_options(self):
93+
pass
94+
95+
def run(self):
96+
try:
97+
self.status('Removing previous builds…')
98+
rmtree(os.path.join(here, 'dist'))
99+
except OSError:
100+
pass
101+
102+
self.status('Building Source and Wheel (universal) distribution…')
103+
os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))
104+
105+
self.status('Uploading the package to PyPI via Twine…')
106+
os.system('twine upload dist/*')
107+
108+
self.status('Pushing git tags…')
109+
os.system('git tag v{0}'.format(about['__version__']))
110+
os.system('git push --tags')
111+
112+
sys.exit()
113+
114+
75115
setup(
76116
name=NAME,
77117
version=about['__version__'],
@@ -104,4 +144,8 @@
104144
install_requires=REQUIRED,
105145
tests_require=TESTS,
106146
extras_require=EXTRAS,
147+
# $ setup.py upload support.
148+
cmdclass={
149+
'upload': UploadCommand,
150+
},
107151
)

0 commit comments

Comments
 (0)