-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsetup.py
68 lines (61 loc) · 2.16 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
import os
from setuptools import find_packages
from setuptools import setup
plugin_name = "OctoPrint-WebcamTab"
plugin_description = "Move the webcam stream to a separate tab."
plugin_version = "0.1.1"
plugin_author = "Sven Lohrmann"
plugin_author_email = "[email protected]"
plugin_url = "https://github.com/malnvenshorn/octoprint-webcamtab"
plugin_license = "AGPLv3"
plugin_identifier = "webcamtab"
plugin_package = "octoprint_webcamtab"
plugin_source_folder = "src"
plugin_requires = [
"OctoPrint"
]
try:
import octoprint_setuptools
except ImportError:
print("Could not import OctoPrint's setuptools, are you sure you are running that under "
"the same python installation that OctoPrint is installed under?")
import sys
sys.exit(-1)
cmdclass = dict()
translation_dir = os.path.join('.', "translations")
pot_file = os.path.join(translation_dir, "messages.pot")
cmdclass.update(
octoprint_setuptools.get_babel_commandclasses(
pot_file=pot_file,
output_dir=translation_dir,
bundled_dir=None,
pack_name_prefix=f"{plugin_name}-i18n-",
pack_path_prefix=f"_plugins/{plugin_identifier}/",
)
)
setup(
name=plugin_name,
version=plugin_version,
description=plugin_description,
author=plugin_author,
author_email=plugin_author_email,
url=plugin_url,
license=plugin_license,
# Adding new commands
cmdclass=cmdclass,
# List of our packages
packages=find_packages(where=plugin_source_folder),
# Map package to directory names
package_dir={"": plugin_source_folder},
# Include additional data files that are specified in the MANIFEST.in file
include_package_data=True,
# We have package data that needs to be accessible on the file system, such as templates or static assets
# therefore this plugin is not zip_safe.
zip_safe=False,
install_requires=plugin_requires,
# Hook the plugin into the "octoprint.plugin" entry point, mapping the plugin_identifier to the plugin_package.
# That way OctoPrint will be able to find the plugin and load it.
entry_points={
"octoprint.plugin": [f"{plugin_identifier} = {plugin_package}"],
},
)