Skip to content

Heavy refactoring - #1691

Merged
Furtif merged 30 commits into
cedricp:masterfrom
jyte:refactor
Apr 9, 2026
Merged

Furtif merged 30 commits into
cedricp:masterfrom
jyte:refactor

Conversation

@jyte

@jyte jyte commented Mar 2, 2026 •

Copy link
Copy Markdown

Hello,

I wanted to try to add AppImage build but i noticed that the source code was in my opinion a bit of a mess. So I took on me to reorganise the whole thing first.

  • src directory now hold the program source code + resources (static assets like icons and projects.json)
  • I tried to follow python pep8. Mostly :
    • directory and files naming
    • Renamed classes to UpperCamelCase
  • Include few fixes regarding linter warning. Mostly :
  • Imports are clearer
  • Files were too big. I split them up to have smaller files

Hopefully I didn't break anything within the program, it seems to run. I mostly just moved things around and did not change any logic.

I believe things related to PO might be somehow broken as I did not fully understand how it worked, I didn't touch anything regarding that.

Building the windows installer may also be broken. I only have linux at hand so I don't know and I cannot test.

Last, to run the software from the repo, you now need to

cd src
python -m ddt4all

Once (if) this get merged. I plan to :

  • Use platformdirs so we store config file and logs elsewhere than the install directory
  • Previous point is needed to have an AppImage build because it's a readonly image.

I'm open for comments

@jyte

jyte commented Mar 3, 2026 •

Copy link
Copy Markdown
Author

Well, I guess this is not ready for merge just yet. I'll add a little rework regarding relative filepath (the platformdirs thing).

As of now, json and logs directories as well as config.json file will be created in a directory that depend of where you start the program. That's bad and causes me issues for other stuff.

Also, the config file was commited by mistake. I'll fix that.

@jyte
jyte marked this pull request as draft March 4, 2026 09:35
@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@jyte

jyte commented Mar 10, 2026 •

Copy link
Copy Markdown
Author

Summary of changes

  • src directory now hold the program source code
  • resources holds static assets like icons & styles
  • I tried to follow python pep8. Mostly :
    • directory and files naming
    • Renamed classes to UpperCamelCase
  • Include few fixes regarding linter warning. Mostly :
  • Imports are clearer
  • Files were too big. I split them up to have smaller files
  • Converted requirement.txt to a more up to date pyproject.toml
    • pyproject.toml allow to run the software simply by running ddt4all
    • It can install the program dependencies and the dev dependencies separately
  • Qt resources (icons) are now loaded by src/ddt4all/generated/resources_rc.py (which is the proper way to do)
    • src/ddt4all/generated/resources_rc.py is compiled from resources.qrc.
    • scripts/gen_qrc.py is a script that allow to generate resources.qrc and compile it automatically
  • Translations
    • .po files moved to locales/$lang/LC_MESSAGES
    • scripts/i18n.py replaces the ddt4all_data/tools/*.bat files. Old bat files were windows only, i18n.py should be cross plateform
  • Added automated tests
    • Run pytest from root directory
    • Added code coverage option pytest --cov=ddt4all
    • Github actions run the automated tests on each push
    • Added codecov badge to readme (this will need to be updated for your repo)

What is likely broken after all this

  • Anything related to reading or writing files. Since everything was moved around, relative path have changed and there are a few things I wasn't able to test yet (because I do not have the files or do not understand what or how they are used).
  • Windows installer (I run linux and do not have windows at hand)

If you have time to test a bit and find broken stuff, I will fix them.

@jyte
jyte marked this pull request as ready for review March 10, 2026 19:02
@Furtif

Furtif commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

The pull request looks good, but there are still some things missing. For example, take a look at this one: jyte#1.
It’s also worth checking the pull request that is already open regarding DoIP.

With the way you’re doing it now, the final result will end up being something that doesn’t really relate to what’s already being worked on in those PRs. It might be better to align with those before moving forward.

@Furtif

Furtif commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

It would be good to keep or maintain what is already there so that people who follow the project can read it or at least follow along. I’m not against your ideas (the idea is good, actually quite bold).

@jyte

jyte commented Mar 12, 2026

Copy link
Copy Markdown
Author

report the new locale was an easy fix. I am unsure what's the best way to move forward regarding the other pull request.

Maybe create a new "develop" branch from my PR then have a new PR to report DoIP to the new develop branch ?

If that PR is not merged yet, I assume that's because it's not ready yet

@Furtif

Furtif commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

Yes, it's not ready yet. I did this in experimental mode and it needs several fixes.

Furtif added a commit that referenced this pull request Apr 9, 2026
Heavy refactoring (Init DoIP implementation with Electric ECU close #1984 and #1691)
@Furtif
Furtif merged commit 806c536 into cedricp:master Apr 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants