Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

Commit 3f8eecb

Browse files
authored
Merge pull request #22 from dipcode-software/feat/md-to-rst
Feat/md to rst
2 parents b4749a5 + 9660e49 commit 3f8eecb

File tree

2 files changed

+84
-9
lines changed

2 files changed

+84
-9
lines changed

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Django Ajax views
22
=================
33

4-
|Build Status| |Codacy Badge| |Coverage Status|
4+
|Build Status| |Codacy Badge| |Coverage Status| |BCH compliance|
55

66
Django module to easily use generic views with ajax.
77

@@ -44,3 +44,5 @@ projects and commercial products.
4444
:target: https://www.codacy.com/app/srtabs/django-ajax-views?utm_source=github.com&utm_medium=referral&utm_content=dipcode-software/django-ajax-views&utm_campaign=Badge_Grade
4545
.. |Coverage Status| image:: https://coveralls.io/repos/github/dipcode-software/django-ajax-views/badge.svg?branch=master
4646
:target: https://coveralls.io/github/dipcode-software/django-ajax-views?branch=master
47+
.. |BCH compliance| image:: https://bettercodehub.com/edge/badge/dipcode-software/django-ajax-views?branch=master
48+
:target: https://bettercodehub.com/

setup.py

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,97 @@
1-
from setuptools import find_packages, setup
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
import io
5+
import os
6+
from shutil import rmtree
7+
import sys
8+
9+
from setuptools import Command, find_packages, setup
10+
11+
12+
# Package meta-data.
13+
VERSION = __import__("ajax_views").__version__
14+
NAME = 'django-ajax-partials'
15+
DESCRIPTION = 'Django module to easily use generic views with ajax. '
16+
URL = 'https://github.com/dipcode-software/django-ajax-partials/'
17+
EMAIL = 'team@dipcode.com'
18+
AUTHOR = 'Dipcode'
19+
20+
21+
here = os.path.abspath(os.path.dirname(__file__))
22+
with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
23+
long_description = '\n' + f.read()
24+
25+
26+
class PublishCommand(Command):
27+
"""Support setup.py publish."""
28+
29+
description = 'Build and publish the package.'
30+
user_options = []
31+
environment = None
32+
33+
@staticmethod
34+
def status(s):
35+
"""Prints things in bold."""
36+
print('\033[1m{0}\033[0m'.format(s))
37+
38+
def initialize_options(self):
39+
pass
40+
41+
def finalize_options(self):
42+
pass
43+
44+
def run(self):
45+
try:
46+
self.status('Removing previous builds…')
47+
rmtree(os.path.join(here, 'dist'))
48+
rmtree(os.path.join(here, 'build'))
49+
except OSError:
50+
pass
51+
52+
self.status('Building Source and Wheel distribution…')
53+
os.system(
54+
'{0} setup.py sdist bdist_wheel '.format(sys.executable)
55+
)
56+
57+
self.status('Uploading the package to {env} via Twine…'\
58+
.format(env=self.environment))
59+
os.system('twine upload --repository {env} dist/*'.format(env=self.environment))
60+
61+
sys.exit()
62+
63+
64+
class ProductionPublishCommand(PublishCommand):
65+
environment = 'pypi'
66+
67+
68+
class DevelopmentPublishCommand(PublishCommand):
69+
environment = 'testpypi'
270

371

472
setup(
5-
name='django-ajax-partials',
6-
version=__import__("ajax_views").__version__,
73+
name=NAME,
74+
version=VERSION,
75+
description=DESCRIPTION,
76+
long_description=long_description,
77+
author=AUTHOR,
78+
author_email=EMAIL,
79+
url=URL,
780
packages=find_packages(),
881
include_package_data=True,
982
license='MIT',
10-
description='Django module to easily use generic views with ajax.',
11-
url='https://github.com/dipcode-software/django-ajax-partials/',
12-
author='Dipcode',
13-
author_email='team@dipcode.com',
1483
classifiers=[
1584
'Environment :: Web Environment',
1685
'Framework :: Django',
17-
'Framework :: Django :: 1.10',
86+
'Framework :: Django :: 1.11',
1887
'Intended Audience :: Developers',
1988
'License :: OSI Approved :: MIT License',
2089
'Operating System :: OS Independent',
2190
'Programming Language :: Python',
2291
'Programming Language :: Python :: 2.7',
2392
],
93+
cmdclass={
94+
'publish_dev': DevelopmentPublishCommand,
95+
'publish_prod': ProductionPublishCommand,
96+
},
2497
)

0 commit comments

Comments
 (0)