Skip to content

Commit 5060e1e

Browse files
committed
Get ready for release 1.2.3
1 parent b6b5857 commit 5060e1e

13 files changed

Lines changed: 121 additions & 59 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ repos:
1010
hooks:
1111
- id: black
1212
language_version: python3
13+
exclude: 'trepan/version.py'

NEWS.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
1.2.3 2021-03-15
2+
================
3+
4+
There is no 1.2.1 or 1.2.2 - this version number is to keep in sync with trepan2 which has about the
5+
same features.
6+
7+
* Add `set tempdir` and `show tempdir`. In remote debugging this is useful
8+
* `set asmft` error message tweak
9+
* Fix the return tuples for `parse_break_cmd()` (from bradelkin)
10+
* eval?: add "and" and "or" by stripping out the final and/or
11+
* Deal with no style set
12+
* use PyPI term-background package
13+
* Extend patsub's effect to breakpoint Hook the command processor file
14+
pattern substutition to python filecache's file pattern substitution
15+
* Add `info locals --list`
16+
* Tolerate inspect.formatargvalues() errors
17+
* Improve python source detection and invalid bytecode handling.
18+
* Get "set patsub" to substitute file paths e.g. "^/code" inside docker -> "/Users/rocky/project"
19+
20+
About "set patsub". We need to do the substitution in the debugger, not in
21+
`pyficache` where we just want the presentation of the filename to be
22+
different. The actual location is the name `pyficache` sees and gets
23+
lines from.
24+
25+
126
1.2.0 2020-06-27
227
================
328

__pkginfo__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2013, 2015-2018, 2020 Rocky Bernstein <rocky@gnu.org>
1+
# Copyright (C) 2013, 2015-2018, 2020-2021 Rocky Bernstein <rocky@gnu.org>
22
#
33
# This program is free software: you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@
3737
# 3.4 | pip | 19.1.1 |
3838

