Mercurial > cpython-lru_cache-weakref
annotate Lib/idlelib/setup.py @ 27998:e27f58a50737 legacy-trunk
SF bug #690377: Dud footnote reference in distutils docs
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Fri, 21 Feb 2003 02:47:09 +0000 |
| parents | 75f38c415e7d |
| children | 156911dba306 |
| rev | line source |
|---|---|
|
26470
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
1 import os, glob, sys |
| 18268 | 2 from distutils.core import setup |
| 3 from distutils.command.build_py import build_py | |
| 4 from distutils.command.install_lib import install_lib | |
| 5 import idlever | |
| 6 | |
| 26736 | 7 idle_name = "idle" |
| 8 | |
| 26747 | 9 # Name of 'package' to be installed in site-packages: |
| 10 pkgname = idle_name + "lib" | |
| 11 | |
|
26470
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
12 try: |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
13 pos = sys.argv.index("--check-tkinter") |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
14 except ValueError: |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
15 pass |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
16 else: |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
17 del sys.argv[pos] |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
18 try: |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
19 import _tkinter |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
20 except ImportError: |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
21 print >>sys.stderr, "Cannot install IDLE without _tkinter" |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
22 raise SystemExit |
|
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
23 |
|
27319
75f38c415e7d
1. Restore the rest of Python IDLE setup.py Rev 1.4 (Python SF 634078)
Kurt B. Kaiser <kbk@shore.net>
parents:
27035
diff
changeset
|
24 try: |
|
75f38c415e7d
1. Restore the rest of Python IDLE setup.py Rev 1.4 (Python SF 634078)
Kurt B. Kaiser <kbk@shore.net>
parents:
27035
diff
changeset
|
25 pkg_dir = os.path.join(os.environ['SRCDIR'], 'Tools', idle_name) |
|
75f38c415e7d
1. Restore the rest of Python IDLE setup.py Rev 1.4 (Python SF 634078)
Kurt B. Kaiser <kbk@shore.net>
parents:
27035
diff
changeset
|
26 except KeyError: |
|
75f38c415e7d
1. Restore the rest of Python IDLE setup.py Rev 1.4 (Python SF 634078)
Kurt B. Kaiser <kbk@shore.net>
parents:
27035
diff
changeset
|
27 pkg_dir = "." |
|
75f38c415e7d
1. Restore the rest of Python IDLE setup.py Rev 1.4 (Python SF 634078)
Kurt B. Kaiser <kbk@shore.net>
parents:
27035
diff
changeset
|
28 |
| 26747 | 29 # the normal build_py would not incorporate anything but .py files |
|
27035
93b6a3f6132d
1. Remove obsolete, incorrect comment on non-package installation
Kurt B. Kaiser <kbk@shore.net>
parents:
26774
diff
changeset
|
30 txt_files = ['extend.txt', 'help.txt', 'CREDITS.txt', 'HISTORY.txt', |
|
93b6a3f6132d
1. Remove obsolete, incorrect comment on non-package installation
Kurt B. Kaiser <kbk@shore.net>
parents:
26774
diff
changeset
|
31 'INSTALL.txt', 'LICENSE.txt', 'NEWS.txt', 'README.txt'] |
| 26736 | 32 txt_files += ['config-extensions.def', 'config-highlight.def', |
| 33 'config-keys.def', 'config-main.def'] | |
| 26747 | 34 txt_files += [idle_name + '.bat', idle_name + '.pyw'] |
| 26740 | 35 |
|
27319
75f38c415e7d
1. Restore the rest of Python IDLE setup.py Rev 1.4 (Python SF 634078)
Kurt B. Kaiser <kbk@shore.net>
parents:
27035
diff
changeset
|
36 Icons = glob.glob1(os.path.join(pkg_dir, "Icons"), "*.gif") |
| 26740 | 37 |
| 26736 | 38 class IDLE_Builder(build_py): |
| 18268 | 39 def get_plain_outfile(self, build_dir, package, file): |
| 40 # like get_module_outfile, but does not append .py | |
| 41 outfile_path = [build_dir] + list(package) + [file] | |
| 42 return apply(os.path.join, outfile_path) | |
| 43 | |
| 44 def run(self): | |
| 45 # Copies all .py files, then also copies the txt and gif files | |
| 46 build_py.run(self) | |
| 47 for name in txt_files: | |
| 26774 | 48 outfile = self.get_plain_outfile(self.build_lib, [pkgname], name) |
| 18268 | 49 dir = os.path.dirname(outfile) |
| 50 self.mkpath(dir) | |
| 26747 | 51 self.copy_file(os.path.join(pkg_dir, name), outfile, |
|
26470
95edb48dbfa1
Port Martin von Loewis checkin from Python:
Neal Norwitz <nnorwitz@gmail.com>
parents:
18651
diff
changeset
|
52 preserve_mode = 0) |
| 18268 | 53 for name in Icons: |
| 54 outfile = self.get_plain_outfile(self.build_lib, | |
| 26774 | 55 [pkgname, "Icons"], name) |
| 18268 | 56 dir = os.path.dirname(outfile) |
| 57 self.mkpath(dir) | |
|
27319
75f38c415e7d
1. Restore the rest of Python IDLE setup.py Rev 1.4 (Python SF 634078)
Kurt B. Kaiser <kbk@shore.net>
parents:
27035
diff
changeset
|
58 self.copy_file(os.path.join(pkg_dir, "Icons", name), |
| 18268 | 59 outfile, preserve_mode = 0) |
| 60 | |
| 61 def get_source_files(self): | |
| 26736 | 62 # returns the .py files, the .txt and .def files, and the icons |
| 26747 | 63 icons = [os.path.join(pkg_dir, "Icons",name) for name in Icons] |
| 64 txts = [os.path.join(pkg_dir, name) for name in txt_files] | |
| 26736 | 65 return build_py.get_source_files(self) + txt_files + icons |
| 18268 | 66 |
| 67 def get_outputs(self, include_bytecode=1): | |
| 68 # returns the built files | |
| 69 outputs = build_py.get_outputs(self, include_bytecode) | |
| 70 if not include_bytecode: | |
| 71 return outputs | |
| 72 for name in txt_files: | |
| 26774 | 73 filename = self.get_plain_outfile(self.build_lib, [pkgname], name) |
| 18268 | 74 outputs.append(filename) |
| 75 for name in Icons: | |
| 76 filename = self.get_plain_outfile(self.build_lib, | |
| 26774 | 77 [pkgname, "Icons"], name) |
| 18268 | 78 outputs.append(filename) |
| 79 return outputs | |
| 80 | |
| 81 # Arghhh. install_lib thinks that all files returned from build_py's | |
| 82 # get_outputs are bytecode files | |
|
18651
3b888859d52b
INSTALLATION: Remove the coexist.patch instructions
Kurt B. Kaiser <kbk@shore.net>
parents:
18613
diff
changeset
|
83 |
| 26736 | 84 class IDLE_Installer(install_lib): |
| 18268 | 85 def _bytecode_filenames(self, files): |
| 86 files = [n for n in files if n.endswith('.py')] | |
| 26736 | 87 return install_lib._bytecode_filenames(self, files) |
| 18268 | 88 |
| 26736 | 89 setup(name="IDLEfork", |
| 18268 | 90 version = idlever.IDLE_VERSION, |
| 26736 | 91 description = "IDLEfork, the Developmental Python IDE", |
| 92 author = "Guido van Rossum et. al.", | |
| 93 author_email = "idle-dev@python.org", | |
|
26742
2f3d6b79f11b
Add configuration for packaging.
Kurt B. Kaiser <kbk@shore.net>
parents:
26740
diff
changeset
|
94 license = "PSF: www.python.org", |
| 26736 | 95 url = "https://sourceforge.net/projects/idlefork/", |
| 18268 | 96 long_description = |
| 26747 | 97 """IDLE is a Tkinter based IDE for Python. It is written in 100% pure |
| 98 Python and works both on Windows and Unix. It features a multi-window | |
| 99 text editor with multiple undo, Python colorizing, and many other | |
| 100 things, as well as a Python shell window and a debugger. | |
|
18651
3b888859d52b
INSTALLATION: Remove the coexist.patch instructions
Kurt B. Kaiser <kbk@shore.net>
parents:
18613
diff
changeset
|
101 |
| 26747 | 102 IDLEfork is a separate line of development which was initiated by |
|
27035
93b6a3f6132d
1. Remove obsolete, incorrect comment on non-package installation
Kurt B. Kaiser <kbk@shore.net>
parents:
26774
diff
changeset
|
103 David Scherer at CMU as part of VPython. It features execution in a |
| 26747 | 104 separate process which is newly initiated for each run. At version 0.9 |
| 105 the RPC was changed to incorporate code by GvR, which supports the | |
| 106 debugger. IDLEfork also incorporates a GUI configuration utilility. | |
| 107 For further details, refer to idlefork.sourceforge.net. | |
| 26736 | 108 """, |
| 109 | |
| 110 cmdclass = {'build_py':IDLE_Builder, | |
| 111 'install_lib':IDLE_Installer}, | |
| 26747 | 112 package_dir = {pkgname: pkg_dir}, |
| 26774 | 113 packages = [pkgname], |
| 26747 | 114 scripts = [os.path.join(pkg_dir, idle_name)] |
| 18268 | 115 ) |
