Skip to content

Commit

Permalink
Mock std library on web-portal main script
Browse files Browse the repository at this point in the history
  • Loading branch information
jcapona committed Aug 13, 2024
1 parent fd4b951 commit c6f8ca7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
args: ["--profile", "black"]

- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black

Expand All @@ -26,14 +26,14 @@ repos:
- id: autopep8

- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
name: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
hooks:
- id: mypy
additional_dependencies: [types-all]
args: ["--ignore-missing-imports", "--install-types", "--non-interactive"]
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.11.1
# hooks:
# - id: mypy
# additional_dependencies: [types-all]
# args: ["--install-types", "--non-interactive"]
1 change: 1 addition & 0 deletions debian/pt-os-web-portal.install
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pt_os_web_portal/rover_controller/pt-os-web-portal-rover-controller /usr/bin/
pt_os_web_portal/pt-os-web-portal /usr/bin/
10 changes: 0 additions & 10 deletions pt_os_web_portal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
from gevent import monkey

monkey.patch_all()

import pitop.common.ptdm # noqa: E402
import zmq.green # noqa: E402

from .version import __version__ # noqa: E402

# Use zmq.green for gevent compatibility
pitop.common.ptdm.zmq = zmq.green
27 changes: 19 additions & 8 deletions pt_os_web_portal/__main__.py → pt_os_web_portal/pt-os-web-portal
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
import logging
from os import geteuid
from signal import SIGINT, SIGTERM
from sys import exit
#!/usr/bin/env python3
from gevent import monkey

import click
import click_logging
from gevent import signal_handler, wait
monkey.patch_all()

from .app import App
import pitop.common.ptdm # noqa: E402
import zmq.green # noqa: E402

# Use zmq.green for gevent compatibility
pitop.common.ptdm.zmq = zmq.green

import logging # noqa: E402
from os import geteuid # noqa: E402
from signal import SIGINT, SIGTERM # noqa: E402
from sys import exit # noqa: E402

import click # noqa: E402
import click_logging # noqa: E402
from gevent import signal_handler, wait # noqa: E402

from pt_os_web_portal.app import App # noqa: E402

logger = logging.getLogger()
click_logging.basic_config(logger)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ include_package_data = True

[options.entry_points]
console_scripts =
pt-os-web-portal=pt_os_web_portal.__main__:main
; pt-os-web-portal=pt_os_web_portal.__main__:main
pt-os-web-portal-frontend=pt_os_web_portal.app_window.__main__:main
; pt-os-web-portal-rover-controller=pt_os_web_portal.rover_controller.__main__:main
pt-os-web-portal-vnc-advanced-wifi=pt_os_web_portal.backend.helpers.vnc_advanced_wifi_gui:main
Expand Down

0 comments on commit c6f8ca7

Please sign in to comment.