setup.py

Sat, 19 Dec 2020 15:22:26 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 19 Dec 2020 15:22:26 +0100
changeset 7900
72b88fb20261
parent 7836
2f0d208b8137
child 7923
91e843545d9a
permissions
-rw-r--r--

Corrected the use of '@keyparam' in the source documentation.

6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 #!/usr/bin/env python3
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3
7360
9190402e4505 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7257
diff changeset
4 # Copyright (c) 2019 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
5 #
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
6
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
7 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
8 Module to prepare a distribution package for uploading to PyPI.
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
9 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
10
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
11 import os
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
12 import sys
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7562
diff changeset
13 import subprocess # secok
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
14 import shutil
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
15 import fnmatch
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
16 import datetime
7804
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
17 import json
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
18
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 from setuptools import setup, find_packages
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
7804
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
21 installInfoName = "eric6installpip.json"
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
22
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
23 ######################################################################
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
24 ## some helper functions below
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
25 ######################################################################
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
26
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
27
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
28 def getVersion():
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
29 """
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
30 Function to get the version from file.
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
31
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
32 @return string containing the version
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
33 @rtype str
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
34 """
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
35 version = "<unknown>"
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
36 if sys.argv[-1].startswith(("1", "2")):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
37 # assume it is a version info starting with year
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
38 version = sys.argv[-1]
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
39 del sys.argv[-1]
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
40 else:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
41 # calculate according our version scheme (year.month)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
42 today = datetime.date.today()
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
43 version = "{0}.{1}".format(today.year - 2000, today.month)
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
44 return version
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
45
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
46
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
47 def getPackageData(package, extensions):
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
48 """
7450
c33c1dbd0ee5 setup.py: fixed a typo
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7381
diff changeset
49 Function to return data files of a package with given extensions.
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
50
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
51 @param package name of the package directory
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
52 @type str
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
53 @param extensions list of extensions to test for
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
54 @type list of str
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
55 @return list of package data files
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
56 @rtype list of str
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
57 """
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
58 filesList = []
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
59 for dirpath, _dirnames, filenames in os.walk(package):
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
60 for fname in filenames:
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
61 if (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
62 not fname.startswith('.') and
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
63 os.path.splitext(fname)[1] in extensions
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
64 ):
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
65 filesList.append(
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
66 os.path.relpath(os.path.join(dirpath, fname), package))
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
67 return filesList
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
68
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
69
7381
cee375d46f2f Added a TODO marker for adding some more .desktop files some time later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
70 # TODO: add .desktop files for the eric6 tools
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
71 def getDataFiles():
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
72 """
6958
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
73 Function to return data_files in a platform dependent manner.
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
74
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
75 @return list containing the platform specific data files
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
76 @rtype list of tuples of (str, list of str)
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
77 """
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
78 if sys.platform.startswith('linux'):
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
79 dataFiles = [
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
80 ('share/applications', [
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
81 'linux/eric6.desktop',
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
82 'linux/eric6_browser.desktop',
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
83 ]),
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
84 ('share/icons', [
7516
d0de88fdba2d setup.py: changed the icons setup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7450
diff changeset
85 'eric6/icons/breeze-dark/eric.svg',
d0de88fdba2d setup.py: changed the icons setup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7450
diff changeset
86 'eric6/icons/breeze-dark/ericWeb48.svg'
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
87 ]),
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
88 ('share/appdata', ['linux/eric6.appdata.xml']),
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
89 ('share/metainfo', ['linux/eric6.appdata.xml']),
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
90 ]
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
91 elif sys.platform.startswith(("win", "cygwin")):
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
92 dataFiles = [
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
93 ('scripts', [
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
94 'eric6/pixmaps/eric6.ico',
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
95 'eric6/pixmaps/ericWeb48.ico'])
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
96 ]
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
97 else:
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
98 dataFiles = []
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
99 return dataFiles
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
100
6958
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
101
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
102 def getLongDescription():
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
103 """
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
104 Function to get the long description via the README file.
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
105
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
106 @return long description
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
107 @rtype str
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
108 """
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
109 with open(os.path.join(os.path.dirname(__file__), "docs", "README.rst"),
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
110 "r") as f:
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
111 longDescription = f.read()
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
112
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
113 if not longDescription:
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
114 longDescription = (
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
115 "eric6 is an integrated development environment for the Python"
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
116 " programming language. It uses the PyQt5 bindings and the"
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
117 " QScintilla2 editor widget. See"
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
118 " https://eric-ide.python-projects.org for more details."
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
119 )
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
120
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
121 return longDescription
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
122
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
123 ######################################################################
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
124 ## functions to prepare the sources for building
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
125 ######################################################################
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
126
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
127
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
128 def prepareInfoFile(fileName, version):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
129 """
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
130 Function to prepare an Info.py file.
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
131
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
132 @param fileName name of the Python file containing the info (string)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
133 @param version version string for the package (string)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
134 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
135 if not fileName:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
136 return
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
137
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
138 try:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
139 os.rename(fileName, fileName + ".orig")
7836
2f0d208b8137 Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
140 except OSError:
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
141 pass
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
142 try:
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7562
diff changeset
143 hgOut = subprocess.check_output(["hg", "identify", "-i"]) # secok
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6958
diff changeset
144 hgOut = hgOut.decode()
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
145 except (OSError, subprocess.CalledProcessError):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
146 hgOut = ""
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
147 if hgOut:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
148 hgOut = hgOut.strip()
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
149 if hgOut.endswith("+"):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
150 hgOut = hgOut[:-1]
7785
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
151 with open(fileName + ".orig", "r", encoding="utf-8") as f:
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
152 text = f.read()
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
153 text = (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
154 text.replace("@@REVISION@@", hgOut)
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
155 .replace("@@VERSION@@", version)
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
156 )
7785
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
157 with open(fileName, "w") as f:
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
158 f.write(text)
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
159 else:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
160 shutil.copy(fileName + ".orig", fileName)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
161
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
162
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
163 def prepareAppdataFile(fileName, version):
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
164 """
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
165 Function to prepare a .appdata.xml file.
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
166
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
167 @param fileName name of the .appdata.xml file (string)
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
168 @param version version string for the package (string)
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
169 """
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
170 if not fileName:
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
171 return
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
172
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
173 try:
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
174 os.rename(fileName, fileName + ".orig")
7836
2f0d208b8137 Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
175 except OSError:
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
176 pass
7785
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
177 with open(fileName + ".orig", "r", encoding="utf-8") as f:
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
178 text = f.read()
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
179 text = (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
180 text.replace("@VERSION@", version)
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
181 .replace("@DATE@", datetime.date.today().isoformat())
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
182 )
7785
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
183 with open(fileName, "w") as f:
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
184 f.write(text)
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
185
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
186
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
187 def cleanupSource(dirName):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
188 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
189 Cleanup the sources directory to get rid of leftover files
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
190 and directories.
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
191
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
192 @param dirName name of the directory to prune (string)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
193 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
194 # step 1: delete all Ui_*.py files without a corresponding
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
195 # *.ui file
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
196 dirListing = os.listdir(dirName)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
197 for formName, sourceName in [
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
198 (f.replace('Ui_', "").replace(".py", ".ui"), f)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
199 for f in dirListing if fnmatch.fnmatch(f, "Ui_*.py")]:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
200 if not os.path.exists(os.path.join(dirName, formName)):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
201 os.remove(os.path.join(dirName, sourceName))
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
202 if os.path.exists(os.path.join(dirName, sourceName + "c")):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
203 os.remove(os.path.join(dirName, sourceName + "c"))
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
204
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
205 # step 2: delete the __pycache__ directory and all remaining *.pyc files
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
206 if os.path.exists(os.path.join(dirName, "__pycache__")):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
207 shutil.rmtree(os.path.join(dirName, "__pycache__"))
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
208 for name in [f for f in os.listdir(dirName)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
209 if fnmatch.fnmatch(f, "*.pyc")]:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
210 os.remove(os.path.join(dirName, name))
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
211
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
212 # step 3: delete *.orig files
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
213 for name in [f for f in os.listdir(dirName)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
214 if fnmatch.fnmatch(f, "*.orig")]:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
215 os.remove(os.path.join(dirName, name))
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
216
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
217 # step 4: descent into subdirectories and delete them if empty
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
218 for name in os.listdir(dirName):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
219 name = os.path.join(dirName, name)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
220 if os.path.isdir(name):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
221 cleanupSource(name)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
222 if len(os.listdir(name)) == 0:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
223 os.rmdir(name)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
224
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
225
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
226 def __pyName(py_dir, py_file):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
227 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
228 Local function to create the Python source file name for the compiled
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
229 .ui file.
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
230
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
231 @param py_dir suggested name of the directory (string)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
232 @param py_file suggested name for the compile source file (string)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
233 @return tuple of directory name (string) and source file name (string)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
234 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
235 return py_dir, "Ui_{0}".format(py_file)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
236
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
237
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
238 def compileUiFiles(dirName):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
239 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
240 Compile the .ui files to Python sources.
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
241
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
242 @param dirName name of the directory to compile UI files for (string)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
243 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
244 from PyQt5.uic import compileUiDir
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
245 compileUiDir(dirName, True, __pyName)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
246
7804
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
247
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
248 def createInstallInfoFile(dirName):
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
249 """
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
250 Create a file containing some rudimentary install information.
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
251
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
252 @param dirName name of the directory to compile UI files for
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
253 @type str
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
254 """
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
255 global installInfoName
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
256
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
257 installInfo = {
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
258 "sudo": False,
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
259 "user": "",
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
260 "exe": "",
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
261 "argv": "",
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
262 "install_cwd": "",
7804
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
263 "eric": "",
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
264 "virtualenv": False,
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
265 "installed": False,
7807
5514ca6a62ca Install Info: added the installation date and time to the install info structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7804
diff changeset
266 "installed_on": "",
7804
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
267 "guessed": False,
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
268 "edited": False,
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
269 "pip": True,
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
270 "remarks": "",
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
271 "install_cwd_edited": False,
7807
5514ca6a62ca Install Info: added the installation date and time to the install info structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7804
diff changeset
272 "exe_edited": False,
5514ca6a62ca Install Info: added the installation date and time to the install info structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7804
diff changeset
273 "argv_edited": False,
5514ca6a62ca Install Info: added the installation date and time to the install info structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7804
diff changeset
274 "eric_edited": False,
7804
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
275 }
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
276 with open(os.path.join(dirName, installInfoName), "w") as infoFile:
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
277 json.dump(installInfo, infoFile, indent=2)
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
278
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
279 ######################################################################
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
280 ## setup() below
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
281 ######################################################################
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
283 Version = getVersion()
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
284 sourceDir = os.path.join(os.path.dirname(__file__), "eric6")
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
285 infoFileName = os.path.join(sourceDir, "UI", "Info.py")
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
286 appdataFileName = os.path.join(os.path.dirname(__file__), "linux",
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
287 "eric6.appdata.xml")
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
288 if sys.argv[1].startswith("bdist"):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
289 # prepare the sources under "eric6" for building the wheel file
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
290 print("preparing the sources...") # __IGNORE_WARNING_M801__
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
291 cleanupSource(sourceDir)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
292 compileUiFiles(sourceDir)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
293 prepareInfoFile(infoFileName, Version)
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
294 prepareAppdataFile(appdataFileName, Version)
7804
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
295 createInstallInfoFile(sourceDir)
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
296 print("Preparation finished") # __IGNORE_WARNING_M801__
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
297
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 setup(
6958
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
299 name="eric-ide",
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
300 version=Version,
6958
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
301 description="eric-ide is an integrated development environment for the"
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
302 " Python language.",
6958
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
303 long_description=getLongDescription(),
949c3c76cc8a setup.py: continued implementing support for setup.py and tested against test.pypi.org.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6951
diff changeset
304 long_description_content_type="text/x-rst",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 author="Detlev Offenbach",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 author_email="detlev@die-offenbachs.de",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 url="https://eric-ide.python-projects.org",
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
308 project_urls={
7562
0f25563f8ff4 setup.py: corrected the links to the source code repository and the issues tracker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7539
diff changeset
309 "Source Code": "https://hg.die-offenbachs.homelinux.org/eric/",
0f25563f8ff4 setup.py: corrected the links to the source code repository and the issues tracker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7539
diff changeset
310 "Issues Tracker": "https://tracker.die-offenbachs.homelinux.org/",
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
311 },
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
312 platforms=["Linux", "Windows", "macOS"],
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
313 license="GPLv3",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 classifiers=[
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 "Environment :: MacOS X",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 "Environment :: Win32 (MS Windows)",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 "Environment :: X11 Applications",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 "Environment :: X11 Applications :: Qt",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 "Intended Audience :: Developers",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 "Intended Audience :: End Users/Desktop",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 "Natural Language :: English",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 "Natural Language :: German",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 "Natural Language :: Russian",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 "Natural Language :: Spanish",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 "Operating System :: MacOS :: MacOS X",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 "Operating System :: Microsoft :: Windows :: Windows 10",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 "Operating System :: POSIX :: Linux",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 "Programming Language :: Python",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 "Programming Language :: Python :: 3.5",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 "Programming Language :: Python :: 3.6",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332 "Programming Language :: Python :: 3.7",
7657
428836188b88 setup.py corrected the setup.py file to remove Python 2.7 and add Python 3.8 as supported versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7640
diff changeset
333 "Programming Language :: Python :: 3.8",
7800
96fae5353698 setup.py: extended classifiers by an entry for Python 3.9.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7785
diff changeset
334 "Programming Language :: Python :: 3.9",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 "Topic :: Software Development",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 "Topic :: Text Editors :: Integrated Development Environments (IDE)"
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 ],
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 keywords="Development PyQt5 IDE Python3",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 python_requires=">=3.5",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 install_requires=[
7640
f9bb7c8c60d8 setup.py: changed the order of packages in 'install_requires'. Hopefully this install pip and wheel before PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
341 "pip>=19.0",
f9bb7c8c60d8 setup.py: changed the order of packages in 'install_requires'. Hopefully this install pip and wheel before PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
342 "wheel",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 "PyQt5>=5.12.1",
7539
d6d4d83dad4c setup.py: updated the dependecies.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7516
diff changeset
344 "PyQtChart>=5.12.1",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 "PyQtWebEngine>=5.12.1",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 "QScintilla>=2.11.1",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 "docutils",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 "Markdown",
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
349 "pywin32>=1.0;platform_system=='Windows'",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 ],
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
351 data_files=getDataFiles(),
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
352 packages=find_packages(),
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
353 zip_safe=False,
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
354 package_data={
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
355 "": getPackageData(
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
356 "eric6",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
357 [".png", ".svg", ".svgz", ".xpm", ".ico", ".gif", ".icns", ".txt",
7216
4dd9231b349e setup.py: removed the obsolete ".style" entry for package data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6958
diff changeset
358 ".tmpl", ".html", ".qch", ".css", ".qss", ".e4h", ".e6h", ".api",
7715
ae49e290890d setup.py: extended data file extensions to include all data files the source depends on (prepare to get rid of resources).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7657
diff changeset
359 ".bas", ".dat", ".xbel", ".xml", ".js"]
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
360 ) + ["i18n/eric6_de.qm", "i18n/eric6_en.qm", "i18n/eric6_es.qm",
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
361 "i18n/eric6_ru.qm",
7804
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
362 installInfoName,
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
363 ]
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
364 },
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
365 entry_points={
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
366 "gui_scripts": [
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
367 "eric6 = eric6.eric6:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
368 "eric6_browser = eric6.eric6_browser:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
369 "eric6_compare = eric6.eric6_compare:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
370 "eric6_configure = eric6.eric6_configure:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
371 "eric6_diff = eric6.eric6_diff:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
372 "eric6_editor = eric6.eric6_editor:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
373 "eric6_hexeditor = eric6.eric6_hexeditor:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
374 "eric6_iconeditor = eric6.eric6_iconeditor:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
375 "eric6_plugininstall = eric6.eric6_plugininstall:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
376 "eric6_pluginrepository = eric6.eric6_pluginrepository:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
377 "eric6_pluginuninstall = eric6.eric6_pluginuninstall:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
378 "eric6_qregularexpression = eric6.eric6_qregularexpression:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
379 "eric6_re = eric6.eric6_re:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
380 "eric6_shell = eric6.eric6_shell:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
381 "eric6_snap = eric6.eric6_snap:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
382 "eric6_sqlbrowser = eric6.eric6_sqlbrowser:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
383 "eric6_tray = eric6.eric6_tray:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
384 "eric6_trpreviewer = eric6.eric6_trpreviewer:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
385 "eric6_uipreviewer = eric6.eric6_uipreviewer:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
386 "eric6_unittest = eric6.eric6_unittest:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
387 ],
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
388 "console_scripts": [
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
389 "eric6_api = eric6.eric6_api:main",
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
390 "eric6_doc = eric6.eric6_doc:main",
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
391 "eric6_post_install = eric6.eric6_post_install:main"
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
392 ],
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
393 },
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 )
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
395
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
396 # cleanup
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
397 for fileName in [infoFileName, appdataFileName]:
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
398 if os.path.exists(fileName + ".orig"):
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
399 try:
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
400 os.remove(fileName)
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
401 os.rename(fileName + ".orig", fileName)
7836
2f0d208b8137 Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
402 except OSError:
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
403 pass

eric ide

mercurial