8000 run github actions also on python 3.8 and 3.10 by ziegenberg · Pull Request #107 · ansible/schemas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

run github actions also on python 3.8 and 3.10 #107

Closed
wants to merge 6 commits into from

Conversation

ziegenberg
Copy link
Collaborator

extends:

  • tox.ini to also include python 3.8 and python 3.10
  • GH actions to also test with python 3.8 and python 3.10

This will succeed once #106 is merged.

@ziegenberg ziegenberg requested a review from webknjaz as a code owner December 19, 2021 21:35
tox.ini Outdated
@@ -1,7 +1,7 @@
[tox]
minversion = 3.23.0
# py is before lint because it can alter tracked files
envlist = py,lint
Copy link
Member

Choose a reason for hiding this comment

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

that is not needed. you can call py310 even without mentioning it in default envlist. That makes is easier for people as it will not force them to install multiple versions of python

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed it as suggested.

@ssbarnea
Copy link
Member

@ziegenberg When you rebase this it should now pass on py310 too. Root cause was outdated constraints from ruamel.yaml library. My recent updates sorted that.

As I seen that you made multiple pull-requests to this repository I imagine that you will like my invitation to join https://github.com/ansible-community/schemas/invitations ;)

@ziegenberg
Copy link
Collaborator Author

I rebased on to the current main branch.

@ziegenberg ziegenberg added the enhancement New feature or request label Dec 21, 2021
@ziegenberg
Copy link
Collaborator Author

I will rebase once #118 is merged.

@ziegenberg
Copy link
Collaborator Author

@ssbarnea I guess, with this PR the automated checks need to be adapted...

@@ -35,17 +35,21 @@ jobs:
- run: npm test
tox:
name: >-
${{ matrix.env.TOXENV }}
${{ matrix.tox_env }}
Copy link
Member

Choose a reason for hiding this comment

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

Let's use

Suggested change
${{ matrix.tox_env }}
${{ matrix.toxenv }}

to match the typical tox's terminology and env var naming.

include:
- python-version: 3.8
os: ubuntu-20.04
tox_env: py38,lint
Copy link
Member

Choose a reason for hiding this comment

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

Does lint need to be run under every Python runtime possible?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

running lint on the latest should be sufficient. I'll change it.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe put it into a separate job?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

8000

done as suggested

env: ${{ matrix.env }}
run: |
set -ex
${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }} --notest --skip-missing-interpreters false -vv
Copy link
Member

Choose a reason for hiding this comment

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

Drop the explicit env as suggested above (by the way, it'll cause a potential bug if you add a space after the comma in the matrix factors, this is why you should always watch out for quoting when injecting such things like this) + drop non-existing PREFIX.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done as suggested

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
@ziegenberg
Copy link
Collaborator Author

I applied the suggested changes, rebased and pushed.

env: ${{ matrix.env }}
- name: Initialize tox envs
run: |
set -ex
Copy link
Member

Choose a reason for hiding this comment

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

This is unnecessary because

  1. it's just one command that we're running below
  2. it is already visible in the log, no need to print it out twice


- name: Test with tox
- name: >-
Test with tox -e ${{ matrix.toxenv }}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe revert this?

env:
TOX_PARALLEL_NO_SPINNER: 1
TOXENV: ${{ matrix.toxenv }}
Copy link
Member

Choose a reason for hiding this comment

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

It is also possible to do

Suggested change
TOXENV: ${{ matrix.toxenv }}
TOXENV: ${{ matrix.noxenv && matrix.toxenv || 'py' }}

And drop the explicit toxenv entries from the job definitions except for lint.

env:
- TOXENV: py,lint
include:
- python-version: 3.8
Copy link
Member

Choose a reason for hiding this comment

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

This could be even kept in the matrix with only one job in "include".

Copy link
Member

Choose a reason for hiding this comment

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

Would you move the Python-only entries into the matrix too?

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
@ziegenberg
Copy link
Collaborator Author

@webknjaz is this what you had in mind?

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Copy link
Member
@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

FWIW the diff could be twice smaller w/o extra changes outside of the matrix refactoring.

python3 -m tox --notest --skip-missing-interpreters false -vv
env: ${{ matrix.env }}
- name: Initialize tox envs
run: tox --notest --skip-missing-interpreters false -vv
Copy link
Member

Choose a reason for hiding this comment

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

What was the reason for dropping the explicit runpy python -m syntax?

run: |
python3 -m tox
env: ${{ matrix.env }}
set -ex
Copy link
Member

Choose a reason for hiding this comment

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

This one is unnecessary here two.

@ziegenberg ziegenberg closed this Dec 22, 2021
@ziegenberg ziegenberg deleted the update-gh-actions branch December 22, 2021 22:48
@ziegenberg
Copy link
Collaborator Author

I wish a merry Xmas

@ssbarnea
Copy link
Member

I wish a merry Xmas

Same to you and thanks for the work. We will continue after the winter break.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0