3939
# Things that change more often go here.
40-
copyright = """Copyright (C) 2013, 2015-2020 Rocky Bernstein <rocky@gnu.org>."""
40+
copyright = """Copyright (C) 2013, 2015-2021 Rocky Bernstein <rocky@gnu.org>."""
4141
classifiers = [
4242
"Development Status :: 5 - Production/Stable",
4343
"Environment :: Console",
@@ -73,7 +73,7 @@
7373
"columnize >= 0.3.10",
7474
"nose>=1.0.0, <= 1.3.7",
7575
"pyficache >= 2.2.1",
76-
"xdis >= 5.0.4",
76+
"xdis >= 5.0.8",
7777
"pygments %s" % pygments_version,
7878
"spark_parser >= 1.8.9, <1.9.0",
7979
"tracer >= 0.3.2",

admin-tools/how-to-make-a-release.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
- [Make packages](#make-packages)
1010
- [Check packages](#check-packages)
1111
- [Release on github](#release-on-github)
12-
- [Get on PyPy](#get-on-pypy)
12+
- [Release on github](#release-on-github-1)
13+
- [Get on PyPI](#get-on-pypi)
14+
- [Push and Pull tags:](#push-and-pull-tags)
15+
- [Move dist files to uploaded](#move-dist-files-to-uploaded)
1316

1417
<!-- markdown-toc end -->
1518
# Get latest sources:
@@ -20,8 +23,8 @@
2023

2124
$ emacs trepan/version.py
2225
$ source trepan/version.py
23-
$ echo $VERSION
24-
$ git commit -m"Get ready for release $VERSION" .
26+
$ echo $__version__
27+
$ git commit -m"Get ready for release $__version__" .
2528

2629
# Update ChangeLog:
2730

@@ -44,7 +47,7 @@
4447

4548
# Check packages
4649

47-
$ twine check dist/trepan3k-$VERSION*
50+
$ twine check dist/trepan3k-$__version__*
4851

4952
# Release on github
5053

@@ -58,15 +61,18 @@ Todo: turn this into a script in `admin-tools`
5861

5962
$ mkdir /tmp/gittest; pushd /tmp/gittest
6063
$ pyenv local 3.7.5 # or some other non-current version
61-
$ pip install -e git://github.com/rocky/python3-trepan.git@$VERSION#egg=trepan3k
64+
$ pip install -e git://github.com/rocky/python3-trepan.git@$__version__#egg=trepan3k
6265
$ trepan3k trepan3k
6366
$ pip uninstall trepan3k
6467
$ popd
6568

69+
# Release on github
70+
71+
Goto https://github.com/rocky/python2-trepan/releases/new
6672

6773
# Get on PyPI
6874

69-
$ twine upload dist/trepan3k-${VERSION}*
75+
$ twine upload dist/trepan3k-${__version__}*
7076

7177
Check on https://pypi.org/project/trepan3k/
7278

@@ -77,4 +83,4 @@ Check on https://pypi.org/project/trepan3k/
7783

7884
# Move dist files to uploaded
7985

80-
$ mv -v dist/trepan3k-${VERSION}* dist/uploaded
86+
$ mv -v dist/trepan3k-${__version__}* dist/uploaded

admin-tools/pyenv-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
77
exit 1
88
fi
99

10-
export PYVERSIONS='3.5.9 3.6.10 3.3.7 3.4.10 3.2.6 3.7.7 3.8.3'
10+
export PYVERSIONS='3.5.10 3.6.13 3.3.7 3.4.10 3.2.6 3.7.10 3.8.8'

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
modname,
2424
py_modules,
2525
short_desc,
26-
VERSION,
26+
__version__,
2727
web,
2828
zip_safe,
2929
)
@@ -63,6 +63,6 @@
6363
py_modules=py_modules,
6464
test_suite="nose.collector",
6565
url=web,
66-
version=VERSION,
66+
version=__version__,
6767
zip_safe=zip_safe,
6868
)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; Settings file for flake8:
22
; http://flake8.readthedocs.org/en/latest/config.html#settings
33
[flake8]
4-
exclude = .tox,./build,./trepan/processor/command/tmp
4+
exclude = .tox,./build,./trepan/processor/command/tmp,./trepan/version.py
55
filename = *.py
66
ignore = E113,E121,E122,E123,E125,E126,E127,E128,E129,E201,E202,E203,E221,E222,E225,E226,E241,E251,E272,E302,E401,E402,E501,F401,E701,E702,E704,E731,C901,W503
77

trepan/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2008-2009, 2013, 2015 Rocky Bernstein <rocky@gnu.org>
2+
# Copyright (C) 2008-2009, 2013, 2015, 2021 Rocky Bernstein <rocky@gnu.org>
33
# This program is free software: you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
55
# the Free Software Foundation, either version 3 of the License, or
@@ -164,11 +164,11 @@
164164
* more testable. Much more unit and functional tests. More of _pydb_'s
165165
integration test will eventually be added.
166166
167-
Copyright (C) 2008-2009, 2013-2016 Rocky Bernstein <rocky@gnu.org>
167+
Copyright (C) 2008-2009, 2013-2016, 2021 Rocky Bernstein <rocky@gnu.org>
168168
169169
.. |Downloads| image:: https://pypip.in/download/trepan/badge.svg
170170
.. |Build Status| image:: https://travis-ci.org/rocky/python3-trepan.svg
171171
"""
172-
__docformat__ = 'restructuredtext'
172+
__docformat__ = "restructuredtext"
173173

174-
from trepan.version import VERSION
174+
from trepan.version import __version__

trepan/__main__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# The name of the debugger we are currently going by.
3636
__title__ = package
3737

38-
from trepan.version import VERSION
38+
from trepan.version import __version__
3939

4040

4141
def main(dbg=None, sys_argv=list(sys.argv)):
@@ -44,7 +44,9 @@ def main(dbg=None, sys_argv=list(sys.argv)):
4444

4545
# Save the original just for use in the restart that works via exec.
4646
orig_sys_argv = list(sys_argv)
47-
opts, dbg_opts, sys_argv = Moptions.process_options(__title__, VERSION, sys_argv)
47+
opts, dbg_opts, sys_argv = Moptions.process_options(
48+
__title__, __version__, sys_argv
49+
)
4850

4951
if opts.server is not None:
5052
if opts.server == "tcp":

trepan/client.py

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
# Copyright (C) 2009, 2013-2017 Rocky Bernstein
3+
# Copyright (C) 2009, 2013-2017, 2021 Rocky Bernstein
44
#
55
# This program is free software; you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
2424
from trepan.interfaces import comcodes as Mcomcodes
2525

2626
from optparse import OptionParser
27-
from trepan.version import VERSION
27+
from trepan.version import __version__
2828

2929

3030
def process_options(pkg_version, sys_argv, option_list=None):
@@ -34,61 +34,89 @@ def process_options(pkg_version, sys_argv, option_list=None):
3434
3535
The options dicionary from opt_parser is return. sys_argv is
3636
also updated."""
37-
usage_str="""%prog [debugger-options]]
37+
usage_str = """%prog [debugger-options]]
3838
3939
Client connection to an out-of-process trepan3k debugger session"""
4040

4141
# serverChoices = ('TCP','FIFO', None) # we use PID for now.
4242

43-
optparser = OptionParser(usage=usage_str, option_list=option_list,
44-
version="%%prog version %s" % pkg_version)
45-
46-
optparser.add_option("-H", "--host", dest="host", default='127.0.0.1',
47-
action="store", type='string', metavar='IP-OR-HOST',
48-
help="connect IP or host name.")
49-
optparser.add_option("-P", "--port", dest="port", default=1027,
50-
action="store", type='int', metavar='NUMBER',
51-
help="Use TCP port number NUMBER for "
52-
"out-of-process connections.")
53-
optparser.add_option("--pid", dest="pid", default=0,
54-
action="store", type='int', metavar='NUMBER',
55-
help="Use PID to get FIFO names for "
56-
"out-of-process connections.")
43+
optparser = OptionParser(
44+
usage=usage_str,
45+
option_list=option_list,
46+
version="%%prog version %s" % pkg_version,
47+
)
48+
49+
optparser.add_option(
50+
"-H",
51+
"--host",
52+
dest="host",
53+
default="127.0.0.1",
54+
action="store",
55+
type="string",
56+
metavar="IP-OR-HOST",
57+
help="connect IP or host name.",
58+
)
59+
optparser.add_option(
60+
"-P",
61+
"--port",
62+
dest="port",
63+
default=1027,
64+
action="store",
65+
type="int",
66+
metavar="NUMBER",
67+
help="Use TCP port number NUMBER for " "out-of-process connections.",
68+
)
69+
optparser.add_option(
70+
"--pid",
71+
dest="pid",
72+
default=0,
73+
action="store",
74+
type="int",
75+
metavar="NUMBER",
76+
help="Use PID to get FIFO names for " "out-of-process connections.",
77+
)
5778

5879
optparser.disable_interspersed_args()
5980

6081
sys.argv = list(sys_argv)
6182
(opts, sys.argv) = optparser.parse_args()
6283
return opts, sys.argv
6384

85+
6486
#
6587
# Connects to a debugger in server mode
6688
#
6789

6890
# DEFAULT_CLIENT_CONNECTION_OPTS = {'open': True, 'IO': 'FIFO'}
69-
DEFAULT_CLIENT_CONNECTION_OPTS = {'open': True, 'IO': 'TCP',
70-
'HOST': '127.0.0.1', 'PORT': 1027}
91+
DEFAULT_CLIENT_CONNECTION_OPTS = {
92+
"open": True,
93+
"IO": "TCP",
94+
"HOST": "127.0.0.1",
95+
"PORT": 1027,
96+
}
97+
98+
7199
def start_client(connection_opts):
72100
intf = Mclient.ClientInterface(connection_opts=connection_opts)
73101
# debugger.interface.append(intf)
74102
intf.msg("Connected.")
75-
done=False
103+
done = False
76104
while not done:
77105
control, remote_msg = intf.read_remote()
78106
# print 'c, r', control, remote_msg
79107
if Mcomcodes.PRINT == control:
80-
print(remote_msg, end=' ')
108+
print(remote_msg, end=" ")
81109
pass
82110
elif control in [Mcomcodes.CONFIRM_TRUE, Mcomcodes.CONFIRM_FALSE]:
83-
default = (Mcomcodes.CONFIRM_TRUE == control)
84-
if intf.confirm(remote_msg.rstrip('\n'), default):
85-
msg='Y'
111+
default = Mcomcodes.CONFIRM_TRUE == control
112+
if intf.confirm(remote_msg.rstrip("\n"), default):
113+
msg = "Y"
86114
else:
87-
msg='N'
115+
msg = "N"
88116
pass
89117
intf.write_remote(Mcomcodes.CONFIRM_REPLY, msg)
90118
elif Mcomcodes.PROMPT == control:
91-
msg = intf.read_command('(Trepan*) ').strip()
119+
msg = intf.read_command("(Trepan*) ").strip()
92120
intf.write_remote(Mcomcodes.CONFIRM_REPLY, msg)
93121
elif Mcomcodes.QUIT == control:
94122
print("trepan3kc: That's all, folks...")
@@ -97,42 +125,41 @@ def start_client(connection_opts):
97125
elif Mcomcodes.RESTART == control:
98126
# FIXME need to save stuff like port # and
99127
# and for FIFO we need new pid.
100-
if 'TCP' == connection_opts['IO']:
101-
print('Restarting...')
128+
if "TCP" == connection_opts["IO"]:
129+
print("Restarting...")
102130
intf.inout.close()
103131
time.sleep(1)
104132
intf.inout.open()
105133
else:
106134
print("Don't know how to hard-restart FIFO...")
107-
done=True
135+
done = True
108136
pass
109137
break
110138
else:
111139
print("!! Weird status code received '%s'" % control)
112-
print(remote_msg, end=' ')
140+
print(remote_msg, end=" ")
113141
pass
114142
pass
115143
intf.close()
116144
return
117145

118146

119147
def run(opts, sys_argv):
120-
if hasattr(opts, 'pid') and opts.pid > 0:
121-
remote_opts = {'open': opts.pid, 'IO': 'FIFO'}
148+
if hasattr(opts, "pid") and opts.pid > 0:
149+
remote_opts = {"open": opts.pid, "IO": "FIFO"}
122150
else:
123-
remote_opts = {'open': True, 'IO': 'TCP', 'PORT': opts.port,
124-
'HOST': opts.host}
151+
remote_opts = {"open": True, "IO": "TCP", "PORT": opts.port, "HOST": opts.host}
125152
start_client(remote_opts)
126153
return
127154

128155

129156
def main():
130-
opts, sys_argv = process_options(VERSION, sys.argv)
157+
opts, sys_argv = process_options(__version__, sys.argv)
131158
# print(opts)
132159
run(opts, sys_argv)
133160
return
134161

135162

136-
if __name__ == '__main__':
163+
if __name__ == "__main__":
137164
main()
138165
pass

0 commit comments

Comments
 (0)