Skip to content

Migrate from setuptools/pipenv to poetry

Patrick Godwin requested to merge patrick.godwin/gwcelery:poetry into master

This continues work from !708 (closed) to wrap up the migration to poetry.

Most of the migration is straightforward, but anything that relies on calls to setup.py or any of the requirements files needed to be modified. In particular, the CI had many changes due to this.

Some notable changes due to no straightforward analog:

  • python setup.py test -> pytest
  • python setup.py build_sphinx -> sphinx-build -b html doc <target_dir>

Also, while the requirements files are not needed, the CI heavily depends on them so instead use poetry export -f requirements.txt --without-hashes (with or without --dev) to use throughout.

Some other notable changes using poetry:

  • python setup.py --version -> poetry version --short
  • python setup.py bdist_wheel -> poetry build -f wheel
  • python setup.py sdist -> poetry build -f sdist
  • pipenv install -> poetry install

Other notable changes in the CI:

  • Switch dependencies to needs to allow jobs to only depend on prior jobs rather than waiting for all jobs in a stage.
  • Migrate sccb stage from external repo since setup.py doesn't exist anymore and needed to be modified to rely on poetry.

Closes !708 (closed).

Edited by Leo P. Singer

Merge request reports