Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust GitHub Actions CI/CD linters #7611

Merged
merged 4 commits into from
Feb 19, 2020

Conversation

webknjaz
Copy link
Member

  • workflow vs job name
  • TOX_PARALLEL_NO_SPINNER
  • vendoring
  • env state logging
  • Pip cache

@webknjaz webknjaz force-pushed the testing/gh-actions-ci-cd-linters branch 2 times, most recently from 5563141 to c6be21d Compare January 18, 2020 18:31
@webknjaz webknjaz marked this pull request as ready for review January 18, 2020 18:36
Comment on lines +45 to +53
- name: Log Python version
run: >-
python --version
- name: Log Python location
run: >-
which python
- name: Log Python env
run: >-
python -m sysconfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd prefer to merge these into one. Reasons detailed in a later comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(explained @ https://github.com/pypa/pip/pull/7611/files#r368251546) It's easier to inspect/separate outputs of different commands if each has a separate label. I think that for me it's coming from Ansible's best practices of always naming steps...

Comment on lines +89 to +95
- name: Pre-fetch pre-commit hooks
# This is to separate test step from deps install
if: matrix.env.TOXENV == 'lint'
run: >-
.tox/lint/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}/python -m
pre_commit
install-hooks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? pre-commit would do this on it's own on first run.

If it's not necessary, I'd rather that we drop it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to separate install/init step from the actual test run because then it's clear what fails. It's the same as tox --notest + tox in a separate step.

Comment on lines -41 to 80
- name: Update setuptools and tox dependencies
run: |
- name: Update setuptools
run: >-
python -m pip install --upgrade setuptools
- name: Install tox
run: >-
python -m pip install --upgrade tox tox-venv
- name: Log the list of packages
run: >-
python -m pip freeze --all
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: These as a single bundle was probably nicer -- it's not really a cause for concern, but I don't think this information has ever been useful for most tasks and even when it is, the existing single bundle is named well enough to know where to look.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's mostly personal preference. But I've found out if there's separate distinct steps, it's easier to inspect logs.

.github/workflows/python-linters.yml Show resolved Hide resolved
Comment on lines 15 to 20
name: >-
${{ matrix.env.TOXENV }}
/
${{ matrix.python-version }}
/
${{ matrix.os }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

    name: >-
      ${{ matrix.env.TOXENV }}-${{ matrix.python-version }} on ${{ matrix.os }}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if that's shorter. My goal was to make it fit better in the sidebar while still communicating the description better.

We could even do something like this (spaceless):

    name: >-
      ${{ matrix.env.TOXENV }}/${{ matrix.python-version }}@${{ matrix.os }}

@pradyunsg
Copy link
Member

pradyunsg commented Jan 18, 2020

re vendoring failing on Windows: Looks a lot like #7600. :)

* workflow vs job name
* TOX_PARALLEL_NO_SPINNER
* vendoring
* env state logging
* Pip cache
@webknjaz webknjaz force-pushed the testing/gh-actions-ci-cd-linters branch from 1a593d1 to 476bcb8 Compare February 3, 2020 11:26
@webknjaz
Copy link
Member Author

webknjaz commented Feb 3, 2020

@pradyunsg it's green

@pradyunsg pradyunsg merged commit 82b4566 into pypa:master Feb 19, 2020
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Mar 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants