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

Chg: convert as rye python package #241

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

Conversation

inkhey
Copy link

@inkhey inkhey commented Sep 10, 2024

related to #124

Hello Folks. I'm trying to convert this project from raw python to python project using Rye.

Why ? Because python package is a kind of norm that make many things really easier.
For my specific use case, I do want to generate a Debian package of phockup using wheel2deb, but no python package no wheel.

Why Rye ? The packaging state of python is a mess. I don't have a strong opinion on the tool, I do just know how to use Rye and it's seems really nice to me as soon as you don't expect to be in the same environment it operates.

Why are you broking stuff like this ? I try to break minimal stuff. normally all the build process should still work.

What is working/What is broken Now ?

  • Building Wheel: Ok.
  • Docker: Ok
  • Automated Test: Ok
  • Manual Test: Not tested in real case now.
  • Snap: Probably working. Don't know how to test this.
  • Other stuff that rely on direct run python : Probably working
  • Documentation: Seems ok for now

@inkhey inkhey force-pushed the convert_as_rye_package branch 2 times, most recently from b9bf5c0 to 9a14f83 Compare September 10, 2024 16:01
phockup.py Show resolved Hide resolved
phockup/phockup.py Outdated Show resolved Hide resolved
@inkhey
Copy link
Author

inkhey commented Sep 10, 2024

I updated the description, I may have found a good backward compatibility mechanism (not sure), but it will be better to update all stuff to work with wheel as a single source of truth.

@inkhey inkhey force-pushed the convert_as_rye_package branch 3 times, most recently from 839e5e5 to 51726a9 Compare September 11, 2024 07:17
@inkhey inkhey force-pushed the convert_as_rye_package branch from 51726a9 to 1d4afb4 Compare September 11, 2024 07:47
@inkhey inkhey marked this pull request as ready for review September 11, 2024 07:47
@inkhey
Copy link
Author

inkhey commented Sep 11, 2024

I did the modification in a way that normally, aside from an external project that may use this to build the package, the current built package should still work. I don't know how to test homebrew/snap and windows case, so please ask if it's broken.

The only drawback of this, normally, is that on python<3.11 with non packaged code, the software is not any more able to know his own version.

This is far for perfect as it's probably better to generate the python package and then apply it to all packaging to have one source of truth, but I don't want to break too many things for now.

This change also means you should use rye and pyproject.toml to update dependencies, with both "soft" dependencies in pyproject.toml and hard dependencies generated by "rye sync" to .lock files.

I just published a package on testpypi with this command line:

rye publish --repository testpypi --yes --token="$TOKEN" --verbose --repository-url https://test.pypi.org/

So you can test : https://test.pypi.org/project/phockup/1.13.0/.

@ivandokov What's your opinion about this change ? I don't modify much the GitHub action as I don't have a way to test it properly. But automating PyPI package publication should not be too complicated.

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.

1 participant