-
Notifications
You must be signed in to change notification settings - Fork 153
/
setup.py
executable file
·130 lines (99 loc) · 3.67 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
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
"""
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
"""
from setuptools import setup
from os import environ, link
from os.path import join, dirname
if 'vagrant' in str(environ):
del link
def get_meta():
from sys import version_info
keys = {
'__description__',
'__credits__',
'__copyright__',
'__license__',
'__maintainer__',
'__url__',
'__version__'
}
path = join(dirname(__file__), 'markdownx', '__init__.py')
from importlib.util import spec_from_file_location, module_from_spec
spec = spec_from_file_location('.', path)
mod = module_from_spec(spec)
spec.loader.exec_module(mod)
meta = {key.replace('__', ''): getattr(mod, key) for key in keys}
return meta
def get_requirements():
with open('requirements.txt') as requirements:
req = requirements.read().splitlines()
return req
def readme():
with open('README.rst') as f:
return f.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 :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: JavaScript',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'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(),
)