z411 / trackma

Open multi-site list manager for Unix-like systems. (ex-wMAL)
https://z411.github.io/trackma
GNU General Public License v3.0
761 stars 82 forks source link

feat: Add Poetry #653

Closed txtsd closed 1 year ago

txtsd commented 1 year ago

This adds dependencies for a virtual environment. Removes pyqt4. Updates minimum python version. Removes PyQt4 since Qt4 has been EOL for several years.

~~Python is currently pinned to 3.7.14 because pycairo is not compatible with python 3.6. Let me know if the versions should be >= instead of ==.~~

Should close #609 when done

EDIT: Hold on I might be missing gtk deps. Nevermind. EDIT: Additionally, drops setup.py in favor of poetry, and updates the README with relevant info. EDIT: Python is now 3.7+

alsoGAMER commented 1 year ago

to me also, but this patch will need to be revisited when qt6 will land into the master branch

txtsd commented 1 year ago

Conflicts resolved.

FichteFoll commented 1 year ago

Here's another package manager that sounds promising, just to throw more into the mix. https://pdm.fming.dev/latest/

txtsd commented 1 year ago

Wow PEP 582 is YUM!

z411 commented 1 year ago

Does it support to load the program version from utils.VERSION? I like to keep the version in one place as to avoid inconsistencies.

txtsd commented 1 year ago

Does it support to load the program version from utils.VERSION? I like to keep the version in one place as to avoid inconsistencies.

I don't understand. Can you elaborate on what you mean?

EDIT: Oh you mean pull the version automatically instead of having it manually typed. I think I checked before and it wasn't possible. Let me check again.

txtsd commented 1 year ago

@z411 There is poetry-dynamic-versioning which can set the version, but it only grabs the version from tags. So unless you want to make tags the true source of the version.

If we go that way, it will also require running poetry dynamic-versioning (note the space) to set the value in pyproject.toml and utils.py so they can then be committed. This is because by default, poetry-dynamic-versioning sets the version while it's working/building (ideally to a placeholder (version = "0.0.0"), then reverts it when it's done.

Another solution is to use a pre-commit hook to block when the version values in pyproject.toml and utils.py are different.

txtsd commented 1 year ago

Should I include poetry-dynamic-versioning and a pre-commit hook then?

FichteFoll commented 1 year ago

I thought the dynamic versioning plugin and the pre-commit hook were two different approaches to this problem? Imo this can also be done at a later point.

I'll merge the PR as soon as I find some time in my day to test the various poetry commands on it locally, but it does look good already.

txtsd commented 1 year ago

I thought the dynamic versioning plugin and the pre-commit hook were two different approaches to this problem? Imo this can also be done at a later point.

Yes, just a little holiday haze 😅

I'll merge the PR as soon as I find some time in my day to test the various poetry commands on it locally, but it does look good already.

Okay good! I'll look into getting Qt6 support for #628 after that.

FichteFoll commented 1 year ago

Finally managed to test this properly (after I fixed the problems I had with poetry&pip always trying to use some keyring that I never configured, https://github.com/pypa/pip/issues/6773, https://github.com/jaraco/keyring#disabling-keyring).

Also ran into an issue with Arch packaging regarding poetry and had to manually downgrade a package there (https://bugs.archlinux.org/task/77375).

I have made some slight adjustments to the readme and merged it into master. Note that the readme now does not correctly reflect the extras included on the latest version on pypi until the next version update.

txtsd commented 1 year ago

Awesome!