update dependencies, support Python 3.9 (#400)

This commit is contained in:
Chad Smith 2021-08-28 21:27:42 -07:00 committed by GitHub
parent c1f337d10b
commit 0e636d5426
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 1169 additions and 1022 deletions

View file

@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8]
python-version: [3.9]
include:
- os: ubuntu-latest
buildname: linux

View file

@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.6, 3.7, 3.8]
python-version: [3.9]
steps:
- uses: actions/checkout@v2
@ -41,7 +41,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
@ -57,7 +57,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip

3
.gitignore vendored
View file

@ -5,14 +5,13 @@ build
executable
.DS_Store
*.a.dSYM
gdbgui.spec
gdbgui_pyinstaller.spec
*-link
*-link.c
*-link.dSYM
*.pyc
yarn-error.log
venv
.vscode
site
gdbgui/static/js/*
__pycache__

12
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,12 @@
{
"python.formatting.provider": "black",
"[python]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"files.associations": {
"*.spec": "python"
}
}

View file

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

View file

@ -8,6 +8,7 @@ graft gdbgui
graft gdbgui/static/js
prune examples
prune .vscode
prune downloads
prune screenshots
prune tests
@ -15,6 +16,8 @@ prune docs
prune docker
prune images
prune gdbgui/__pycache__
prune gdbgui/server/__pycache__
prune gdbgui/src/
exclude mypy.ini
exclude .eslintrc.json
@ -26,6 +29,7 @@ exclude jest.config.js
exclude make_executable.py
exclude mkdocs.yml
exclude package.json
exclude requirements.in
exclude requirements.txt
exclude tsconfig.json
exclude tslint.json

View file

@ -1,2 +1 @@
* Twitter: @grassfedcode
* Email: grassfedcode@gmail.com
* Email: chadsmith.software@gmail.com

View file

@ -85,4 +85,4 @@ gdbgui is distributed through
## Contact
grassfedcode@gmail.com
chadsmith.software@gmail.com

View file

@ -1 +1 @@
0.14.0.2
0.15.0.0

View file

@ -21,8 +21,7 @@ from gdbgui.server.server import run_server
logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING)
logging.basicConfig(format="(%(asctime)s) %(msg)s")
logging.getLogger("werkzeug").setLevel(logging.ERROR)
def get_gdbgui_auth_user_credentials(auth_file, user, password):
@ -245,6 +244,8 @@ def main():
"and https://sourceware.org/gdb/onlinedocs/gdb/Starting.html"
)
logger.setLevel(logging.DEBUG if args.debug else logging.INFO)
run_server(
app=app,
socketio=socketio,

View file

@ -74,7 +74,10 @@ class Pty:
timeout_sec = 0
(data_to_read, _, _) = select.select([self.stdout], [], [], timeout_sec)
if data_to_read:
response = os.read(self.stdout, self.max_read_bytes).decode()
try:
response = os.read(self.stdout, self.max_read_bytes).decode()
except OSError:
return None
return response
return None

View file

@ -64,21 +64,8 @@ def run_server(
protocol = "http://"
url_with_prefix = "http://" + url
if debug:
async_mode = "eventlet"
else:
async_mode = "gevent"
socketio.server_options["async_mode"] = async_mode
try:
socketio.init_app(app)
except Exception:
print(
'failed to initialize socketio app with async mode "%s". Continuing with async mode "threading".'
% async_mode
)
socketio.server_options["async_mode"] = "threading"
socketio.init_app(app)
socketio.server_options["allow_upgrades"] = False
socketio.init_app(app)
if testing is False:
if host == DEFAULT_HOST:
@ -103,7 +90,7 @@ def run_server(
)
print("exit gdbgui by pressing CTRL+C")
os.environ["WERKZEUG_RUN_MAIN"] = "true"
try:
socketio.run(
app,

View file

@ -35,7 +35,7 @@ let show_license = function() {
</p>
<p>
If you wish to redistribute gdbgui as part of a closed source product, you can do
so for a fee. Contact grassfedcode@gmail.com for details.
so for a fee. Contact chadsmith.software@gmail.com for details.
</p>
</React.Fragment>
);
@ -45,7 +45,7 @@ let About = {
show_about: function() {
Actions.show_modal(
"About gdbgui",
<React.Fragment>Copyright © Chad Smith, grassfedcode.com</React.Fragment>
<React.Fragment>Copyright © Chad Smith, chadsmith.dev</React.Fragment>
);
}
};

View file

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

View file

@ -25,10 +25,7 @@ else:
def write_spec_with_gdbgui_version_in_name(spec_path, binary_name):
spec = f"""# -*- mode: python -*-
# create executable with: pyinstaller gdbgui.spec
# run executable with: dist/gdbgui
spec = f"""# This pyinstaller spec file was generated by {__file__}
block_cipher = None
@ -42,12 +39,8 @@ a = Analysis(['gdbgui/cli.py'], # noqa
('./gdbgui/VERSION.txt*', './')
],
hiddenimports=[
'engineio.async_gevent',
'engineio.async_threading',
'engineio.async_drivers.gevent',
'engineio.async_drivers.threading',
'engineio.async_drivers.eventlet',
'engineio.async_drivers.gevent_uwsgi',
'pkg_resources.py2_warn',
],
hookspath=[],
@ -98,7 +91,7 @@ def generate_md5(binary: Path, output_file: Path):
def main():
binary_name = "gdbgui_%s" % __version__
spec_path = "gdbgui.spec"
spec_path = "gdbgui_pyinstaller.spec"
distpath = (Path("executable") / platform_dir).resolve()
extension = ".exe" if platform == "win32" else ""
binary_path = Path(distpath) / f"{binary_name}{extension}"

View file

@ -24,3 +24,8 @@ markdown_extensions:
- admonition # note blocks, warning blocks -- https://github.com/mkdocs/mkdocs/issues/1659
- markdown.extensions.codehilite:
guess_lang: false
extra:
analytics:
provider: google
property: UA-90243909-2

View file

@ -7,7 +7,8 @@ import nox # type: ignore
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ["tests", "lint", "docs"]
python = ["3.6", "3.7", "3.8"]
python = ["3.9"]
prettier_command = [
"npx",
"prettier@1.19.1",
@ -90,7 +91,9 @@ def lint(session):
session.run("flake8", *files_to_lint)
session.run("mypy", *files_to_lint)
vulture(session)
session.run("check-manifest", "--ignore", "gdbgui/static/js/*")
session.run(
"check-manifest", "--ignore", "gdbgui/static/js/*", "--ignore", "*pycache*"
)
session.run("python", "setup.py", "check", "--metadata", "--strict")
session.run(*prettier_command, "--check", external=True)
@ -157,7 +160,7 @@ def publish_docs(session):
def build_executable_current_platform(session):
session.run("yarn", "install", external=True)
session.run("yarn", "build", external=True)
session.install(".", "PyInstaller<3.7")
session.install(".", "PyInstaller>=4.5, <4.6")
session.run("python", "make_executable.py")

View file

@ -12,8 +12,8 @@
"dependencies": {
"react": "^16.8",
"react-dom": "^16.4",
"socket.io": "2.0.3",
"socket.io-client": "2.0.3",
"socket.io": "^4.1",
"socket.io-client": "^4.1",
"statorgfc": "^0.1.6",
"xterm": "4.8.0",
"xterm-addon-fit": "^0.4.0",

4
requirements.in Normal file
View file

@ -0,0 +1,4 @@
Flask-SocketIO>5.1, <5.2
Flask-Compress>1.10, <1.11
pygdbmi>=0.10.0.0, <0.11
Pygments>=2.2.0, <3.0

View file

@ -1,3 +1,36 @@
# https://caremad.io/posts/2013/07/setup-vs-requirement/
--index-url https://pypi.org/simple/
-e .
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile requirements.in
#
bidict==0.21.2
# via python-socketio
brotli==1.0.9
# via flask-compress
click==8.0.1
# via flask
flask==2.0.1
# via
# flask-compress
# flask-socketio
flask-compress==1.10.1
# via -r requirements.in
flask-socketio==5.1.1
# via -r requirements.in
itsdangerous==2.0.1
# via flask
jinja2==3.0.1
# via flask
markupsafe==2.0.1
# via jinja2
pygdbmi==0.10.0.1
# via -r requirements.in
pygments==2.10.0
# via -r requirements.in
python-engineio==4.2.1
# via python-socketio
python-socketio==5.4.0
# via flask-socketio
werkzeug==2.0.1
# via flask

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python
import os
import distutils.text_file
USING_WINDOWS = os.name == "nt"
if USING_WINDOWS:
@ -26,7 +27,7 @@ setup(
name="gdbgui",
version=VERSION,
author="Chad Smith",
author_email="grassfedcode@gmail.com",
author_email="chadsmith.software@gmail.com",
description="Browser-based frontend to gdb. Debug C, C++, Go, or Rust.",
long_description=README,
long_description_content_type="text/markdown",
@ -58,18 +59,9 @@ setup(
]
},
zip_safe=False,
install_requires=[
"Flask>=0.12.2, <1.0", # http server
"Flask-Compress>=1.4.0, <2.0", # to compress flask responses
"Flask-SocketIO>=2.9, <3.0", # websocket server
"gevent>=1.2.2, <2.0", # websocket handling
"gevent-websocket>=0.10.1, <0.11", # also websocket
"eventlet>=0.25.0, <0.26", # also websocket
"pygdbmi>=0.10.0.0b0, <0.11", # parse gdb output
"Pygments>=2.2.0, <3.0", # syntax highlighting
"greenlet==0.4.16",
"python-socketio>=4.6.1, <5.0", # pinned to use socketio 2 under the hood (issue #366)
],
install_requires=distutils.text_file.TextFile(
filename="./requirements.in"
).readlines(),
classifiers=[
"Intended Audience :: Developers",
"Operating System :: MacOS",
@ -78,9 +70,7 @@ setup(
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
python_requires=">=3.6",
project_urls={

2018
yarn.lock

File diff suppressed because it is too large Load diff