Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dependencies, support Python3.9 #400

Merged
merged 9 commits into from
Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_executable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"python.formatting.provider": "black",
"[python]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"files.associations": {
"*.spec": "python"
}
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ graft gdbgui
graft gdbgui/static/js

prune examples
prune .vscode
prune downloads
prune screenshots
prune tests
prune docs
prune docker
prune images
prune gdbgui/__pycache__
prune gdbgui/server/__pycache__
prune gdbgui/src/

exclude mypy.ini
exclude .eslintrc.json
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions docs/contact.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* Twitter: @grassfedcode
* Email: [email protected]
* Email: [email protected]
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ gdbgui is distributed through

## Contact

grassfedcode@gmail.com
chadsmith.software@gmail.com
2 changes: 1 addition & 1 deletion gdbgui/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.14.0.2
0.15.0.0
5 changes: 3 additions & 2 deletions gdbgui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@


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):
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion gdbgui/server/ptylib.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def read(self) -> Optional[str]:
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

Expand Down
19 changes: 3 additions & 16 deletions gdbgui/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -103,7 +90,7 @@ def run_server(
)

print("exit gdbgui by pressing CTRL+C")

os.environ["WERKZEUG_RUN_MAIN"] = "true"
try:
socketio.run(
app,
Expand Down
4 changes: 2 additions & 2 deletions gdbgui/src/js/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand All @@ -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>
);
}
};
Expand Down
2 changes: 1 addition & 1 deletion gdbgui/src/js/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand Down
11 changes: 2 additions & 9 deletions make_executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@

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

Expand All @@ -42,12 +39,8 @@ def write_spec_with_gdbgui_version_in_name(spec_path, binary_name):
('./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=[],
Expand Down Expand Up @@ -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}"
Expand Down
5 changes: 5 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 6 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

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",
"[email protected]",
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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")


Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -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
39 changes: 36 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
22 changes: 6 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import os
import distutils.text_file

USING_WINDOWS = os.name == "nt"
if USING_WINDOWS:
Expand All @@ -26,7 +27,7 @@
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",
Expand Down Expand Up @@ -58,18 +59,9 @@
]
},
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",
Expand All @@ -78,9 +70,7 @@
"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={
Expand Down
Loading