-
-
Notifications
You must be signed in to change notification settings - Fork 442
Add poetry dependency manager and package builder #368
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
Changes from 6 commits
713ea54
cbbc453
cd2dfb2
08dd179
ef51164
32e9c07
a2f9b7c
bb8558c
825af51
62df241
78af477
b5fd573
3cc87cf
6f2004a
a06e90d
945b20c
f98d2f6
15e427e
3b24911
97c7337
e8f66a9
f59ad99
f561374
4a69f11
4b82769
50e05a3
48de3e0
4b1f52a
7f6ac4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,51 @@ disable_error_code = ["union-attr", "annotation-unchecked", "import-untyped"] | |
| explicit_package_bases = true | ||
| warn_unused_ignores = true | ||
| exclude = ['tests'] | ||
|
|
||
| [tool.poetry] | ||
| name = "tagstudio" | ||
| version = "9.1.1" | ||
| packages = [{include = "tagstudio/tag_studio.py"}, {include = "tagstudio/src/core"}, {include = "tagstudio/src/qt"}, {include = "tagstudio/resources"}, {include = "tagstudio/__init__.py"}] | ||
tintin10q marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| description = "TagStudio (Alpha): A User-Focused Document Management System TagStudio is a photo & file organization application with an underlying system that focuses on giving freedom and flexibility to the user. No proprietary programs or formats, no sea of sidecar files, and no complete upheaval of your filesystem structure." | ||
tintin10q marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| authors = ["Travis Abendshien"] | ||
| readme = "README.md" | ||
| license = "GPL-3.0-only" | ||
| repository = "https://github.com/TagStudioDev/TagStudio" | ||
| maintainers = [] # Maybe someone can find a way to export this from GitHub? | ||
|
|
||
| [tool.poetry.urls] | ||
| Discord = "https://discord.gg/hRNnVKhF2G" | ||
|
|
||
| [tool.poetry.dependencies] | ||
tintin10q marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| python = "~3.12" | ||
| humanfriendly = "10.0" | ||
| opencv_python=">=4.8.0.74,<=4.9.0.80" | ||
tintin10q marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Pillow="10.3.0" | ||
tintin10q marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a comment for the rest of the pinned versions and this does not reflect a change I want to enforce, but an honest comment.
Here lies one of the issues with poetry, it is not 100% compatible with the python ecosystem, and you cant use a constraint file to enforce application versions during install. It will follow the lock file. Micromanaging the pyproject toml files pinned versions is a little hassle, but it can ofcourse be done, this is a cost someone has to take; I'm in favor if you can. I use poetry at work so that all developers can have the same experience, at the cost of some extra work for one. TL;DR
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think it's exact the opposite. Defining dependencies too loosely seems to lead to unforeseen problems and non-reproducible builds, especially in Python and Javascript projects. Ultimately, that is what the lock file is trying to avoid. If necessary, it can be updated quickly at any time.
Just an idea, but maybe it's possible to use a git hook to generate a
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I disagree that pyproject.toml should focus on getting the newest version of a package. The important thing is that the project works, not that the latest version is downloaded. From time to time a pr can bump versions after testing. Also in your other comment you say you actually don't like specifying Why would you pin versions in requirements.txt and not in pyproject.toml? That just does not make any sense. The versions should be the same and that is why I explained in the CONTRIBUTING.md how to generate requirements.txt from pyproject.toml. If it was possible I would not even have a requirements.txt but we have to have it of course.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think having a git hook to update requirement.txt from the pyproject.toml is a good idea. I also thought of that but I have never set up git hooks before.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Poetry project seems to provide some git hooks. E.g. I have seen a poetry-export git hook. But it requires to install a poetry plugin. I don't really have any experience with this, there may be better tools out there for creating requirements.txt files. Maybe a temporary requirements.txt during the build would be sufficient, which would then be used for testing while in CI/CD. Or perhaps there are better alternatives to
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool. But this could also be another pr? |
||
| PySide6="6.7.1" | ||
| PySide6_Addons="6.7.1" | ||
| PySide6_Essentials="6.7.1" | ||
tintin10q marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| typing_extensions=">=3.10.0.0,<=4.11.0" | ||
tintin10q marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ujson=">=5.8.0,<=5.9.0" | ||
tintin10q marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| numpy="1.26.4" | ||
| rawpy="0.21.0" | ||
| pillow-heif="0.16.0" | ||
tintin10q marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| chardet="5.2.0" | ||
|
|
||
| [tool.poetry.group.dev] | ||
| optional = true | ||
| [tool.poetry.group.dev.dependencies] | ||
| ruff="0.4.2" | ||
| pre-commit="3.7.0" | ||
| pytest="8.2.0" | ||
| Pyinstaller="6.6.0" | ||
| mypy="1.10.0" | ||
| syrupy="4.6.1" | ||
|
|
||
|
|
||
| [build-system] | ||
| requires = ["poetry-core"] | ||
| build-backend = "poetry.core.masonry.api" | ||
|
|
||
| [tool.poetry.scripts] | ||
| tagstudio = "tagstudio.tag_studio:main" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| __version__ = '9.1.1' | ||
tintin10q marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,10 @@ | |
|
|
||
| """TagStudio launcher.""" | ||
|
|
||
| import os, sys | ||
| sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__)))) # add this so that `poetry run tagstudio` works | ||
|
|
||
| from src.core.ts_core import TagStudioCore | ||
| from src.cli.ts_cli import CliDriver # type: ignore | ||
| from src.qt.ts_qt import QtDriver | ||
|
||
| import argparse | ||
| import traceback | ||
|
|
||
|
|
@@ -66,12 +67,15 @@ def main(): | |
|
|
||
| # Driver selection based on parameters. | ||
| if args.ui and args.ui == "qt": | ||
| from src.qt.ts_qt import QtDriver | ||
| driver = QtDriver(core, args) | ||
| ui_name = "Qt" | ||
| elif args.ui and args.ui == "cli": | ||
| from src.cli.ts_cli import CliDriver | ||
| driver = CliDriver(core, args) | ||
| ui_name = "CLI" | ||
| else: | ||
| from src.qt.ts_qt import QtDriver | ||
| driver = QtDriver(core, args) | ||
| ui_name = "Qt" | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.