django-markdownx/setup.py

132 lines
3.7 KiB
Python
Raw Normal View History

"""
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():
2017-04-23 18:20:01 +00:00
from sys import version_info
keys = {
'__description__',
'__credits__',
'__copyright__',
'__license__',
'__maintainer__',
'__url__',
2017-04-23 18:20:01 +00:00
'__version__'
}
path = join(dirname(__file__), 'markdownx', '__init__.py')
2017-04-23 18:20:01 +00:00
2021-04-16 19:34:59 +00:00
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)
2017-04-23 18:20:01 +00:00
meta = {key.replace('__', ''): getattr(mod, key) for key in keys}
return meta
2015-09-06 21:15:36 +00:00
2015-09-29 19:50:26 +00:00
def get_requirements():
with open('requirements.txt') as requirements:
req = requirements.read().splitlines()
return req
2017-04-23 19:42:48 +00:00
def readme():
with open('README.rst') as f:
return f.read()
metadata = get_meta()
2015-09-29 19:50:26 +00:00
2014-11-01 22:09:46 +00:00
setup(
name='django-markdownx',
version=metadata.get('version'),
packages=['markdownx', 'markdownx.tests'],
maintainer=metadata.get('maintainer'),
2014-11-03 10:04:22 +00:00
include_package_data=True,
description=metadata.get('description'),
2017-04-23 19:42:48 +00:00
long_description=readme(),
2017-04-23 18:21:10 +00:00
url=metadata.get('url'),
license=metadata.get('license'),
2014-11-01 22:09:46 +00:00
classifiers=[
2015-09-06 19:34:05 +00:00
'Development Status :: 5 - Production/Stable',
2014-11-01 22:09:46 +00:00
'Environment :: Web Environment',
'Environment :: Plugins',
2018-01-21 20:07:46 +00:00
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
2019-12-26 13:38:45 +00:00
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
2021-04-16 19:37:13 +00:00
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
2014-11-01 22:09:46 +00:00
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
2016-05-14 20:03:26 +00:00
'Programming Language :: JavaScript',
'Programming Language :: Python :: 3.6',
2019-12-26 13:38:45 +00:00
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: JavaScript',
2016-08-17 19:53:03 +00:00
'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'
2014-11-01 22:09:46 +00:00
],
keywords='django markdown markdownx django-markdownx editor image upload drag&drop ajax',
2015-09-30 11:22:35 +00:00
tests_require=get_requirements(),
test_suite='runtests',
2015-09-29 19:50:26 +00:00
install_requires=get_requirements(),
2014-11-01 22:09:46 +00:00
)