Skip to content

Commit 0e636d5

Browse files
authoredAug 29, 2021
update dependencies, support Python 3.9 (#400)
1 parent c1f337d commit 0e636d5

22 files changed

+1185
-1038
lines changed
 

‎.github/workflows/build_executable.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest, macos-latest]
16-
python-version: [3.8]
16+
python-version: [3.9]
1717
include:
1818
- os: ubuntu-latest
1919
buildname: linux

‎.github/workflows/tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ubuntu-latest]
18-
python-version: [3.6, 3.7, 3.8]
18+
python-version: [3.9]
1919

2020
steps:
2121
- uses: actions/checkout@v2
@@ -41,7 +41,7 @@ jobs:
4141
- name: Set up Python
4242
uses: actions/setup-python@v2
4343
with:
44-
python-version: 3.8
44+
python-version: 3.9
4545
- name: Install dependencies
4646
run: |
4747
python -m pip install --upgrade pip
@@ -57,7 +57,7 @@ jobs:
5757
- name: Set up Python
5858
uses: actions/setup-python@v2
5959
with:
60-
python-version: 3.8
60+
python-version: 3.9
6161
- name: Install dependencies
6262
run: |
6363
python -m pip install --upgrade pip

‎.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ build
55
executable
66
.DS_Store
77
*.a.dSYM
8-
gdbgui.spec
8+
gdbgui_pyinstaller.spec
99
*-link
1010
*-link.c
1111
*-link.dSYM
1212
*.pyc
1313
yarn-error.log
1414
venv
15-
.vscode
1615
site
1716
gdbgui/static/js/*
1817
__pycache__

‎.vscode/settings.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"python.formatting.provider": "black",
3+
"[python]": {
4+
"editor.formatOnSave": true
5+
},
6+
"[json]": {
7+
"editor.formatOnSave": true
8+
},
9+
"files.associations": {
10+
"*.spec": "python"
11+
}
12+
}

‎CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# gdbgui release history
22

3+
## 0.15.0.0
4+
5+
No new features, just bugfixes and compatibility fixes
6+
7+
- Support only Python 3.9 (though other Python versions may work)
8+
- Use only the threading async model for flask-socketio. No longer support gevent or eventlet.
9+
- [bugfix] Catch exception if gdb used in tty window crashes instead of gdbgui crashing along with it
10+
- Disable pagination in gdb ttyy by default. It can be turned back on with `set pagination off`.
11+
- Upgrade various dependencies for both the backend and frontend (Python and JavaScript)
12+
313
## 0.14.0.2
414

515
- Pinned python-socketio version

‎MANIFEST.in

+4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ graft gdbgui
88
graft gdbgui/static/js
99

1010
prune examples
11+
prune .vscode
1112
prune downloads
1213
prune screenshots
1314
prune tests
1415
prune docs
1516
prune docker
1617
prune images
1718
prune gdbgui/__pycache__
19+
prune gdbgui/server/__pycache__
20+
prune gdbgui/src/
1821

1922
exclude mypy.ini
2023
exclude .eslintrc.json
@@ -26,6 +29,7 @@ exclude jest.config.js
2629
exclude make_executable.py
2730
exclude mkdocs.yml
2831
exclude package.json
32+
exclude requirements.in
2933
exclude requirements.txt
3034
exclude tsconfig.json
3135
exclude tslint.json

‎docs/contact.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
* Twitter: @grassfedcode
2-
* Email: grassfedcode@gmail.com
1+
* Email: chadsmith.software@gmail.com

‎docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ gdbgui is distributed through
8585

8686
## Contact
8787

88-
grassfedcode@gmail.com
88+
chadsmith.software@gmail.com

‎gdbgui/VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.14.0.2
1+
0.15.0.0

‎gdbgui/cli.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222

2323
logger = logging.getLogger(__name__)
24-
logger.setLevel(logging.WARNING)
25-
logging.basicConfig(format="(%(asctime)s) %(msg)s")
24+
logging.getLogger("werkzeug").setLevel(logging.ERROR)
2625

2726

2827
def get_gdbgui_auth_user_credentials(auth_file, user, password):
@@ -245,6 +244,8 @@ def main():
245244
"and https://sourceware.org/gdb/onlinedocs/gdb/Starting.html"
246245
)
247246

247+
logger.setLevel(logging.DEBUG if args.debug else logging.INFO)
248+
248249
run_server(
249250
app=app,
250251
socketio=socketio,

‎gdbgui/server/ptylib.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ def read(self) -> Optional[str]:
7474
timeout_sec = 0
7575
(data_to_read, _, _) = select.select([self.stdout], [], [], timeout_sec)
7676
if data_to_read:
77-
response = os.read(self.stdout, self.max_read_bytes).decode()
77+
try:
78+
response = os.read(self.stdout, self.max_read_bytes).decode()
79+
except OSError:
80+
return None
7881
return response
7982
return None
8083

‎gdbgui/server/server.py

+3-16
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,8 @@ def run_server(
6464
protocol = "http://"
6565
url_with_prefix = "http://" + url
6666

67-
if debug:
68-
async_mode = "eventlet"
69-
else:
70-
async_mode = "gevent"
71-
72-
socketio.server_options["async_mode"] = async_mode
73-
try:
74-
socketio.init_app(app)
75-
except Exception:
76-
print(
77-
'failed to initialize socketio app with async mode "%s". Continuing with async mode "threading".'
78-
% async_mode
79-
)
80-
socketio.server_options["async_mode"] = "threading"
81-
socketio.init_app(app)
67+
socketio.server_options["allow_upgrades"] = False
68+
socketio.init_app(app)
8269

8370
if testing is False:
8471
if host == DEFAULT_HOST:
@@ -103,7 +90,7 @@ def run_server(
10390
)
10491

10592
print("exit gdbgui by pressing CTRL+C")
106-
93+
os.environ["WERKZEUG_RUN_MAIN"] = "true"
10794
try:
10895
socketio.run(
10996
app,

‎gdbgui/src/js/TopBar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let show_license = function() {
3535
</p>
3636
<p>
3737
If you wish to redistribute gdbgui as part of a closed source product, you can do
38-
so for a fee. Contact grassfedcode@gmail.com for details.
38+
so for a fee. Contact chadsmith.software@gmail.com for details.
3939
</p>
4040
</React.Fragment>
4141
);
@@ -45,7 +45,7 @@ let About = {
4545
show_about: function() {
4646
Actions.show_modal(
4747
"About gdbgui",
48-
<React.Fragment>Copyright © Chad Smith, grassfedcode.com</React.Fragment>
48+
<React.Fragment>Copyright © Chad Smith, chadsmith.dev</React.Fragment>
4949
);
5050
}
5151
};

‎gdbgui/src/js/dashboard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class Dashboard extends React.PureComponent<any, { sessions: GdbguiSession[] }>
242242
<footer className="h-40 bold text-lg bg-black text-gray-500 text-center flex flex-col justify-center">
243243
<p>gdbgui</p>
244244
<p>The browser-based frontend to gdb</p>
245-
<a href="https://grassfedcode.com">Copyright Chad Smith</a>
245+
<a href="https://chadsmith.dev">Copyright Chad Smith</a>
246246
</footer>
247247
</div>
248248
);

‎make_executable.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525

2626
def write_spec_with_gdbgui_version_in_name(spec_path, binary_name):
2727

28-
spec = f"""# -*- mode: python -*-
29-
30-
# create executable with: pyinstaller gdbgui.spec
31-
# run executable with: dist/gdbgui
28+
spec = f"""# This pyinstaller spec file was generated by {__file__}
3229
3330
block_cipher = None
3431
@@ -42,12 +39,8 @@ def write_spec_with_gdbgui_version_in_name(spec_path, binary_name):
4239
('./gdbgui/VERSION.txt*', './')
4340
],
4441
hiddenimports=[
45-
'engineio.async_gevent',
4642
'engineio.async_threading',
47-
'engineio.async_drivers.gevent',
4843
'engineio.async_drivers.threading',
49-
'engineio.async_drivers.eventlet',
50-
'engineio.async_drivers.gevent_uwsgi',
5144
'pkg_resources.py2_warn',
5245
],
5346
hookspath=[],
@@ -98,7 +91,7 @@ def generate_md5(binary: Path, output_file: Path):
9891

9992
def main():
10093
binary_name = "gdbgui_%s" % __version__
101-
spec_path = "gdbgui.spec"
94+
spec_path = "gdbgui_pyinstaller.spec"
10295
distpath = (Path("executable") / platform_dir).resolve()
10396
extension = ".exe" if platform == "win32" else ""
10497
binary_path = Path(distpath) / f"{binary_name}{extension}"

‎mkdocs.yml

+5
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ markdown_extensions:
2424
- admonition # note blocks, warning blocks -- https://github.com/mkdocs/mkdocs/issues/1659
2525
- markdown.extensions.codehilite:
2626
guess_lang: false
27+
28+
extra:
29+
analytics:
30+
provider: google
31+
property: UA-90243909-2

‎noxfile.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
nox.options.reuse_existing_virtualenvs = True
99
nox.options.sessions = ["tests", "lint", "docs"]
10-
python = ["3.6", "3.7", "3.8"]
10+
python = ["3.9"]
11+
1112
prettier_command = [
1213
"npx",
1314
"prettier@1.19.1",
@@ -90,7 +91,9 @@ def lint(session):
9091
session.run("flake8", *files_to_lint)
9192
session.run("mypy", *files_to_lint)
9293
vulture(session)
93-
session.run("check-manifest", "--ignore", "gdbgui/static/js/*")
94+
session.run(
95+
"check-manifest", "--ignore", "gdbgui/static/js/*", "--ignore", "*pycache*"
96+
)
9497
session.run("python", "setup.py", "check", "--metadata", "--strict")
9598
session.run(*prettier_command, "--check", external=True)
9699

@@ -157,7 +160,7 @@ def publish_docs(session):
157160
def build_executable_current_platform(session):
158161
session.run("yarn", "install", external=True)
159162
session.run("yarn", "build", external=True)
160-
session.install(".", "PyInstaller<3.7")
163+
session.install(".", "PyInstaller>=4.5, <4.6")
161164
session.run("python", "make_executable.py")
162165

163166

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"dependencies": {
1313
"react": "^16.8",
1414
"react-dom": "^16.4",
15-
"socket.io": "2.0.3",
16-
"socket.io-client": "2.0.3",
15+
"socket.io": "^4.1",
16+
"socket.io-client": "^4.1",
1717
"statorgfc": "^0.1.6",
1818
"xterm": "4.8.0",
1919
"xterm-addon-fit": "^0.4.0",

‎requirements.in

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Flask-SocketIO>5.1, <5.2
2+
Flask-Compress>1.10, <1.11
3+
pygdbmi>=0.10.0.0, <0.11
4+
Pygments>=2.2.0, <3.0

‎requirements.txt

+36-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1-
# https://caremad.io/posts/2013/07/setup-vs-requirement/
2-
--index-url https://pypi.org/simple/
3-
-e .
1+
#
2+
# This file is autogenerated by pip-compile with python 3.9
3+
# To update, run:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
bidict==0.21.2
8+
# via python-socketio
9+
brotli==1.0.9
10+
# via flask-compress
11+
click==8.0.1
12+
# via flask
13+
flask==2.0.1
14+
# via
15+
# flask-compress
16+
# flask-socketio
17+
flask-compress==1.10.1
18+
# via -r requirements.in
19+
flask-socketio==5.1.1
20+
# via -r requirements.in
21+
itsdangerous==2.0.1
22+
# via flask
23+
jinja2==3.0.1
24+
# via flask
25+
markupsafe==2.0.1
26+
# via jinja2
27+
pygdbmi==0.10.0.1
28+
# via -r requirements.in
29+
pygments==2.10.0
30+
# via -r requirements.in
31+
python-engineio==4.2.1
32+
# via python-socketio
33+
python-socketio==5.4.0
34+
# via flask-socketio
35+
werkzeug==2.0.1
36+
# via flask

‎setup.py

+6-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22

33
import os
4+
import distutils.text_file
45

56
USING_WINDOWS = os.name == "nt"
67
if USING_WINDOWS:
@@ -26,7 +27,7 @@
2627
name="gdbgui",
2728
version=VERSION,
2829
author="Chad Smith",
29-
author_email="grassfedcode@gmail.com",
30+
author_email="chadsmith.software@gmail.com",
3031
description="Browser-based frontend to gdb. Debug C, C++, Go, or Rust.",
3132
long_description=README,
3233
long_description_content_type="text/markdown",
@@ -58,18 +59,9 @@
5859
]
5960
},
6061
zip_safe=False,
61-
install_requires=[
62-
"Flask>=0.12.2, <1.0", # http server
63-
"Flask-Compress>=1.4.0, <2.0", # to compress flask responses
64-
"Flask-SocketIO>=2.9, <3.0", # websocket server
65-
"gevent>=1.2.2, <2.0", # websocket handling
66-
"gevent-websocket>=0.10.1, <0.11", # also websocket
67-
"eventlet>=0.25.0, <0.26", # also websocket
68-
"pygdbmi>=0.10.0.0b0, <0.11", # parse gdb output
69-
"Pygments>=2.2.0, <3.0", # syntax highlighting
70-
"greenlet==0.4.16",
71-
"python-socketio>=4.6.1, <5.0", # pinned to use socketio 2 under the hood (issue #366)
72-
],
62+
install_requires=distutils.text_file.TextFile(
63+
filename="./requirements.in"
64+
).readlines(),
7365
classifiers=[
7466
"Intended Audience :: Developers",
7567
"Operating System :: MacOS",
@@ -78,9 +70,7 @@
7870
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
7971
"Programming Language :: Python",
8072
"Programming Language :: Python :: 3",
81-
"Programming Language :: Python :: 3.6",
82-
"Programming Language :: Python :: 3.7",
83-
"Programming Language :: Python :: 3.8",
73+
"Programming Language :: Python :: 3.9",
8474
],
8575
python_requires=">=3.6",
8676
project_urls={

‎yarn.lock

+1,077-973
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.