cookieninja-generator / cookieninja

A cross-platform command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, C projects - a cookiecutter fork
BSD 3-Clause "New" or "Revised" License
68 stars 7 forks source link

Use Poetry for the project's package management #38

Open yuvaldolev opened 1 year ago

yuvaldolev commented 1 year ago

Instead of the current package management solution (setup.py + test_requirements.txt), which isn't very efficient, we should use Poetry to manage all packages and tests.

OverkillGuy commented 1 year ago

Highly recommend Poetry, especially with newest versions "dev-dependencies" are now just dependency groups, which allows stuff like "test" dependency group vs "docs" dependency groups, all installable separately via --with=docs or --without=test for lighter testload.

Perfect to combine with nox-poetry if you're into that kind of thing

liortct commented 1 year ago

@OverkillGuy , thanks for the feedback. We will use Poetry as soon as possible. If you want we will be happy if you contribute and add poetry to project :)

adehad commented 1 year ago

would you also consider using hatch?

It has got support from the PyPA which I think is a big plus (along with being used by many of the other popular projects, eg black).

Happy to whip up a PR to showcase what this would look like

SilverRainZ commented 1 year ago

setup.py, setup.cfg, and requirements.txt are some ways of declaring project metadata. The more modern way is using the all-in-one pyproject.toml file (PEP-621).

So poetry is not a replacement for setup.py and requirement.txt, it is a tool that can manage python projects declared by pyproject.toml.

IMO poetry is not stable enough, I meet a lot of weird bugs and can not get a timely response from the Poetry team:

2023-02-06_235816

For now, python's official setuptools already support PEP-621, PDM, hatch too. Poetry is not our only choice.

I recommend cookieninja use pyproject.toml + newer version of setuptools, it is a progressive way.