-
Notifications
You must be signed in to change notification settings - Fork 13
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
[WIP - DO NOT USE] Pythonic and simpler refactor of wemod-launcher
#138
base: main
Are you sure you want to change the base?
Conversation
- Set +x on prepare.py (prev. setup.py). - Set +x on wemod (symlinked to wemod.py as well). - Rename setup.py -> prepare.py - otherwise conflicts - Pythonize modules. Signed-off-by: Dom Rodriguez <[email protected]>
This commit updates the names of imports from previously renamed modules. Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Temporary commit. To be reworded. TODO! FIXME! Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
TOML is easier to read, and I hated dealing with YAML. PyYAML bad. Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Signed-off-by: Dom Rodriguez <[email protected]>
Also tidy up Flake, use `devenv` inside Flake (and update .envrc), as well as restructuring project layout Signed-off-by: Dom Rodriguez <[email protected]>
Add warning for using this refactor onto the readme
Update the refactor with spell + licence change
Refactor spelling and licence update
I moved the nix files into ./tools/nix/ I also pushed the newest update and the license change to the refactor. Oh yes there are some helper scripts for running the wemod launcher script in ./script/ now. |
Replaced poetry with PDM in pyinstaller.py Added build helper script Added PDM fail check in helper scripts
This new version uses the following syntax. # First you import as usual from consts import Constants # Then you can use the name of the setting you want like this print(Constants.ConfigDir) Very simple and intuitive Some Of the constants are not jet added, right now there are only constants in here that can be defined without any other module. So, some of the important constants still have to be added
The change of the config manager makes it now use: from configuration import ConfigManager as Conf Conf.LogFolder = "/test/path/" print(Conf.LogFolder) As this just saves the provided key something like this would work: Conf.VeryLongRandomKeyHere = "mysetting" To be implemented is a custom logger In this file we still need saving and loading with the tomllib
I refactored const and configuration to work with instances, its just a bit simpler in the const and configuration files. A custom logger is now also added. Here is a example: from consts import Constants from configuration import ConfigManager from logger import Logger CT = Constants() # Get a const instance CM = ConfigManager() # Get a conf instance LG = Logger() # Get a logger instance print(CT.config_path) # print config path print(CM.log_name) # print active log file LG.info("Test message", "test") # Push a log message from module "test" CE = ConfigManager(env_vars=True,cmd=True) # load environment variables (priority) too print(CE.XDG_CACHE_HOME) # print a env var
I think I would rather you push your commits to your own branch, based off my PR, and create PRs from your branch's HEAD, to my PR. Otherwise with my force-pushing, you will lose your changes. As for the Nix changes, this isn't how Nix works. It breaks everything. I propose you checkout a new branch locally on your machine, and once you've done that, create a PR with the base branch set to this PR and the HEAD set to your new branch. Then we can merge things into this master branch as we go. |
So make changes on my copy and then merge them to this branch, shure.
I expected something to break I'm not a nix expert, I was kinda hopping is was not that far off from working, and that you could make it work, Merging into master, well that is still going to take a bit i think. Well as for the fix files can you do something to clean the root up a bit, would be great. |
As shymega pointed out it breaks stuff on nix. I would still like the files to be in a subfolder but im not a nix guy. So shymega hopfully can fugure something out. But for now i will revert that.
For now i reverted the nix file move, if you figure something out it would be nice if you can make it happen. |
Hi! I just forked the repo as I am interested in working on some approaches to automate and improve installation and use. Things like using Poetry and/or Docker. Should I do that off |
Hi @Marakai, This branch is what the future of wemod will be but it is not only WIP I'm also pretty shure it won't run yet, so you may end up trying to figure that out how to run it. But if you want to help for the future then help with the refactor otherwise you can try to make the old and active version in Dev and main as good as they can be, feel free to work on what you like where. |
On 12.01.2025 23:07, Marvin1099 wrote:
> Hi! I just forked the repo as I am interested in working on some approaches to automate and improve installation and use. Things like using Poetry and/or Docker.
>
> Should I do that off `main` or this WIP branch (despite it not being fully usable right now)?
Hi @Marakai,
you can work on this refactor branch (WIP branch) or the Dev branch.
Keep in mind that we actually use pdm not poetry in the this branch, please use that instead.
Also keep in mind that the Dev branch is the working and currently used branch by the comity.
Also the dev / main branch will be deprecated in the future.
This branch is what the future of wemod will be but it is not only WIP I'm also pretty shure it won't run yet, so you may end up trying to figure that out how to run it.
But if you want to help for the future then help with the refactor otherwise you can try to make the old and active version in Dev and main as good as they can be, feel free to work on what you like where.
Hi,
Following up on this:
Please make PRs to this PR's HEAD branch, but be aware rebases will
happen.
As for the main branch, this will be changed to PRs-only, and all
development separated into different branches.
We are not using Poetry, and pdm will be used instead, as Marvin says.
What benefit is there of using Docker for this? I can't see the benefit
- for development? If you're thinking of devcontainers, the Nix stuff
can do this already.
Best wishes,
--
Dom Rodriguez
|
I've been giving this some thought. I think, if you can create a Otherwise, we end up pushing over each other in a PR. Do you mind if I revert some of your commits and remove them from the commit history, just until it's in a better state - the Nix ones, for example. There's also a lot of merge conflicts that weren't there when it was just me pushing - but I can't recall precisely. |
Hi! I will reply in the Help Wanted issue. |
Yep if needed you can revert some stuff, I thought I reverted far enough to make it work. I will make the refactor-marvin branch and add my changes there. |
Hi all!
As mentioned briefly in #100, and discussed over Discord with Marvin, this PR
is a overhaul I'm working on of wemod-launcher.
Testing is welcome once I get to a stage where it can be tested.
However, right now - it's a heavy WIP, and should not be used.
I have marked it as a draft PR.
It's worth noting that Nix is able to build this package on this PR natively,
so that is very cool.
Contributions welcome to my fork as PRs, which will then be pushed to this PR.
(Note: I will be rebasing and force-pushing. Let me know in advance before you
push to this branch if you're a maintainer, as your changes may be lost.)
Thank you!