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

[WIP - DO NOT USE] Pythonic and simpler refactor of wemod-launcher #105

Draft
wants to merge 65 commits into
base: main
Choose a base branch
from

Conversation

shymega
Copy link
Contributor

@shymega shymega commented Jul 12, 2024

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!

@shymega shymega force-pushed the refactor-shymega branch 5 times, most recently from 0c68a15 to 726cc67 Compare July 13, 2024 01:48
requirements.txt Outdated Show resolved Hide resolved
@@ -9,7 +9,7 @@ import subprocess
from typing import Optional

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving this file may break backwards compat,
well i guess its fiine but i just want to reduce the amount of work,
if we change it all then the users will all report nothing happens,
something to think on.
Realy keep in mind that on windows wemod is as simple as installing one file,
therefore the idea that most users are unexperienced is not far off,
just keep that in mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will, but with Python conventions, it's better to either have cli.py or __main__.py. I'm going with the former, and yes, it will break, but we'll be making a semver v2.0.0 release - and maybe post on Reddit?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well a post might work,
well the thing is i have not done anything related to social media,
so i don't have any idea whats going on there.
Well i do use social media but not anything related to the wemod-launcher.
Just so you know that this is something you might have to look for yourself.

@shymega shymega force-pushed the refactor-shymega branch 3 times, most recently from f4967fc to 27e5f0b Compare July 13, 2024 10:51
@marvin1099
Copy link
Collaborator

In general keep in mind by refactoring this,
you are also then responsible for this code,
the thing is the fact you are making is nice,
but my coding skills are not close to yours,
therefore I only somewhat understand your code,
but since somewhat wont be enough to fix all bugs the new code is your responsibility.

Just keep that in mind.

@shymega shymega force-pushed the refactor-shymega branch 2 times, most recently from 2d8d1ba to a60dd52 Compare July 13, 2024 13:28
@shymega
Copy link
Contributor Author

shymega commented Jul 13, 2024

In general keep in mind by refactoring this, you are also then responsible for this code, the thing is the fact you are making is nice, but my coding skills are not close to yours, therefore I only somewhat understand your code, but since somewhat wont be enough to fix all bugs the new code is your responsibility.

Just keep that in mind.

Understood. I'll be contributing a Nix package upstream too, and as I use WeMod on my gaming sessions - this project is a motivation.

- 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]>
Temporary commit. To be reworded. TODO! FIXME!

Signed-off-by: Dom Rodriguez <[email protected]>
As per review.

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]>
@marvin1099
Copy link
Collaborator

As I have mentioned in the dms,
I was wondering why you went for Poetry.
I have nothing against this, but it just adds a lot of complexity and additional dependencies for for running the wemod-launcher script (as source) that is otherwise simple.

The thing is i would be nice if you would use a bit of a simpler system if possible.
From all i can gather Poetry is a dependency manager,
right now we just use a requirements.txt
and the script itself also makes sure to run in the env if needed.

So what i want to say is please just rethink that a bit.

I think probably the biggest issue that the launcher has is really all the slapped in code (spageti code).
Just my thoughts here and i don't expect you to fix all the old code, just wanted to share my thoughts and like to hear what you think.

Almost the same message as before but now it more transparent.

@shymega
Copy link
Contributor Author

shymega commented Nov 13, 2024 via email

@marvin1099
Copy link
Collaborator

So @shymega I did check a bit of things and came across
https://github.com/pdm-project/pdm
This is somewhat similar to poetry but seems to use a bunch of pep standards to achieve it.
So I like it, how do you stand on that?

The main advantage I think is that since it uses pep standards, we are not locked on that tool.

Also tidy up Flake, use `devenv` inside Flake (and update .envrc), as
well as restructuring project layout

Signed-off-by: Dom Rodriguez <[email protected]>
@shymega
Copy link
Contributor Author

shymega commented Nov 16, 2024

Agreed - got it working with Nix, and I think I quite like pdm. Pushed.

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.

2 participants