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

allow packaging and running from a wheel #780

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adilahmeddev
Copy link
Contributor

I had to move the fonts into the manga_translator package, which is the recommended approach

I don't have much experience with python packaging, but i used UV and let the output of uv build --python 3.11 guide me.

A lot of these changes might not be necassery, the main one that comes to mind is the removal of relative imports in a few of the top level files.

The dependencies block in pyproject.toml currently includes the cuda version of pytorch, it'd be good if the different versions were listed under optional dependencies

…heel

I don't have much experience with python packaging, but i used 'UV' and
let the output of `uv build --python 3.11` guide me
@adilahmeddev
Copy link
Contributor Author

just realised that the versions in requirements.txt are pinned now, will fix it when i have time

@frederik-uni
Copy link
Contributor

Don’t know if it’s possible, but an update script would be kinda nice(if installed from path). I mean it could probably resolve its path from the installed item in the venv to the path on the hard drive. Run got fetch to check for updates. If it found something it could run git pull & reinstall itself.

@adilahmeddev
Copy link
Contributor Author

Don’t know if it’s possible, but an update script would be kinda nice(if installed from path). I mean it could probably resolve its path from the installed item in the venv to the path on the hard drive. Run got fetch to check for updates. If it found something it could run git pull & reinstall itself.

ideally the packaged app would go on pypi and we'd just let pip handle installation/updates

@frederik-uni
Copy link
Contributor

frederik-uni commented Dec 9, 2024

I doubt that every change will be published tho. Installing it as a wheel locally would allow the install to be easier as the depencies will be downloaded automatically & it works as a command or am I wrong, but the published version will probably always be a few months behind(being somewhat stable and all)

That’s why I suggested the local update script. If the source can be detected it could just pip update if needed. I doubt that that would be the issue. Would be quite nice if it could detect if it’s from web or local.

@jokester
Copy link
Contributor

jokester commented Dec 10, 2024

The dependencies block in pyproject.toml

FYI I think this block is not really used now. requirements.txt is the effective dep list for local- and docker- builds.

Till months ago there was a unmaintained poetry-based configuration which may used deps in the toml . It got removed in #708 .

@adilahmeddev
Copy link
Contributor Author

I doubt that every change will be published tho. Installing it as a wheel locally would allow the install to be easier as the depencies will be downloaded automatically & it works as a command or am I wrong, but the published version will probably always be a few months behind(being somewhat stable and all)

That’s why I suggested the local update script. If the source can be detected it could just pip update if needed. I doubt that that would be the issue. Would be quite nice if it could detect if it’s from web or local.

Im a fan of the idea, the script could also remove the need for a pip wheel. We could let the wrapper handle pulling the code and running pip install -r requirements.txt

@zyddnys
Copy link
Owner

zyddnys commented Dec 13, 2024

why all the code format changes?

@adilahmeddev
Copy link
Contributor Author

why all the code format changes?

Sorry, I've been meaning to clean that up but busy with work. Will get rid of the unrelated changes this afternoon.

@adilahmeddev
Copy link
Contributor Author

for context, I used ran ruff's linter and most of the changes are getting rid of imports or turning f"" strings into normal strings if they aren't making use of the formatting.


I think I'd prefer going with @frederik-uni 's idea. A script that handles pulling the repo, setting up deps, and making sure its up to date might be a better solution.

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.

4 participants