Uh oh!
There was an error while loading. Please reload this page.
forked from neutronX/django-markdownx
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
executable file
·136 lines (105 loc) · 3.92 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·136 lines (105 loc) · 3.92 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
"""
Installation
============
Using PIP
---------
Django MarkdownX may be installed directly using Python Package Index (PyPi):
.. code-block:: bash
python3 -m pip install django-markdownx
From the source
---------------
Should you wish to download and install it using the source code, you can do as follows:
Note
Make sure you have activated your virtual environment if you're using one.
We start off by downloading the source code from GitHub and navigate to the downloaded directory:
.. code-block:: bash
git clone https://github.com/adi-/django-markdownx.git
cd django-markdownx/
Install the package. You can replace ``python3`` with ``python`` or any of |Supported_versions_of_Python| if
you have multiple versions installed on your machine:
.. code-block:: bash
python3 setup.py install
.. |Supported_versions_of_Python| image:: https://img.shields.io/pypi/pyversions/django-markdownx.svg
"""
fromsetuptoolsimportsetup
fromosimportenviron, link
fromos.pathimportjoin, dirname
if'vagrant'instr(environ):
dellink
defget_meta():
fromsysimportversion_info
keys= {
'__description__',
'__credits__',
'__copyright__',
'__license__',
'__maintainer__',
'__url__',
'__version__'
}
path=join(dirname(__file__), 'markdownx', '__init__.py')
ifversion_info.major==3andversion_info.minor>=5:
fromimportlib.utilimportspec_from_file_location, module_from_spec
spec=spec_from_file_location('.', path)
mod=module_from_spec(spec)
spec.loader.exec_module(mod)
elifversion_info.major==3:
fromimportlib.machineryimportSourceFileLoader
mod=SourceFileLoader('.', path).load_module()
else:
fromimpimportload_source
mod=load_source('.', path)
meta= {key.replace('__', ''): getattr(mod, key) forkeyinkeys}
returnmeta
defget_requirements():
withopen('requirements.txt') asrequirements:
req=requirements.read().splitlines()
returnreq
defreadme():
withopen('README.rst') asf:
returnf.read()
metadata=get_meta()
setup(
name='django-markdownx',
version=metadata.get('version'),
packages=['markdownx', 'markdownx.tests'],
maintainer=metadata.get('maintainer'),
include_package_data=True,
description=metadata.get('description'),
long_description=readme(),
url=metadata.get('url'),
license=metadata.get('license'),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Environment :: Plugins',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: JavaScript',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: JavaScript',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Multimedia :: Graphics',
'Topic :: Text Processing :: Markup',
'Topic :: Text Editors :: Text Processing',
'Topic :: Text Editors :: Word Processors',
'Topic :: Text Processing :: Markup :: HTML',
'Topic :: Multimedia :: Graphics :: Presentation',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Site Management'
],
keywords='django markdown markdownx django-markdownx editor image upload drag&drop ajax',
tests_require=get_requirements(),
test_suite='runtests',
install_requires=get_requirements(),
)