[GH-ISSUE #9] Dependency Management #9

Closed
opened 2026-03-02 16:47:03 +03:00 by kerem · 8 comments
Owner

Originally created by @paketb0te on GitHub (Jan 23, 2023).
Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/9

Originally assigned to: @paketb0te on GitHub.

Once again, this is a great tool!

Can I interest you in using poetry for packaging and dependency management?

I had pretty good experiences with it, can definitely recommend.

If you prefer a simpler approach like requirements.txt that's fine too (but I really recommend to take a look at poetry 😆)

(Would look something like THAT)

Originally created by @paketb0te on GitHub (Jan 23, 2023). Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/9 Originally assigned to: @paketb0te on GitHub. Once again, this is a great tool! Can I interest you in using [`poetry`](https://python-poetry.org/docs/) for packaging and dependency management? I had pretty good experiences with it, can definitely recommend. If you prefer a simpler approach like `requirements.txt` that's fine too (but I _really_ recommend to take a look at poetry :laughing:) (Would look something like [THAT](https://github.com/paketb0te/git-sim/tree/poetry))
kerem 2026-03-02 16:47:03 +03:00
Author
Owner

@initialcommit-io commented on GitHub (Jan 23, 2023):

Hi and thank you! Thx for reaching out.

Right now I'm just using entries in the setup.py like:

install_requires=[
    'gitpython',
    'manim',
    'opencv-python-headless',
],

Which takes care of collecting everything automatically. It looks like the poetry.lock file you generated breaks down every dependency and stores it. Is the benefit of this that it more or less guarantees that the build will succeed by defining specific versions of every dependency? Seems a bit messier to need to store all of this info though when most of the build dependences are nested within each other. Like, most of those dependencies come from Manim...

<!-- gh-comment-id:1400940678 --> @initialcommit-io commented on GitHub (Jan 23, 2023): Hi and thank you! Thx for reaching out. Right now I'm just using entries in the `setup.py` like: install_requires=[ 'gitpython', 'manim', 'opencv-python-headless', ], Which takes care of collecting everything automatically. It looks like the `poetry.lock` file you generated breaks down every dependency and stores it. Is the benefit of this that it more or less guarantees that the build will succeed by defining specific versions of every dependency? Seems a bit messier to need to store all of this info though when most of the build dependences are nested within each other. Like, most of those dependencies come from Manim...
Author
Owner

@paketb0te commented on GitHub (Jan 23, 2023):

yeah, you only need to specify them explicitly in the pyproject.toml file (with constrints, if you wish, like "needs at least verion X.Y of package Z").

The file poetry.lock is created automatically by poetry (poetry lock) to pin all dependencies to fixed versions, which as you mention helps ensure that the build is reproducible / identical for everybody.

<!-- gh-comment-id:1400995088 --> @paketb0te commented on GitHub (Jan 23, 2023): yeah, you only need to specify them explicitly in the `pyproject.toml` file (with constrints, if you wish, like "needs at least verion X.Y of package Z"). The file `poetry.lock` is created automatically by poetry (`poetry lock`) to pin all dependencies to fixed versions, which as you mention helps ensure that the build is reproducible / identical for everybody.
Author
Owner

@initialcommit-io commented on GitHub (Jan 25, 2023):

I see, thanks for the suggestion. I need to learn more about poetry and other options and will get back to you on this one.

<!-- gh-comment-id:1403281235 --> @initialcommit-io commented on GitHub (Jan 25, 2023): I see, thanks for the suggestion. I need to learn more about `poetry` and other options and will get back to you on this one.
Author
Owner

@initialcommit-io commented on GitHub (Jan 27, 2023):

@paketb0te I'm playing around with poetry and got a similar pyproject.toml file to the one at your link.

Just a few questions about some extra info that is currently in the setup.py file which I wasn't prompted for by the interactive poetry setup:

-url
-keywords
-project_urls (homepage and source)
-entry_points

Do you know how these can be specified with poetry?

<!-- gh-comment-id:1406277263 --> @initialcommit-io commented on GitHub (Jan 27, 2023): @paketb0te I'm playing around with poetry and got a similar `pyproject.toml` file to the one at your link. Just a few questions about some extra info that is currently in the `setup.py` file which I wasn't prompted for by the interactive poetry setup: -url -keywords -project_urls (homepage and source) -entry_points Do you know how these can be specified with poetry?
Author
Owner

@paketb0te commented on GitHub (Jan 27, 2023):

According to the docs, we can just specify those in pyproject.toml, e.g. repository = "https://github.com/initialcommit-com/git-sim"

So it would look something like this:

[tool.poetry]
name = "git-sim"
version = "0.1.2"
description = "Simulate Git commands ..."
authors = ["Jacob Stopak <jacob@initialcommit.io>"]
license = "MIT"
readme = "README.md"
packages = [{include = "git_sim"}]
homepage = "https://git-sim.org/"
keywords = ["git", "sim", "simulation", "..."]
repository = "https://github.com/initialcommit-com/git-sim
...

If I understand correctly, you can define the equivalent to entry_points via plugins in a subsection in the pyproject.toml (see docs)

edit: Apparently you can also define arbitrary URLs besides homepage and repo: urls

<!-- gh-comment-id:1406293123 --> @paketb0te commented on GitHub (Jan 27, 2023): According to the [docs](https://python-poetry.org/docs/pyproject/), we can just specify those in `pyproject.toml`, e.g. `repository = "https://github.com/initialcommit-com/git-sim"` So it would look something like this: ```toml [tool.poetry] name = "git-sim" version = "0.1.2" description = "Simulate Git commands ..." authors = ["Jacob Stopak <jacob@initialcommit.io>"] license = "MIT" readme = "README.md" packages = [{include = "git_sim"}] homepage = "https://git-sim.org/" keywords = ["git", "sim", "simulation", "..."] repository = "https://github.com/initialcommit-com/git-sim ... ``` If I understand correctly, you can define the equivalent to `entry_points` via plugins in a subsection in the `pyproject.toml` (see [docs](https://python-poetry.org/docs/pyproject/#plugins)) edit: Apparently you can also define arbitrary URLs besides homepage and repo: [urls](https://python-poetry.org/docs/pyproject/#urls)
Author
Owner

@buhtz commented on GitHub (May 9, 2023):

In relation to #85

I'm not well experienced packaging big projects but small ones.
In #85 you also stated that you are not well experienced with packaing. Because of that I would like to give an advice to save your resources, your time, your nerves and keep the project (and its maintainer) healty. 😄

  1. Use pyproject.toml (without setup.py/setup.cfg) and nothing else.
  2. Use setup.py/setup.cfg only if you really know why you need it. There are reasons but most of them time that are special reasons.
  3. Don't use poetry, tox or something like this. This are very complex big tools for big purposes. Use them only if you really have a hard indication for it. Otherwise it would waste a lot of your time.

Again about 2. and 3. This are not bad tools. The problem is just that they are recommended in every blog post etc. But they are intended to solve problems that "small projects" usually don't have. Keep your solutions grounded.

If you like you can contact me and I explain you my real world projects how I solved somethings just using pyproject.toml not using anything else.

<!-- gh-comment-id:1539897227 --> @buhtz commented on GitHub (May 9, 2023): In relation to #85 I'm not well experienced packaging *big* projects but *small* ones. In #85 you also stated that you are not well experienced with packaing. Because of that I would like to give an advice to save your resources, your time, your nerves and keep the project (and its maintainer) healty. 😄 1. Use `pyproject.toml` (without setup.py/setup.cfg) and nothing else. 2. Use setup.py/setup.cfg only if you really know why you need it. There are reasons but most of them time that are special reasons. 3. Don't use poetry, tox or something like this. This are very complex big tools for big purposes. Use them only if you really have a hard indication for it. Otherwise it would waste a lot of your time. Again about 2. and 3. This are not bad tools. The problem is just that they are recommended in every blog post etc. But they are intended to solve problems that "small projects" usually don't have. Keep your solutions grounded. If you like you can contact me and I explain you my real world projects how I solved somethings just using pyproject.toml not using anything else.
Author
Owner

@paketb0te commented on GitHub (May 9, 2023):

Hi @buhtz, thanks for your input on this.

I was not aware that you can also specify dependencies in pyproject.toml, that's super neat!

-> That kinda obsoletes the usage of poetry for now, I guess.

@initialcommit-io let's close this issue.
@buhtz I'd be glad to work on #85 together, if you are up for it. I have to do some reading about project layout before though 😁

<!-- gh-comment-id:1540354552 --> @paketb0te commented on GitHub (May 9, 2023): Hi @buhtz, thanks for your input on this. I was not aware that you can also specify dependencies in `pyproject.toml`, that's super neat! -> That kinda obsoletes the usage of poetry for now, I guess. @initialcommit-io let's close this issue. @buhtz I'd be glad to work on #85 together, if you are up for it. I have to do some reading about project layout before though :grin:
Author
Owner

@initialcommit-io commented on GitHub (May 9, 2023):

Sounds good @paketb0te, closing this one for now so pyproject.toml work can be continued thru #85 .

<!-- gh-comment-id:1540506153 --> @initialcommit-io commented on GitHub (May 9, 2023): Sounds good @paketb0te, closing this one for now so `pyproject.toml` work can be continued thru #85 .
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-sim#9
No description provided.