django-fobi/setup.py

284 lines
8.9 KiB
Python
Raw Normal View History

2014-10-11 03:54:24 +00:00
import os
2016-09-21 12:58:11 +00:00
from distutils.version import LooseVersion
2014-10-11 03:54:24 +00:00
from setuptools import setup, find_packages
2022-08-07 22:09:35 +00:00
version = "0.19.4"
# ***************************************************************************
# ************************** Django version *********************************
# ***************************************************************************
DJANGO_INSTALLED = False
try:
import django
2022-07-12 20:53:28 +00:00
DJANGO_INSTALLED = True
LOOSE_DJANGO_VERSION = LooseVersion(django.get_version())
LOOSE_DJANGO_MINOR_VERSION = LooseVersion(
2022-07-12 20:53:28 +00:00
".".join([str(i) for i in LOOSE_DJANGO_VERSION.version[0:2]])
)
# Loose versions
LOOSE_VERSIONS = (
2022-07-12 20:53:28 +00:00
"1.4",
"1.5",
"1.6",
"1.7",
"1.8",
"1.9",
"1.10",
"1.11",
"2.0",
"2.1",
"2.2",
"3.0",
"3.1",
"3.2",
"4.0",
"4.1",
"4.2",
"5.0",
)
for v in LOOSE_VERSIONS:
2022-07-12 20:53:28 +00:00
var_name = "LOOSE_VERSION_{0}".format(v.replace(".", "_"))
globals()[var_name] = LooseVersion(v)
# Exact versions
EXACT_VERSIONS = LOOSE_VERSIONS[:-1]
for i, v in enumerate(EXACT_VERSIONS):
2022-07-12 20:53:28 +00:00
l_cur = globals()[
"LOOSE_VERSION_{0}" "".format(LOOSE_VERSIONS[i].replace(".", "_"))
]
l_nxt = globals()[
"LOOSE_VERSION_{0}"
"".format(LOOSE_VERSIONS[i + 1].replace(".", "_"))
]
var_name = "DJANGO_{0}".format(v.replace(".", "_"))
globals()[var_name] = l_cur <= LOOSE_DJANGO_VERSION < l_nxt
# LTE list
LTE_VERSIONS = LOOSE_VERSIONS[:-1]
for i, v in enumerate(EXACT_VERSIONS):
2022-07-12 20:53:28 +00:00
l_cur = globals()[
"LOOSE_VERSION_{0}" "".format(LOOSE_VERSIONS[i].replace(".", "_"))
]
var_name = "DJANGO_LTE_{0}".format(v.replace(".", "_"))
globals()[var_name] = LOOSE_DJANGO_MINOR_VERSION <= l_cur
# GTE list
GTE_VERSIONS = LOOSE_VERSIONS[:-1]
for i, v in enumerate(EXACT_VERSIONS):
2022-07-12 20:53:28 +00:00
l_cur = globals()[
"LOOSE_VERSION_{0}" "".format(LOOSE_VERSIONS[i].replace(".", "_"))
]
var_name = "DJANGO_GTE_{0}".format(v.replace(".", "_"))
globals()[var_name] = LOOSE_DJANGO_MINOR_VERSION >= l_cur
except Exception as err:
pass
# ***************************************************************************
# ***************************************************************************
# ***************************************************************************
2014-10-11 03:54:24 +00:00
try:
2022-07-12 20:53:28 +00:00
readme = open(os.path.join(os.path.dirname(__file__), "README.rst")).read()
2016-09-21 12:58:11 +00:00
screenshots = open(
2022-08-07 22:09:35 +00:00
os.path.join(os.path.dirname(__file__), "docs/screenshots.rst")
2016-09-21 12:58:11 +00:00
).read()
screenshots = screenshots.replace(
2022-07-12 20:53:28 +00:00
".. image:: _static",
".. figure:: https://github.com/barseghyanartur/django-fobi/raw/"
"main/docs/_static",
2016-09-21 12:58:11 +00:00
)
2014-10-11 03:54:24 +00:00
except:
2022-07-12 20:53:28 +00:00
readme = ""
screenshots = ""
2014-10-11 03:54:24 +00:00
template_dirs = [
2016-10-17 01:30:09 +00:00
# Core templates
"src/fobi/templates/fobi",
2016-09-21 12:58:11 +00:00
# Bootstrap 3
"src/fobi/contrib/themes/bootstrap3/templates/bootstrap3",
# Foundation 5
"src/fobi/contrib/themes/foundation5/templates/foundation5",
# DB Store widget for Foundation 5
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/themes/foundation5/widgets/form_handlers/"
"db_store_foundation5_widget",
2016-09-21 12:58:11 +00:00
# Simple
"src/fobi/contrib/themes/simple/templates/simple",
# djangocms_admin_style_theme
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/themes/djangocms_admin_style_theme/templates/"
"djangocms_admin_style_theme",
2016-09-21 12:58:11 +00:00
# DjangoCMS integration
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/apps/djangocms_integration/templates/"
"djangocms_integration",
2016-09-21 12:58:11 +00:00
# FeinCMS integration
2016-10-17 01:30:09 +00:00
# "src/fobi/contrib/apps/feincms_integration/templates/"
# "feincms_integration",
2016-09-21 12:58:11 +00:00
# Mezzanine integration
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/apps/mezzanine_integration/templates/"
"mezzanine_integration",
2017-06-15 21:59:18 +00:00
# Wagtail integration
"src/fobi/contrib/apps/wagtail_integration/templates/"
"wagtail_integration",
2016-09-21 12:58:11 +00:00
# Content image
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/plugins/form_elements/content/content_image/"
"templates/content_image",
2017-05-17 18:29:02 +00:00
# Content image URL
"src/fobi/contrib/plugins/form_elements/content/content_image_url/"
"templates/content_image_url",
2016-09-21 12:58:11 +00:00
# DB Store
"src/fobi/contrib/plugins/form_handlers/db_store/templates/db_store",
# Mail
"src/fobi/contrib/plugins/form_handlers/mail/templates/mail",
2019-02-28 09:55:13 +00:00
# Mail sender
"src/fobi/contrib/plugins/form_handlers/mail_sender/templates/mail_sender",
2016-10-17 01:30:09 +00:00
# Http re-post
"src/fobi/contrib/plugins/form_handlers/http_repost/templates/"
"http_repost",
2016-09-21 12:58:11 +00:00
# MailChimp importer
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/plugins/form_importers/mailchimp_importer/templates/"
"mailchimp_importer",
2014-10-11 03:54:24 +00:00
]
2016-10-17 01:30:09 +00:00
2014-10-11 03:54:24 +00:00
static_dirs = [
2016-10-17 01:30:09 +00:00
# Core static
"src/fobi/static",
2016-09-21 12:58:11 +00:00
# Bootstrap3
"src/fobi/contrib/themes/bootstrap3/static",
# Bootstrap3 datetime widget
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/themes/bootstrap3/widgets/form_elements/"
"datetime_bootstrap3_widget/static",
2016-09-21 12:58:11 +00:00
# Bootstrap3 date widget
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/themes/bootstrap3/widgets/form_elements/"
"date_bootstrap3_widget/static",
# Bootstrap3 slider widget
"src/fobi/contrib/themes/bootstrap3/widgets/form_elements/"
"slider_bootstrap3_widget/static",
2016-09-21 12:58:11 +00:00
# Foundation5
"src/fobi/contrib/themes/foundation5/static",
# Foundation5 datetime widget
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/themes/foundation5/widgets/form_elements/"
"datetime_foundation5_widget/static",
2016-09-21 12:58:11 +00:00
# Foundation5 date widget
2016-10-17 01:30:09 +00:00
"src/fobi/contrib/themes/foundation5/widgets/form_elements/"
"date_foundation5_widget/static",
2016-09-21 12:58:11 +00:00
# Simple
"src/fobi/contrib/themes/simple/static",
# djangocms_admin_style_theme
"src/fobi/contrib/themes/djangocms_admin_style_theme/static",
# DB Store
"src/fobi/contrib/plugins/form_handlers/db_store/static",
# Dummy
"src/fobi/contrib/plugins/form_elements/test/dummy/static",
2017-12-21 13:23:01 +00:00
# Markdown widget
"src/fobi/reusable/markdown_widget/static",
"src/fobi/contrib/plugins/form_elements/content/content_markdown/static",
2018-01-18 20:07:56 +00:00
# Invisible reCAPTCHA
"src/fobi/contrib/plugins/form_elements/security/invisible_recaptcha/static",
2014-10-11 03:54:24 +00:00
]
locale_dirs = [
"src/fobi/locale/nl",
"src/fobi/locale/ru",
"src/fobi/locale/de",
2014-10-11 03:54:24 +00:00
]
templates = []
static_files = []
locale_files = []
for template_dir in template_dirs:
2022-07-12 20:53:28 +00:00
templates += [
os.path.join(template_dir, f) for f in os.listdir(template_dir)
]
2014-10-11 03:54:24 +00:00
for static_dir in static_dirs:
2022-07-12 20:53:28 +00:00
static_files += [
os.path.join(static_dir, f) for f in os.listdir(static_dir)
]
2014-10-11 03:54:24 +00:00
for locale_dir in locale_dirs:
2022-07-12 20:53:28 +00:00
locale_files += [
os.path.join(locale_dir, f) for f in os.listdir(locale_dir)
]
2014-10-11 03:54:24 +00:00
dependency_links = []
2020-01-10 22:28:31 +00:00
# Dependencies
install_requires = [
2022-07-12 20:53:28 +00:00
"bleach",
"django-autoslug>=1.9.4",
"django-formtools>=2.0",
"django-nine>=0.2.3",
"django-nonefield>=0.1",
"Pillow>=2.0.0",
"requests>=1.0.0",
"six>=1.9",
"Unidecode>=0.04.1",
"vishap>=0.1.5,<2.0",
"easy-thumbnails>=2.4.1",
2020-01-10 22:28:31 +00:00
]
2016-10-17 01:30:09 +00:00
tests_require = [
2022-07-12 20:53:28 +00:00
"selenium",
"Faker",
2016-12-28 21:12:58 +00:00
# 'factory_boy',
# 'fake-factory',
# 'Pillow',
# 'pytest',
# 'pytest-django',
# 'pytest-cov',
# 'tox',
]
2014-10-11 03:54:24 +00:00
setup(
2022-07-12 20:53:28 +00:00
name="django-fobi",
version=version,
2017-02-25 01:01:51 +00:00
description="Form generator/builder application for Django done right: "
2022-07-12 20:53:28 +00:00
"customisable, modular, user- and developer- friendly.",
long_description="{0}{1}".format(readme, screenshots),
classifiers=[
2014-10-11 03:54:24 +00:00
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
2017-02-05 23:07:47 +00:00
"Programming Language :: Python :: 3.6",
2018-08-11 00:22:30 +00:00
"Programming Language :: Python :: 3.7",
2020-01-10 22:28:31 +00:00
"Programming Language :: Python :: 3.8",
2022-06-17 22:58:21 +00:00
"Programming Language :: Python :: 3.9",
2014-10-11 03:54:24 +00:00
"Environment :: Web Environment",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"License :: OSI Approved :: GNU Lesser General Public License v2 or "
"later (LGPLv2+)",
2014-10-11 03:54:24 +00:00
"Framework :: Django",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
],
2020-01-22 21:15:43 +00:00
project_urls={
"Bug Tracker": "https://github.com/barseghyanartur/django-fobi/issues",
"Documentation": "https://django-fobi.readthedocs.io/",
"Source Code": "https://github.com/barseghyanartur/django-fobi",
"Changelog": "https://django-fobi.readthedocs.io/"
2022-07-12 20:53:28 +00:00
"en/latest/changelog.html",
2020-01-22 21:15:43 +00:00
},
keywords="django, form generator, form builder, visual form designer, "
2022-07-12 20:53:28 +00:00
"user generated forms",
author="Artur Barseghyan",
author_email="artur.barseghyan@gmail.com",
url="https://github.com/barseghyanartur/django-fobi/",
package_dir={"": "src"},
packages=find_packages(where="./src"),
license="GPL-2.0-only OR LGPL-2.1-or-later",
install_requires=install_requires,
tests_require=tests_require,
dependency_links=dependency_links,
2022-07-12 20:53:28 +00:00
package_data={"fobi": templates + static_files + locale_files},
include_package_data=True,
2014-10-11 03:54:24 +00:00
)