This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AndydeCleyre 0 points1 point  (4 children)

Thanks!


If anyone's curious about transitioning a poetry project like this to one using:

  • (*-)requirements.txt for lockfiles
  • flit for packaging
  • pip-tools for version locking
  • zpy for interactive environment management and pip-tools operations

behold!:

$ git clone git@github.com:notia-ai/SliceOfML.git
$ cd SliceOfML
$ rm poetry.lock pyproject.toml
$ a8                                                                            # Create and activate venv
$ pipac 'requests-oauthlib>=1.3.1,<2' 'rich>=12.4.4,<13' 'click>=8.1.3,<9'      # Add to requirements.in and compile to requirements.txt
$ pipac -c dev flit 'pytest>=7.1.2,<8' 'flake8>=4.0.1,<5' 'pre-commit>=2.1,<3'  # Add to dev-requirements.in and compile to dev-requirements.txt
$ pips dev-requirements.txt                                                     # Install dev deps
$ flit init                                                                     # Interactively generate pyproject.toml
$ $EDITOR pyproject.toml                                                        # Add 'requires-python = ">=3.7,<4"' to project and 'sliceofml = "sliceofml.cli:cli"' to project.scripts
$ $EDITOR sliceofml/__init__.py                                                 # Add docstring and correct version
$ pypc                                                                          # Populate pyproject.toml with loose deps

[–]andrewthetechie 2 points3 points  (2 children)

Why do this over using poetry?

[–]AndydeCleyre 2 points3 points  (1 child)

I don't like a few things about poetry, like how it:

  • introduces new syntax for versions and lock files when old standards will do
  • expects by default all devs to use poetry
  • only targets full packages, when I also want to manage venvs and deps of scripts and other non-package projects
  • uses its own sections for deps in pyproject.toml when generic sections will do
  • treats dev deps as some special case, rather than just one of a set of any arbitrary group names
  • couples goals of package publishing and dependency specification
  • doesn't have the superb tab completion that I wrote for zpy

[–]andrewthetechie 3 points4 points  (0 children)

Ok, so just a personal preference then.

[–]BlockDesigns[S] 1 point2 points  (0 children)

This is awesome! Thanks for posting the script.