All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Cleber Rosa" <crosa@redhat.com>, "John Snow" <jsnow@redhat.com>
Subject: [PATCH 0/5] python: add linters to gitlab CI
Date: Tue, 27 Oct 2020 18:38:10 -0400	[thread overview]
Message-ID: <20201027223815.159802-1-jsnow@redhat.com> (raw)

based-on: <20201020193555.1493936-1-jsnow@redhat.com>
          [PATCH v3 00/15] python: create installable package

This series serves as an addendum to the python package series; it adds
easy invocations for running the linters with the correct options for
the purposes of preventing regressions in our python libraries and
tools.

It adds (to ./python):

- make venv: Use pipenv to recreate a venv as laid out precisely by
  Pipfile.lock; this requires *precisely* Python 3.6.

- make check: Run linters using pytest framework using user's current
  environment (Which may well be their own venv, their OS environment,
  whatever.) It only requires *a* python; at the moment, 3.6, 3.7, and
  3.8 are supported. There are some known problems with 3.9 as of yet.

- make venv-check: Run the linters using the venv laid out by
  Pipfile.lock specifically.

Then, it adds a very simple gitlab test to run this on top of the
Fedora32 build. I chose Fedora as the host for this test only because
Fedora's package ecosystem makes it very easy to install multiple
versions of Python, which allows us to test against our minimum required
version explicitly to detect against any accidental breakages that slip
in from developers coding against 3.7, 3.8, 3.9, etc.

This is the simplest thing I could come up with that fulfilled a few
design goals I had in mind:

1. It can be run locally with an arbitrary environment

2. It can be run locally with a precise environment, matching how it
will be executed in the CI environment

3. It can be invoked from the python directory in a standalone manner.

4. It runs on our CI infrastructure, preventing regressions in the
python code.

John Snow (5):
  python: add pytest and tests
  python: add excluded dirs to flake8 config
  python: add Makefile for some common tasks
  python: add .gitignore
  gitlab: add python linters to CI

 .gitlab-ci.yml                         | 10 ++++
 python/.gitignore                      |  9 ++++
 python/Makefile                        | 35 +++++++++++++
 python/Pipfile.lock                    | 71 ++++++++++++++++++++++++--
 python/setup.cfg                       |  7 +++
 python/tests/test_lint.py              | 28 ++++++++++
 tests/docker/dockerfiles/fedora.docker |  2 +
 7 files changed, 157 insertions(+), 5 deletions(-)
 create mode 100644 python/.gitignore
 create mode 100644 python/Makefile
 create mode 100644 python/tests/test_lint.py

-- 
2.26.2




             reply	other threads:[~2020-10-27 22:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 22:38 John Snow [this message]
2020-10-27 22:38 ` [PATCH 1/5] python: add pytest and tests John Snow
2020-10-28  6:19   ` Thomas Huth
2020-10-28 13:23     ` John Snow
2020-10-28 14:09       ` Philippe Mathieu-Daudé
2020-10-28 14:54       ` Thomas Huth
2020-10-28 18:38         ` John Snow
2020-10-27 22:38 ` [PATCH 2/5] python: add excluded dirs to flake8 config John Snow
2020-10-28  8:50   ` Philippe Mathieu-Daudé
2020-10-28 13:42     ` John Snow
2020-10-27 22:38 ` [PATCH 3/5] python: add Makefile for some common tasks John Snow
2020-10-27 22:38 ` [PATCH 4/5] python: add .gitignore John Snow
2020-10-28  8:13   ` Thomas Huth
2020-10-28  9:16     ` Markus Armbruster
2020-10-28  9:22       ` Daniel P. Berrangé
2020-10-28 13:39       ` John Snow
2020-10-28 13:41         ` Daniel P. Berrangé
2020-10-28 13:26     ` John Snow
2020-10-28 18:33     ` John Snow
2020-10-27 22:38 ` [PATCH 5/5] gitlab: add python linters to CI John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201027223815.159802-1-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=fam@euphon.net \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.