Skip to content

Replace custom build system with Poetry #563

Open
@eecavanna

Description

@eecavanna

Background

Currently, the Runtime uses a custom dependency management solution that works something like this:

  1. Update a requirements/*.in file: main.in for production dependencies and dev.in for development dependencies
  2. Run the command $ make update-deps, which — under the hood — runs these commands, which update the main.txt and dev.txt files

    nmdc-runtime/Makefile

    Lines 6 to 16 in f0e8096

    update-deps:
    # --allow-unsafe pins packages considered unsafe: distribute, pip, setuptools.
    pip install --upgrade pip-tools pip setuptools
    pip-compile --upgrade --build-isolation \
    --allow-unsafe --resolver=backtracking --strip-extras \
    --output-file requirements/main.txt \
    requirements/main.in
    pip-compile --allow-unsafe --upgrade --build-isolation \
    --allow-unsafe --resolver=backtracking --strip-extras \
    --output-file requirements/dev.txt \
    requirements/dev.in
  3. Run the command $ make init, which — under the hood — runs these commands, which install the packages listed in main.txt and dev.txt into the current Python environment

Pros:

  • It is already implemented
  • (Add yours here...)

Cons:

  • People sometimes forget step 2
  • (Add yours here...)

Proposal

Switch to using Poetry.

If the Runtime used Poetry, the above process would become:

  1. Update the pyproject.toml file (there are different sections of the file for production versus development dependencies)
  2. Run $ poetry install to install the packages listed in the file — this will generate a poetry.lock file if one doesn't already exist (commit this file to the repo once it exists)

Metadata

Metadata

Assignees

Labels

cleanup 🧹Related to cleaning up code, documentation, etc.enhancementNew feature or request

Type

No type

Projects

  • Status

    Front of house
  • Status

    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions