2015-09-17 16:04:14 +00:00
|
|
|
#!/usr/bin/env python2
|
2015-03-12 16:23:55 +00:00
|
|
|
# coding=utf-8
|
2014-06-21 22:41:03 +00:00
|
|
|
|
2015-05-12 15:20:31 +00:00
|
|
|
from setuptools import setup, find_packages
|
2015-07-09 13:43:11 +00:00
|
|
|
from distutils.command.build_py import build_py as _build_py
|
2014-06-23 08:35:59 +00:00
|
|
|
import os
|
2015-03-12 16:23:55 +00:00
|
|
|
import versioneer
|
|
|
|
|
|
2015-05-12 15:20:31 +00:00
|
|
|
import sys
|
|
|
|
|
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "src"))
|
2015-05-12 18:36:38 +00:00
|
|
|
import octoprint_setuptools
|
2015-05-12 15:20:31 +00:00
|
|
|
|
2015-03-12 16:23:55 +00:00
|
|
|
#-----------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
2015-04-16 13:28:17 +00:00
|
|
|
# Requirements for our application
|
2015-03-12 16:23:55 +00:00
|
|
|
INSTALL_REQUIRES = [
|
2015-04-23 19:23:02 +00:00
|
|
|
"flask>=0.9,<0.11",
|
2017-01-09 13:09:49 +00:00
|
|
|
"Jinja2>=2.8,<2.9", # Jinja 2.9 has breaking changes WRT template scope - we can't
|
|
|
|
|
# guarantee backwards compatibility for plugins and such with that
|
|
|
|
|
# version, hence we need to pin to a lower version for now. See #1697
|
2015-11-19 09:48:06 +00:00
|
|
|
"werkzeug>=0.8.3,<0.9",
|
2016-11-24 10:45:26 +00:00
|
|
|
"tornado==4.0.2", # pinned for now, we need to migrate to a newer tornado, but due
|
|
|
|
|
# to some voodoo needed to get large streamed uploads and downloads
|
|
|
|
|
# to work that is probably not completely straightforward and therefore
|
|
|
|
|
# something for post-1.3.0-stable release
|
2015-11-19 09:48:06 +00:00
|
|
|
"sockjs-tornado>=1.0.2,<1.1",
|
|
|
|
|
"PyYAML>=3.10,<3.11",
|
|
|
|
|
"Flask-Login>=0.2.2,<0.3",
|
|
|
|
|
"Flask-Principal>=0.3.5,<0.4",
|
|
|
|
|
"Flask-Babel>=0.9,<0.10",
|
|
|
|
|
"Flask-Assets>=0.10,<0.11",
|
2016-07-21 09:50:29 +00:00
|
|
|
"markdown>=2.6.4,<2.7",
|
2015-11-19 09:48:06 +00:00
|
|
|
"pyserial>=2.7,<2.8",
|
|
|
|
|
"netaddr>=0.7.17,<0.8",
|
|
|
|
|
"watchdog>=0.8.3,<0.9",
|
|
|
|
|
"sarge>=0.1.4,<0.2",
|
|
|
|
|
"netifaces>=0.10,<0.11",
|
|
|
|
|
"pylru>=1.0.9,<1.1",
|
|
|
|
|
"rsa>=3.2,<3.3",
|
|
|
|
|
"pkginfo>=1.2.1,<1.3",
|
|
|
|
|
"requests>=2.7,<2.8",
|
|
|
|
|
"semantic_version>=2.4.2,<2.5",
|
|
|
|
|
"psutil>=3.2.1,<3.3",
|
2016-03-23 09:40:09 +00:00
|
|
|
"Click>=6.2,<6.3",
|
2015-07-09 13:43:11 +00:00
|
|
|
"awesome-slugify>=1.6.5,<1.7",
|
2016-06-22 13:22:47 +00:00
|
|
|
"feedparser>=5.2.1,<5.3",
|
2016-07-15 07:56:45 +00:00
|
|
|
"chainmap>=1.0.2,<1.1",
|
2016-08-30 16:03:50 +00:00
|
|
|
"future>=0.15,<0.16",
|
2016-12-13 13:55:43 +00:00
|
|
|
"scandir>=1.3,<1.4",
|
2017-04-03 07:33:03 +00:00
|
|
|
"websocket-client>=0.40,<0.41",
|
|
|
|
|
"python-dateutil>=2.6,<2.7"
|
2015-03-12 16:23:55 +00:00
|
|
|
]
|
|
|
|
|
|
2017-01-11 22:22:21 +00:00
|
|
|
if sys.platform == "darwin":
|
|
|
|
|
INSTALL_REQUIRES.append("appdirs>=1.4.0")
|
|
|
|
|
|
2015-05-12 19:38:04 +00:00
|
|
|
# Additional requirements for optional install options
|
2015-03-12 16:23:55 +00:00
|
|
|
EXTRA_REQUIRES = dict(
|
2015-05-12 19:38:04 +00:00
|
|
|
# Dependencies for developing OctoPrint
|
2015-03-12 16:23:55 +00:00
|
|
|
develop=[
|
|
|
|
|
# Testing dependencies
|
2015-11-19 09:48:06 +00:00
|
|
|
"mock>=1.0.1,<1.1",
|
|
|
|
|
"nose>=1.3.0,<1.4",
|
2015-03-12 16:23:55 +00:00
|
|
|
"ddt",
|
|
|
|
|
|
|
|
|
|
# Documentation dependencies
|
2015-11-19 09:48:06 +00:00
|
|
|
"sphinx>=1.3,<1.4",
|
2015-03-12 16:23:55 +00:00
|
|
|
"sphinxcontrib-httpdomain",
|
2015-10-23 11:27:24 +00:00
|
|
|
"sphinx_rtd_theme",
|
2015-10-23 10:08:36 +00:00
|
|
|
|
|
|
|
|
# PyPi upload related
|
|
|
|
|
"pypandoc"
|
2015-05-12 19:38:04 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
|
|
# Dependencies for developing OctoPrint plugins
|
|
|
|
|
plugins=[
|
2016-03-23 09:40:09 +00:00
|
|
|
"cookiecutter>=1.4,<1.5"
|
2015-03-12 16:23:55 +00:00
|
|
|
]
|
|
|
|
|
)
|
2014-06-23 11:09:54 +00:00
|
|
|
|
2015-10-23 10:08:36 +00:00
|
|
|
# Additional requirements for setup
|
|
|
|
|
SETUP_REQUIRES = []
|
|
|
|
|
|
2015-03-12 16:23:55 +00:00
|
|
|
# Dependency links for any of the aforementioned dependencies
|
|
|
|
|
DEPENDENCY_LINKS = []
|
2014-06-23 11:09:54 +00:00
|
|
|
|
2015-03-12 16:23:55 +00:00
|
|
|
#-----------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
# Anything below here is just command setup and general setup configuration
|
|
|
|
|
|
2015-07-09 13:43:11 +00:00
|
|
|
def data_copy_build_py_factory(files, baseclass):
|
|
|
|
|
class data_copy_build_py(baseclass):
|
|
|
|
|
files = dict()
|
|
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
|
import shutil
|
|
|
|
|
if not self.dry_run:
|
|
|
|
|
for directory, files in self.__class__.files.items():
|
|
|
|
|
target_dir = os.path.join(self.build_lib, directory)
|
|
|
|
|
self.mkpath(target_dir)
|
|
|
|
|
|
|
|
|
|
for entry in files:
|
|
|
|
|
if isinstance(entry, tuple):
|
|
|
|
|
if len(entry) != 2:
|
|
|
|
|
continue
|
|
|
|
|
source, dest = entry
|
|
|
|
|
else:
|
|
|
|
|
source = dest = entry
|
|
|
|
|
shutil.copy(source, os.path.join(target_dir, dest))
|
|
|
|
|
|
|
|
|
|
baseclass.run(self)
|
|
|
|
|
|
|
|
|
|
return type(data_copy_build_py)(data_copy_build_py.__name__,
|
|
|
|
|
(data_copy_build_py,),
|
|
|
|
|
dict(files=files))
|
|
|
|
|
|
2015-05-12 15:20:31 +00:00
|
|
|
def get_cmdclass():
|
|
|
|
|
cmdclass = versioneer.get_cmdclass()
|
2014-08-27 12:46:46 +00:00
|
|
|
|
2015-05-12 15:20:31 +00:00
|
|
|
# add clean command
|
2015-05-12 18:36:38 +00:00
|
|
|
cmdclass.update(dict(clean=octoprint_setuptools.CleanCommand.for_options(source_folder="src", eggs=["OctoPrint*.egg-info"])))
|
2014-08-27 12:46:46 +00:00
|
|
|
|
2015-05-12 15:20:31 +00:00
|
|
|
# add translation commands
|
2015-06-02 11:38:08 +00:00
|
|
|
translation_dir = "translations"
|
2015-05-12 15:20:31 +00:00
|
|
|
pot_file = os.path.join(translation_dir, "messages.pot")
|
2015-06-02 11:38:08 +00:00
|
|
|
bundled_dir = os.path.join("src", "octoprint", "translations")
|
|
|
|
|
cmdclass.update(octoprint_setuptools.get_babel_commandclasses(pot_file=pot_file, output_dir=translation_dir, pack_name_prefix="OctoPrint-i18n-", pack_path_prefix="", bundled_dir=bundled_dir))
|
2014-08-27 12:46:46 +00:00
|
|
|
|
2015-07-09 13:43:11 +00:00
|
|
|
cmdclass["build_py"] = data_copy_build_py_factory({
|
|
|
|
|
"octoprint/templates/_data": [
|
|
|
|
|
"AUTHORS.md",
|
|
|
|
|
"CHANGELOG.md",
|
2015-07-09 13:43:11 +00:00
|
|
|
"SUPPORTERS.md",
|
2015-07-09 13:43:11 +00:00
|
|
|
"THIRDPARTYLICENSES.md",
|
|
|
|
|
]
|
|
|
|
|
}, cmdclass["build_py"] if "build_py" in cmdclass else _build_py)
|
|
|
|
|
|
2014-06-23 11:09:54 +00:00
|
|
|
return cmdclass
|
|
|
|
|
|
|
|
|
|
|
2013-07-09 19:39:07 +00:00
|
|
|
def params():
|
|
|
|
|
name = "OctoPrint"
|
2014-06-23 08:35:59 +00:00
|
|
|
version = versioneer.get_version()
|
2014-06-23 11:09:54 +00:00
|
|
|
cmdclass = get_cmdclass()
|
2014-06-23 08:35:59 +00:00
|
|
|
|
2015-10-23 10:08:36 +00:00
|
|
|
description = "A snappy web interface for 3D printers"
|
2013-07-09 19:39:07 +00:00
|
|
|
long_description = open("README.md").read()
|
2015-10-23 10:08:36 +00:00
|
|
|
|
|
|
|
|
install_requires = INSTALL_REQUIRES
|
|
|
|
|
extras_require = EXTRA_REQUIRES
|
|
|
|
|
dependency_links = DEPENDENCY_LINKS
|
|
|
|
|
setup_requires = SETUP_REQUIRES
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
import pypandoc
|
|
|
|
|
setup_requires += ["setuptools-markdown"]
|
|
|
|
|
long_description_markdown_filename = "README.md"
|
|
|
|
|
del pypandoc
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
|
2013-07-09 19:39:07 +00:00
|
|
|
classifiers = [
|
|
|
|
|
"Development Status :: 4 - Beta",
|
|
|
|
|
"Environment :: Web Environment",
|
|
|
|
|
"Framework :: Flask",
|
|
|
|
|
"Intended Audience :: Education",
|
|
|
|
|
"Intended Audience :: End Users/Desktop",
|
|
|
|
|
"Intended Audience :: Manufacturing",
|
|
|
|
|
"Intended Audience :: Science/Research",
|
|
|
|
|
"License :: OSI Approved :: GNU Affero General Public License v3",
|
|
|
|
|
"Natural Language :: English",
|
|
|
|
|
"Operating System :: OS Independent",
|
|
|
|
|
"Programming Language :: Python :: 2.7",
|
|
|
|
|
"Programming Language :: JavaScript",
|
|
|
|
|
"Topic :: Internet :: WWW/HTTP",
|
|
|
|
|
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
|
|
|
|
"Topic :: Internet :: WWW/HTTP :: WSGI",
|
|
|
|
|
"Topic :: Printing",
|
|
|
|
|
"Topic :: System :: Networking :: Monitoring"
|
|
|
|
|
]
|
|
|
|
|
author = "Gina Häußge"
|
|
|
|
|
author_email = "osd@foosel.net"
|
|
|
|
|
url = "http://octoprint.org"
|
|
|
|
|
license = "AGPLv3"
|
|
|
|
|
|
2013-09-15 19:45:31 +00:00
|
|
|
packages = find_packages(where="src")
|
2015-05-12 15:20:31 +00:00
|
|
|
package_dir = {
|
2015-07-09 13:43:11 +00:00
|
|
|
"": "src",
|
2015-05-12 15:20:31 +00:00
|
|
|
}
|
|
|
|
|
package_data = {
|
2015-09-29 12:23:10 +00:00
|
|
|
"octoprint": octoprint_setuptools.package_data_dirs('src/octoprint',
|
|
|
|
|
['static', 'templates', 'plugins', 'translations'])
|
|
|
|
|
+ ['util/piptestballoon/setup.py']
|
2015-05-12 15:20:31 +00:00
|
|
|
}
|
2013-09-15 19:45:31 +00:00
|
|
|
|
2013-07-09 19:39:07 +00:00
|
|
|
include_package_data = True
|
|
|
|
|
zip_safe = False
|
|
|
|
|
|
2015-03-02 14:17:53 +00:00
|
|
|
if os.environ.get('READTHEDOCS', None) == 'True':
|
|
|
|
|
# we can't tell read the docs to please perform a pip install -e .[develop], so we help
|
2015-03-12 16:23:55 +00:00
|
|
|
# it a bit here by explicitly adding the development dependencies, which include our
|
2015-03-02 14:17:53 +00:00
|
|
|
# documentation dependencies
|
|
|
|
|
install_requires = install_requires + extras_require['develop']
|
2013-07-09 19:39:07 +00:00
|
|
|
|
2013-09-15 19:45:31 +00:00
|
|
|
entry_points = {
|
|
|
|
|
"console_scripts": [
|
|
|
|
|
"octoprint = octoprint:main"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-09 19:39:07 +00:00
|
|
|
return locals()
|
|
|
|
|
|
|
|
|
|
setup(**params())
|