Skip to content
Snippets Groups Projects
  1. Aug 01, 2022
  2. Feb 23, 2022
  3. Jan 21, 2022
    • John Snow's avatar
      python: pin setuptools below v60.0.0 · 1e4d8b31
      John Snow authored
      setuptools is a package that replaces the python stdlib 'distutils'. It
      is generally installed by all venv-creating tools "by default". It isn't
      actually needed at runtime for the qemu package, so our own setup.cfg
      does not mention it as a dependency.
      
      However, tox will create virtual environments that include it, and will
      upgrade it to the very latest version. the 'venv' tool will also include
      whichever version your host system happens to have.
      
      Unfortunately, setuptools version 60.0.0 and above include a hack to
      forcibly overwrite python's built-in distutils. The pylint tool that we
      use to run code analysis checks on this package relies on distutils and
      suffers regressions when setuptools >= 60.0.0 is present at all, see
      https://github.com/PyCQA/pylint/issues/5704
      
      
      
      Instruct tox and the 'check-dev' targets to avoid setuptools packages
      that are too new, for now. Pipenv is unaffected, because setuptools 60
      does not offer Python 3.6 support, and our pipenv config is pinned
      against Python 3.6.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarBeraldo Leal <bleal@redhat.com>
      Reviewed-by: default avatarCleber Rosa <crosa@redhat.com>
      Tested-by: default avatarCleber Rosa <crosa@redhat.com>
      Message-id: 20220121005221.142236-1-jsnow@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      1e4d8b31
  4. Sep 27, 2021
    • John Snow's avatar
      python/aqmp: Add Coverage.py support · a4ffaecd
      John Snow authored
      
      I'm not exposing this via the Makefile help, it's not likely to be
      useful to passersby. Switch the avocado runner to the 'legacy' runner
      for now, as the new runner seems to obscure coverage reports, again.
      
      Usage is to enter your venv of choice and then:
      `make check-coverage && xdg-open htmlcov/index.html`.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-id: 20210915162955.333025-28-jsnow@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      a4ffaecd
  5. Jul 13, 2021
  6. Jul 01, 2021
  7. Jun 01, 2021
    • John Snow's avatar
      python: add tox support · 3c8de38c
      John Snow authored
      
      This is intended to be a manually run, non-CI script.
      
      Use tox to test the linters against all python versions from 3.6 to
      3.10. This will only work if you actually have those versions installed
      locally, but Fedora makes this easy:
      
      > sudo dnf install python3.6 python3.7 python3.8 python3.9 python3.10
      
      Unlike the pipenv tests (make venv-check), this pulls "whichever"
      versions of the python packages, so they are unpinned and may break as
      time goes on. In the case that breakages are found, setup.cfg should be
      amended accordingly to avoid the bad dependant versions, or the code
      should be amended to work around the issue.
      
      With confidence that the tests pass on 3.6 through 3.10 inclusive, add
      the appropriate classifiers to setup.cfg to indicate which versions we
      claim to support.
      
      Tox 3.18.0 or above is required to use the 'allowlist_externals' option.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarCleber Rosa <crosa@redhat.com>
      Tested-by: default avatarCleber Rosa <crosa@redhat.com>
      Message-id: 20210527211715.394144-31-jsnow@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      3c8de38c
    • John Snow's avatar
      python: add Makefile for some common tasks · 6560379f
      John Snow authored
      
      Add "make venv" to create the pipenv-managed virtual environment that
      contains our explicitly pinned dependencies.
      
      Add "make check" to run the python linters [in the host execution
      environment].
      
      Add "make venv-check" which combines the above two: create/update the
      venv, then run the linters in that explicitly managed environment.
      
      Add "make develop" which canonizes the runes needed to get both the
      linting pre-requisites (the "[devel]" part), and the editable
      live-install (the "-e" part) of these python libraries.
      
      make clean: delete miscellaneous python packaging output possibly
      created by pipenv, pip, or other python packaging utilities
      
      make distclean: delete the above, the .venv, and the editable "qemu"
      package forwarder (qemu.egg-info) if there is one.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarCleber Rosa <crosa@redhat.com>
      Tested-by: default avatarCleber Rosa <crosa@redhat.com>
      Message-id: 20210527211715.394144-29-jsnow@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      6560379f
Loading