django-markdownx/setup.py

136 lines
4 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
"""
2014-11-03 09:00:53 +00:00
from setuptools import setup, find_packages
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 = {
'__author__',
'__description__',
'__credits__',
'__copyright__',
'__license__',
'__maintainer__',
'__version__'
}
path = join(dirname(__file__), 'markdownx', '__init__.py')
2017-04-23 18:20:01 +00:00
if version_info.major == 3 and version_info.minor >= 5:
2017-04-23 18:21:57 +00:00
from importlib.util import spec_from_file_location, module_from_spec
spec = spec_from_file_location('.', path)
mod = module_from_spec(spec)
2017-04-23 18:20:01 +00:00
spec.loader.exec_module(mod)
elif version_info.major == 3:
from importlib.machinery import SourceFileLoader
mod = SourceFileLoader('.', path).load_module()
else:
2017-04-23 18:21:57 +00:00
from imp import load_source
mod = load_source('.', path)
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
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'),
2014-11-03 09:00:53 +00:00
packages=find_packages(),
author=metadata.get('author'),
2017-04-23 16:13:37 +00:00
author_email=metadata.get('author_email'),
maintainer=metadata.get('maintainer'),
2014-11-03 10:04:22 +00:00
include_package_data=True,
description=metadata.get('description'),
long_description=metadata.get('doc'),
2017-04-23 16:13:37 +00:00
url='https://github.com/neutronX/django-markdownx',
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',
2016-08-17 19:53:03 +00:00
'Framework :: Django',
2016-05-14 19:59:59 +00:00
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
2016-08-15 11:36:29 +00:00
'Framework :: Django :: 1.10',
2017-04-23 16:13:37 +00:00
'Framework :: Django :: 1.11',
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',
2016-08-17 19:53:03 +00:00
'Programming Language :: Python',
2014-11-01 22:09:46 +00:00
'Programming Language :: Python :: 2.7',
2015-09-30 11:22:35 +00:00
'Programming Language :: Python :: 3.4',
2015-09-29 04:28:20 +00:00
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'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
)