setup.py

Sun, 19 Sep 2021 15:49:45 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 19 Sep 2021 15:49:45 +0200
branch
eric7
changeset 8615
d43e7eb22319
parent 8611
0b1a09e47e98
child 8634
2bbfaad44cbd
permissions
-rw-r--r--

Fixed some issues related to Qt enum usage.

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
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7836
diff changeset
4 # Copyright (c) 2019 - 2021 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
8240
93b8a353c4bf Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8128
diff changeset
18 import contextlib
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
19
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 from setuptools import setup, find_packages
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
22 installInfoName = "eric7installpip.json"
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
23
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
24 ######################################################################
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
25 ## some helper functions below
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
26 ######################################################################
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
27
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
28
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
29 def getVersion():
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
30 """
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
31 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
32
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
33 @return string containing the version
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
34 @rtype str
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
35 """
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
36 version = "<unknown>"
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
37 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
38 # 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
39 version = sys.argv[-1]
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
40 del sys.argv[-1]
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
41 else:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
42 # 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
43 today = datetime.date.today()
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
44 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
45 return version
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
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
48 def getPackageData(package, extensions):
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
49 """
7450
c33c1dbd0ee5 setup.py: fixed a typo
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7381
diff changeset
50 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
51
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
52 @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
53 @type str
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
54 @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
55 @type list of str
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
56 @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
57 @rtype list of str
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
58 """
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
59 filesList = []
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
60 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
61 for fname in filenames:
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
62 if (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
63 not fname.startswith('.') and
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
64 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
65 ):
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
66 filesList.append(
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
67 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
68 return filesList
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
69
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
70
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
71 # TODO: add .desktop files for the eric tools
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
72 def getDataFiles():
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
73 """
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
74 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
75
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
76 @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
77 @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
78 """
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
79 if sys.platform.startswith('linux'):
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
80 dataFiles = [
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
81 ('share/applications', [
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
82 'linux/eric7.desktop',
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
83 'linux/eric7_browser.desktop',
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
84 ]),
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
85 ('share/icons', [
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
86 'eric7/icons/breeze-dark/eric.svg',
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
87 'eric7/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
88 ]),
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
89 ('share/appdata', ['linux/eric7.appdata.xml']),
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
90 ('share/metainfo', ['linux/eric7.appdata.xml']),
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
91 ]
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
92 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
93 dataFiles = [
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
94 ('scripts', [
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
95 'eric7/pixmaps/eric7.ico',
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
96 'eric7/pixmaps/ericWeb48.ico'])
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
97 ]
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
98 else:
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
99 dataFiles = []
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
100 return dataFiles
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
101
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
102
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 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
104 """
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 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
106
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 @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
108 @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
109 """
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 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
111 "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
112 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
113
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 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
115 longDescription = (
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
116 "eric is an integrated development environment for the Python"
8342
0613a64f1b64 Prepared the setup.py file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
117 " programming language. It uses the PyQt6 bindings and the"
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
118 " 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
119 " 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
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
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 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
123
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
124 ######################################################################
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
125 ## 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
126 ######################################################################
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
127
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
128
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
129 def prepareInfoFile(fileName, version):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
130 """
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
131 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
132
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
133 @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
134 @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
135 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
136 if not fileName:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
137 return
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
138
8240
93b8a353c4bf Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8128
diff changeset
139 with contextlib.suppress(OSError):
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
140 os.rename(fileName, fileName + ".orig")
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
141 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
142 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
143 hgOut = hgOut.decode()
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
144 except (OSError, subprocess.CalledProcessError):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
145 hgOut = ""
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
146 if hgOut:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
147 hgOut = hgOut.strip()
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
148 if hgOut.endswith("+"):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
149 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
150 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
151 text = f.read()
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
152 text = (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
153 text.replace("@@REVISION@@", hgOut)
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
154 .replace("@@VERSION@@", version)
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
155 )
7785
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
156 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
157 f.write(text)
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
158 else:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
159 shutil.copy(fileName + ".orig", fileName)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
160
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
161
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
162 def prepareAppdataFile(fileName, version):
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
163 """
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
164 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
165
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
166 @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
167 @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
168 """
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
169 if not fileName:
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
170 return
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
171
8240
93b8a353c4bf Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8128
diff changeset
172 with contextlib.suppress(OSError):
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
173 os.rename(fileName, fileName + ".orig")
7785
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
174 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
175 text = f.read()
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
176 text = (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
177 text.replace("@VERSION@", version)
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
178 .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
179 )
7785
9978016560ec Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
180 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
181 f.write(text)
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
182
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
183
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
184 def cleanupSource(dirName):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
185 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
186 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
187 and directories.
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 @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
190 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
191 # 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
192 # *.ui file
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
193 dirListing = os.listdir(dirName)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
194 for formName, sourceName in [
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
195 (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
196 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
197 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
198 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
199 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
200 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
201
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
202 # 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
203 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
204 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
205 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
206 if fnmatch.fnmatch(f, "*.pyc")]:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
207 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
208
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
209 # step 3: delete *.orig files
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
210 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
211 if fnmatch.fnmatch(f, "*.orig")]:
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
212 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
213
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
214 # 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
215 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
216 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
217 if os.path.isdir(name):
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
218 cleanupSource(name)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
219 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
220 os.rmdir(name)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
221
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
222
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
223 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
224 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
225 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
226 .ui 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 @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
229 @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
230 @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
231 """
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
232 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
233
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 def compileUiFiles(dirName):
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 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
238
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
239 @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
240 """
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8314
diff changeset
241 from PyQt6.uic import compileUiDir
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
242 compileUiDir(dirName, True, __pyName)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
243
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
244
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
245 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
246 """
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 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
248
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 @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
250 @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
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 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
253
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 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
255 "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
256 "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
257 "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
258 "argv": "",
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
259 "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
260 "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
261 "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
262 "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
263 "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
264 "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
265 "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
266 "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
267 "remarks": "",
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
268 "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
269 "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
270 "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
271 "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
272 }
1cbc27e34ec6 Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7800
diff changeset
273 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
274 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
275
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
276 ######################################################################
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
277 ## setup() below
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
278 ######################################################################
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
280 Version = getVersion()
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
281 sourceDir = os.path.join(os.path.dirname(__file__), "eric7")
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
282 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
283 appdataFileName = os.path.join(os.path.dirname(__file__), "linux",
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
284 "eric7.appdata.xml")
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
285 if sys.argv[1].startswith("bdist"):
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
286 # prepare the sources under "eric7" 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
287 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
288 cleanupSource(sourceDir)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
289 compileUiFiles(sourceDir)
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
290 prepareInfoFile(infoFileName, Version)
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
291 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
292 createInstallInfoFile(sourceDir)
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
293 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
294
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 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
296 name="eric-ide",
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
297 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
298 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
299 " 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
300 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
301 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
302 author="Detlev Offenbach",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 author_email="detlev@die-offenbachs.de",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 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
305 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
306 "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
307 "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
308 },
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
309 platforms=["Linux", "Windows", "macOS"],
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
310 license="GPLv3",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 classifiers=[
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 "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
313 "Environment :: MacOS X",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 "Environment :: Win32 (MS Windows)",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 "Environment :: X11 Applications",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 "Environment :: X11 Applications :: Qt",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 "Intended Audience :: Developers",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 "Intended Audience :: End Users/Desktop",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 "Natural Language :: English",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 "Natural Language :: German",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 "Natural Language :: Russian",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 "Natural Language :: Spanish",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 "Operating System :: MacOS :: MacOS X",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 "Operating System :: Microsoft :: Windows :: Windows 10",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 "Operating System :: POSIX :: Linux",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 "Programming Language :: Python",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 "Programming Language :: Python :: 3.6",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 "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
329 "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
330 "Programming Language :: Python :: 3.9",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 "Topic :: Software Development",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332 "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
333 ],
8459
0ae07748dbe8 Changed quite a few PyQt5 references to PyQt6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8458
diff changeset
334 keywords="Development PyQt6 IDE Python3",
8275
2f4b8212a151 setup.py: raised the minimum Python version to 3.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8258
diff changeset
335 python_requires=">=3.6",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 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
337 "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
338 "wheel",
8342
0613a64f1b64 Prepared the setup.py file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
339 "PyQt6>=6.1.1",
8440
f71f33c0d47a Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8360
diff changeset
340 "PyQt6-Charts>=6.1.1",
8593
1d66b6af60ed Jedi: integrated the Assistant Jedi plugin as a fixed part of eric.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8459
diff changeset
341 # TODO: enable this line once PyQt 6.2 has been released
8360
2a91e0e05926 Removed some commented code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8342
diff changeset
342 #~ "PyQt6-WebEngine>=6.2.0", # __IGNORE_WARNING__
8440
f71f33c0d47a Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8360
diff changeset
343 "PyQt6-QScintilla>=2.13.0",
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 "docutils",
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 "Markdown",
8128
8f012c58f27e Changed setup.py and the install script to include the dependency to PyYAML and toml packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8127
diff changeset
346 "pyyaml",
8f012c58f27e Changed setup.py and the install script to include the dependency to PyYAML and toml packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8127
diff changeset
347 "toml",
8258
82b608e352ec Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
348 "chardet",
82b608e352ec Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
349 "asttokens",
82b608e352ec Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
350 "EditorConfig",
82b608e352ec Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
351 "Send2Trash",
82b608e352ec Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
352 "Pygments",
8593
1d66b6af60ed Jedi: integrated the Assistant Jedi plugin as a fixed part of eric.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8459
diff changeset
353 "parso",
1d66b6af60ed Jedi: integrated the Assistant Jedi plugin as a fixed part of eric.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8459
diff changeset
354 "jedi",
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
355 "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
356 ],
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
357 data_files=getDataFiles(),
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
358 packages=find_packages(),
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
359 zip_safe=False,
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
360 package_data={
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
361 "": getPackageData(
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
362 "eric7",
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
363 [".png", ".svg", ".svgz", ".xpm", ".ico", ".gif", ".icns", ".txt",
8047
b5594178c7fa Made some more JSON file related changes and exported some dark styles in the new file format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
364 ".tmpl", ".html", ".qch", ".css", ".qss", ".e4h", ".e6h", ".ehj",
b5594178c7fa Made some more JSON file related changes and exported some dark styles in the new file format.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
365 ".api", ".bas", ".dat", ".xbel", ".xml", ".js"]
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
366 ) + ["i18n/eric7_de.qm", "i18n/eric7_en.qm", "i18n/eric7_es.qm",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
367 "i18n/eric7_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
368 installInfoName,
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
369 ]
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
370 },
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
371 entry_points={
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
372 "gui_scripts": [
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
373 "eric7 = eric7.eric7:main",
8593
1d66b6af60ed Jedi: integrated the Assistant Jedi plugin as a fixed part of eric.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8459
diff changeset
374 # TODO: enable this line once PyQt 6.2 has been released
8360
2a91e0e05926 Removed some commented code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8342
diff changeset
375 #~ "eric7_browser = eric7.eric7_browser:main", # __IGNORE_WARNING__
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
376 "eric7_compare = eric7.eric7_compare:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
377 "eric7_configure = eric7.eric7_configure:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
378 "eric7_diff = eric7.eric7_diff:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
379 "eric7_editor = eric7.eric7_editor:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
380 "eric7_hexeditor = eric7.eric7_hexeditor:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
381 "eric7_iconeditor = eric7.eric7_iconeditor:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
382 "eric7_plugininstall = eric7.eric7_plugininstall:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
383 "eric7_pluginrepository = eric7.eric7_pluginrepository:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
384 "eric7_pluginuninstall = eric7.eric7_pluginuninstall:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
385 "eric7_qregularexpression = eric7.eric7_qregularexpression:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
386 "eric7_re = eric7.eric7_re:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
387 "eric7_shell = eric7.eric7_shell:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
388 "eric7_snap = eric7.eric7_snap:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
389 "eric7_sqlbrowser = eric7.eric7_sqlbrowser:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
390 "eric7_tray = eric7.eric7_tray:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
391 "eric7_trpreviewer = eric7.eric7_trpreviewer:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
392 "eric7_uipreviewer = eric7.eric7_uipreviewer:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
393 "eric7_unittest = eric7.eric7_unittest:main",
8611
0b1a09e47e98 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8593
diff changeset
394 "eric7_virtualenv = eric7.eric7_virtualenv:main",
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
395 ],
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
396 "console_scripts": [
8314
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
397 "eric7_api = eric7.eric7_api:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
398 "eric7_doc = eric7.eric7_doc:main",
e3642a6a1e71 Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8288
diff changeset
399 "eric7_post_install = eric7.eric7_post_install:main"
6949
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
400 ],
a5255f1ba3f0 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6946
diff changeset
401 },
6946
660757d6c57b setup.py: started implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 )
6950
62e39a353cd9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6949
diff changeset
403
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
404 # cleanup
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
405 for fileName in [infoFileName, appdataFileName]:
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
406 if os.path.exists(fileName + ".orig"):
8243
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8240
diff changeset
407 with contextlib.suppress(OSError):
6951
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
408 os.remove(fileName)
ef3e87580dc9 setup.py: continued implementing support for setup.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6950
diff changeset
409 os.rename(fileName + ".orig", fileName)

eric ide

mercurial