Skip to content
Snippets Groups Projects

bin/install: install packages one by one and enforce prerequisites

2 unresolved threads

This is trying to make bin/install (again) a click-button developer setup installation tool, simplifying the process for newcomers and making it faster for everyone.

To that end:

  • we ensure that pip is up to date before using it for anything else

  • we install the prerequisites (flake8, mypy, etc.) to avoid having to name them one by one in user documentation

  • we install packages one by one, rather them all together, to avoid that pip failures force users to restart the whole process from scratch. In passing, this makes also things much easier for the new pip resolver. To avoid dependency inconsistencies we install packages in bin/pip-swh-packages, which is already supposed to be topologically sorted

  • we also install packages only once, rather than first without -with-testing and later with it (as currently documented in the developer setup), because the "[testing]" markers are extra requires, which always depend on the base package (hopefully)

When this gets landed, the developer setup can be shortened to just say "run bin/install".

bin/pip-swh-packages: remove [extras] markers before topo-sorting


Migrated from D5154 (view on Phabricator)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 1 #!/usr/bin/env bash
2 2
3 pip install $(./bin/pip-swh-packages --with-testing) "$@"
3 # Usage: bin/install [PIP_INSTALL_OPTION..]
4
5 PREREQUISITES="pre-commit flake8 pifpaf tox wheel mypy"
  • Yes, that sounds more reasonable now.

    Thanks.

    Wondering if that should go into the swh-environment build which seems to try to do something similar.

    Aside that this build frequently fails due to some repository being red often) that migth help in detecting misdeclared dependency.

  • Merge request was accepted

  • Antoine R. Dumont approved this merge request

    approved this merge request

  • 1 1 #!/usr/bin/env bash
    2 2
    3 pip install $(./bin/pip-swh-packages --with-testing) "$@"
    3 # Usage: bin/install [PIP_INSTALL_OPTION..]
    4
    5 PREREQUISITES="pre-commit flake8 pifpaf tox wheel mypy"
    6
    7 pip install --upgrade pip "$@"
    8
    9 pip install $PREREQUISITES "$@"
    10
    11 bin/pip-swh-packages --with-testing | \
    12 while read pkg_spec ; do
    13 pip install $pkg_spec
    14 done
  • Author Maintainer

    Merge request was merged

  • Please register or sign in to reply
    Loading