setup.py

branch
setup.py
changeset 6949
a5255f1ba3f0
parent 6946
660757d6c57b
child 6950
62e39a353cd9
equal deleted inserted replaced
6946:660757d6c57b 6949:a5255f1ba3f0
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*- 2 # -*- coding: utf-8 -*-
3 3
4 # Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de>
5 #
6
7 from __future__ import unicode_literals
8
9 import os
10 import sys
11 import subprocess
12
4 from setuptools import setup, find_packages 13 from setuptools import setup, find_packages
14 from distutils.command.install_data import install_data
5 15
16 ######################################################################
17 ## some helper functions below
18 ######################################################################
19
20 def getVersion():
21 """
22 Function to get the version from file.
23
24 @return string containing the version
25 @rtype str
26 """
27 version = "<unknown>"
28 with open(os.path.join(os.path.dirname(__file__), "VERSION"),
29 encoding="ASCII") as f:
30 version = f.read().strip()
31 return version
32
33
34 def getPackageData(package, extensions):
35 """
36 Function to return data files of a package with givene extensions.
37
38 @param package name of the package directory
39 @type str
40 @param extensions list of extensions to test for
41 @type list of str
42 @return list of package data files
43 @rtype list of str
44 """
45 filesList = []
46 for dirpath, _dirnames, filenames in os.walk(package):
47 for fname in filenames:
48 if not fname.startswith('.') and \
49 os.path.splitext(fname)[1] in extensions:
50 filesList.append(
51 os.path.relpath(os.path.join(dirpath, fname), package))
52 return filesList
53
54 def getDataFiles():
55 """
56 Return data_files in a platform dependent manner
57 """
58 if sys.platform.startswith('linux'):
59 dataFiles = [
60 ('share/applications', [
61 'linux/eric6.desktop',
62 'linux/eric6_browser.desktop',
63 ]),
64 ('share/icons', [
65 'eric6/icons/default/eric.png',
66 'eric6/icons/default/ericWeb48.png'
67 ]),
68 ('share/metainfo', ['linux/eric6.appdata.xml'])
69 ]
70 elif os.name == 'nt':
71 dataFiles = [
72 ('scripts', [
73 'eric6/pixmaps/eric6.ico',
74 'eric6/pixmaps/ericWeb48.ico'])
75 ]
76 else:
77 dataFiles = []
78 return dataFiles
79
80 ######################################################################
81 ## make Linux detect eric6 desktop files
82 ######################################################################
83
84 class Eric6InstallData(install_data):
85 def run(self):
86 install_data.run(self)
87 if sys.platform.startswith('linux'):
88 try:
89 subprocess.call(['update-desktop-database'])
90 except:
91 print("ERROR: unable to update desktop database",
92 file=sys.stderr)
93 CmdClass = {
94 'install_data': Eric6InstallData,
95 }
96
97 ######################################################################
98 ## setup() below
99 ######################################################################
6 100
7 setup( 101 setup(
8 name="eric6", 102 name="eric6",
9 version="19.5", # TODO: replace with reading from file 103 version=getVersion(),
10 description="eric6 is an integrated development environment for the" 104 description="eric6 is an integrated development environment for the"
11 " Python language.", 105 " Python language.",
12 long_description="eric6 is an integrated development environment for the" 106 long_description="eric6 is an integrated development environment for the"
13 " Python language. It uses the PyQt5 bindings and the QScintilla2" 107 " Python language. It uses the PyQt5 bindings and the QScintilla2"
14 " editor widget. It may be used with PyQt4 as well.", 108 " editor widget. See https://eric-ide.python-projects.org for more"
109 " details.",
15 author="Detlev Offenbach", 110 author="Detlev Offenbach",
16 author_email="detlev@die-offenbachs.de", 111 author_email="detlev@die-offenbachs.de",
17 url="https://eric-ide.python-projects.org", 112 url="https://eric-ide.python-projects.org",
18 download_url="https://sourceforge.net/projects/eric-ide/files/eric6/" 113 project_urls={
19 "stable", 114 "Source Code": "https://die-offenbachs.homelinux.org/hg/eric/",
20 platforms=[ 115 "Issues Tracker": "https://die-offenbachs.homelinux.org/issues/",
21 "Linux", 116 },
22 "Windows", 117 platforms=["Linux", "Windows", "macOS"],
23 "macOS" 118 license="GPLv3",
24 ],
25 classifiers=[ 119 classifiers=[
26 "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", 120 "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
27 "Environment :: MacOS X", 121 "Environment :: MacOS X",
28 "Environment :: Win32 (MS Windows)", 122 "Environment :: Win32 (MS Windows)",
29 "Environment :: X11 Applications", 123 "Environment :: X11 Applications",
44 "Programming Language :: Python :: 3.7", 138 "Programming Language :: Python :: 3.7",
45 "Topic :: Software Development", 139 "Topic :: Software Development",
46 "Topic :: Text Editors :: Integrated Development Environments (IDE)" 140 "Topic :: Text Editors :: Integrated Development Environments (IDE)"
47 ], 141 ],
48 keywords="Development PyQt5 IDE Python3", 142 keywords="Development PyQt5 IDE Python3",
49 packages=find_packages("eric6"),
50 include_package_data=True,
51 ## scripts=[
52 ## "eric6_api.py",
53 ## "eric6_browser.py",
54 ## "eric6_compare.py",
55 ## "eric6_configure.py",
56 ## "eric6_diff.py",
57 ## "eric6_doc.py",
58 ## "eric6_editor.py",
59 ## "eric6_hexeditor.py",
60 ## "eric6_iconeditor.py",
61 ## "eric6_plugininstall.py",
62 ## "eric6_pluginrepository.py",
63 ## "eric6_pluginuninstall.py",
64 ## "eric6_qregexp.py",
65 ## "eric6_qregularexpression.py",
66 ## "eric6_re.py",
67 ## "eric6_shell.py",
68 ## "eric6_snap.py",
69 ## "eric6_sqlbrowser.py",
70 ## "eric6_tray.py",
71 ## "eric6_trpreviewer.py",
72 ## "eric6_uipreviewer.py",
73 ## "eric6_unittest.py",
74 ## "eric6_webbrowser.py",
75 ## "eric6.py"
76 ## ],
77 python_requires=">=3.5", 143 python_requires=">=3.5",
78 package_data={
79 # TODO: fill with package data
80 "": [
81 "*.qm", "*.html",
82 ],
83 },
84 # TODO: fill with entry points
85 entry_points={
86 ## "gui_scripts": [
87 ## "eric6 = eric6.eric:main",
88 ## ],
89 ## "scripts":[
90 ## "eric6_api = eric6.eric6_api:main",
91 ## "eric6_doc = eric6.eric6_doc:main",
92 ## ],
93 },
94 install_requires=[ 144 install_requires=[
95 "PyQt5>=5.12.1", 145 "PyQt5>=5.12.1",
96 "PyQtWebEngine>=5.12.1", 146 "PyQtWebEngine>=5.12.1",
97 "QScintilla>=2.11.1", 147 "QScintilla>=2.11.1",
98 "pip", 148 "pip",
99 "docutils", 149 "docutils",
100 "Markdown", 150 "Markdown",
101 ], 151 ],
152 data_files=getDataFiles(),
153 packages=find_packages(),
154 # include_package_data=True,
155 zip_safe=False,
156 package_data={
157 "": getPackageData(
158 "eric6",
159 [".png", ".svg", ".svgz", ".xpm", ".ico", ".gif", ".icns", ".txt",
160 ".style", ".tmpl", ".html", ".qch", ".css", ".qss", ".e4h",
161 ".e6h", ".api", ".bas" ".dat"]) +
162 ["i18n/eric6_de.qm", "i18n/eric6_en.qm", "i18n/eric6_es.qm",
163 "i18n/eric6_ru.qm",
164 ]
165 },
166 entry_points={
167 "gui_scripts": [
168 "eric6 = eric6.eric6:main",
169 "eric6_browser = eric6.eric6_browser:main",
170 "eric6_compare = eric6.eric6_compare:main",
171 "eric6_configure = eric6.eric6_configure:main",
172 "eric6_diff = eric6.eric6_diff:main",
173 "eric6_editor = eric6.eric6_editor:main",
174 "eric6_hexeditor = eric6.eric6_hexeditor:main",
175 "eric6_iconeditor = eric6.eric6_iconeditor:main",
176 "eric6_plugininstall = eric6.eric6_plugininstall:main",
177 "eric6_pluginrepository = eric6.eric6_pluginrepository:main",
178 "eric6_pluginuninstall = eric6.eric6_pluginuninstall:main",
179 "eric6_qregexp = eric6.eric6_qregexp:main",
180 "eric6_qregularexpression = eric6.eric6_qregularexpression:main",
181 "eric6_re = eric6.eric6_re:main",
182 "eric6_shell = eric6.eric6_shell:main",
183 "eric6_snap = eric6.eric6_snap:main",
184 "eric6_sqlbrowser = eric6.eric6_sqlbrowser:main",
185 "eric6_tray = eric6.eric6_tray:main",
186 "eric6_trpreviewer = eric6.eric6_trpreviewer:main",
187 "eric6_uipreviewer = eric6.eric6_uipreviewer:main",
188 "eric6_unittest = eric6.eric6_unittest:main",
189 ],
190 "console_scripts":[
191 "eric6_api = eric6.eric6_api:main",
192 "eric6_doc = eric6.eric6_doc:main",
193 ],
194 },
195 cmdclass=CmdClass,
102 ) 196 )

eric ide

mercurial