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

feat: reorg as package #41

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IDD loads two versions of the same application. The first one is the base versio
## :zap: Usage
Write about how to use this project.

`python3 idd.py -c gdb -ba <path to base executable> -ra <path to regressed executable>`
`python -m idd -c gdb -ba <path to base executable> -ra <path to regressed executable>`

### :electric_plug: Installation
- Steps on how to install this project on Ubuntu 22.04
Expand All @@ -27,7 +27,7 @@ $ source iddenv/bin/activate
-- Installing required packages:

```
$ pip3 install textual textual_inputs pygdbmi
$ pip install -e.
```

## :cherry_blossom: Community
Expand Down
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "idd"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
authors = [
{ name = "Martin Vassilev" },
{ name = "Vassil Vassilev" },
{ name = "Alexander Penev" },
]
requires-python = ">=3.9"
dependencies = [
"pygdbmi",
"rich",
"textual",
]


[project.scripts]
idd = "idd.cli:main"
12 changes: 0 additions & 12 deletions requirements.txt

This file was deleted.

File renamed without changes.
4 changes: 4 additions & 0 deletions src/idd/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from idd.cli import main

if __name__ == "__main__":
main()
14 changes: 7 additions & 7 deletions idd.py → src/idd/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from textual.widgets import Input
from textual.containers import Horizontal, Vertical

from diff_driver import DiffDriver
from idd.diff_driver import DiffDriver

from ui.footer import Footer
from ui.header import Header
from ui.scrollable_area import TextScrollView
from idd.ui.footer import Footer
from idd.ui.header import Header
from idd.ui.scrollable_area import TextScrollView


class DiffDebug(App):
Expand Down Expand Up @@ -379,7 +379,7 @@ async def on_key(self, event: events.Key) -> None:
self.regressed_command_bar.value = self.regressed_history[self.regressed_history_index]


if __name__ == "__main__":
def main() -> None:
Debugger = None

parser = argparse.ArgumentParser(description='Diff Debug for simple debugging!')
Expand Down Expand Up @@ -407,7 +407,7 @@ async def on_key(self, event: events.Key) -> None:
rs = ' '.join(args['regression_script_path']) if args["regression_script_path"] is not None else None

if comparator == 'gdb':
from debuggers.gdb.gdb_mi_driver import GDBMiDebugger
from idd.debuggers.gdb.gdb_mi_driver import GDBMiDebugger

if ba != "" and bpid is not None:
raise Exception("Both executable and process ID given for base. This is not possible")
Expand All @@ -426,7 +426,7 @@ async def on_key(self, event: events.Key) -> None:
Debugger = GDBMiDebugger(ba, bs, ra, rs)

elif comparator == 'lldb':
from debuggers.lldb.lldb_driver import LLDBParallelDebugger
from idd.debuggers.lldb.lldb_driver import LLDBParallelDebugger

if ba == "" or ra == "":
raise Exception("LLDB can only be used by launching executable and executable is not provided")
Expand Down
Empty file added src/idd/debuggers/__init__.py
Empty file.
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pygdbmi.gdbcontroller import GdbController
from pprint import pprint
from driver import Driver
from idd.driver import Driver

import io
import time
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import json

from debuggers.gdb.idd_gdb_controller import create_IDDGdbController, terminate_all_IDDGdbController
from driver import Driver
from idd.debuggers.gdb.idd_gdb_controller import create_IDDGdbController, terminate_all_IDDGdbController
from idd.driver import Driver

from debuggers.gdb.utils import parse_gdb_line
from idd.debuggers.gdb.utils import parse_gdb_line

base_response = []
regressed_response = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import subprocess

from driver import IDDParallelTerminate
from idd.driver import IDDParallelTerminate
from pygdbmi.gdbcontroller import GdbController
from pygdbmi.IoManager import IoManager
from pygdbmi.constants import (
Expand Down
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import lldb

from driver import Driver, IDDParallelTerminate
from debuggers.lldb.lldb_extensions import *
from idd.driver import Driver, IDDParallelTerminate
from idd.debuggers.lldb.lldb_extensions import *
from multiprocessing import Process, Pipe


Expand Down
3 changes: 1 addition & 2 deletions diff_driver.py → src/idd/diff_driver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import difflib
from differ import Differ
from idd.differ import Differ

class DiffDriver:
def get_diff(self, a, b, typ):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion driver.py → src/idd/driver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import abc
from abc import ABCMeta, abstractmethod
from abc import abstractmethod

class Driver(metaclass=abc.ABCMeta):
@abstractmethod
Expand Down
File renamed without changes.
Empty file added src/idd/py.typed
Empty file.
Empty file added src/idd/ui/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
144 changes: 144 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.