SuffolkLITLab / ALActions

A github repo with all of the shared actions used in Assembly Line Projects
1 stars 0 forks source link

Use setup-python to speed up pip installs #1

Closed BryceStevenWilley closed 1 year ago

BryceStevenWilley commented 1 year ago

https://github.com/actions/setup-python, specifically something like this:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
  with:
    python-version: '3.9'
    cache: 'pip' # caching pip dependencies
- run: pip install -r requirements.txt

Which would really speed up the tests: currently, we spend 30 seconds on debian packages, 2 minutes and 33 seconds installing pip stuff, and only 10 seconds for mypy and 6 seconds for the tests themselves.

Need to figure out how the venv gets set up though, and how to best work with the setup.py and requirements, since we use both: setup.py for installing runtime dependencies, and requirements for the test dependencies, like mypy types. Should probably look into using the extras: "test" param in setup.py, so we could install everything with pip install.[test]``. See https://github.com/simonw/datasette-auth0/blob/2ffd71812267b4d39c9654449721e1106e3c6d3e/setup.py#L36 for an example.

BryceStevenWilley commented 1 year ago

So this is actually addressed in ALActions now, and that change has been made. However, it doesn't seem to actually improve the speed that much. Eh. Going to transfer the issue there, and close it as done.