Repository: errbotio/errbot (branch: fix/tests)
Commit date: 2023-10-29T06:35:33Z

Workflow file: .github/workflows/python-package.yml (Python package)
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

permissions:
  contents: read

jobs:
  build:

    runs-on: ubuntu-latest

    services:

      pypi_wayback:

        image: ghcr.io/waleko/pypi-wayback

        ports:

          - 8629:8080
    strategy:
      fail-fast: false
      matrix:
        python-version: [3.8, 3.9, "3.10"]

    steps:
    - uses: actions/checkout@v4.1.1
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4.7.1
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install \
          pytest \
          tox
        cp tests/config-ci.py config.py

    - name: Test on ${{ matrix.python-version }}
      run: |
        tox -e py

    - name: Check Distribution
      if: ${{ matrix.python-version == '3.9' }}
      run: |
        tox -e dist-check

    - name: Codestyle
      if: ${{ matrix.python-version == '3.9' }}
      run: |
        tox -e codestyle

    - name: Lint - sort
      if: ${{ matrix.python-version == '3.9' }}
      run: |
        tox -e sort

    - name: Security
      if: ${{ matrix.python-version == '3.9' }}
      run: |
        tox -e security

    - name: Docs
      if: ${{ matrix.python-version == '3.9' }}
      run: |
        tox -e docs

env:
  PIP_INDEX_URL: http://localhost:8629/2023-10-29
  UV_INDEX_URL: http://localhost:8629/2023-10-29


Failed build logs:
step_name: build (3.9)/7_Codestyle.txt
log: ##[group]Run tox -e codestyle
[36;1mtox -e codestyle[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib
##[endgroup]
.pkg: remove tox env folder /home/runner/work/errbot/errbot/.tox/.pkg
codestyle: install_deps> python -I -m pip install black
.pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel
.pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_wheel> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: install_requires_for_build_wheel> python -I -m pip install wheel
.pkg: freeze> python -m pip freeze --all
.pkg: pip==23.3.1,setuptools==68.2.2,wheel==0.41.2
.pkg: prepare_metadata_for_build_wheel> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: build_sdist> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
codestyle: install_package_deps> python -I -m pip install Pygments==2.16.1 ansi==0.3.6 colorlog==6.7.0 'daemonize==2.5.0; sys_platform != "win32"' deepmerge==1.1.0 dulwich==0.21.5 flask==2.3.3 jinja2==3.1.2 markdown==3.4.4 pyOpenSSL==23.2.0 pygments-markdown-lexer==0.1.0.dev39 requests==2.31.0 setuptools==68.1.2 webtest==3.0.0
codestyle: install_package> python -I -m pip install --force-reinstall --no-deps /home/runner/work/errbot/errbot/.tox/.tmp/package/3/errbot-9.9.9.tar.gz
codestyle: freeze> python -m pip freeze --all
codestyle: ansi==0.3.6,beautifulsoup4==4.12.2,black==23.10.1,blinker==1.6.3,certifi==2023.7.22,cffi==1.16.0,charset-normalizer==3.3.1,click==8.1.7,colorlog==6.7.0,cryptography==41.0.5,daemonize==2.5.0,deepmerge==1.1.0,dulwich==0.21.5,errbot @ file:///home/runner/work/errbot/errbot/.tox/.tmp/package/3/errbot-9.9.9.tar.gz#sha256=d1ac3c921eccb0f6c34ad89aed7603912fb044ea73de1fc4ef41c99fa4b372e3,Flask==2.3.3,idna==3.4,importlib-metadata==6.8.0,itsdangerous==2.1.2,Jinja2==3.1.2,Markdown==3.4.4,MarkupSafe==2.1.3,mypy-extensions==1.0.0,packaging==23.2,pathspec==0.11.2,pip==23.3.1,platformdirs==3.11.0,pycparser==2.21,Pygments==2.16.1,pygments-markdown-lexer==0.1.0.dev39,pyOpenSSL==23.2.0,requests==2.31.0,setuptools==68.1.2,soupsieve==2.5,tomli==2.0.1,typing_extensions==4.8.0,urllib3==2.0.7,waitress==2.1.2,WebOb==1.8.7,WebTest==3.0.0,Werkzeug==3.0.1,wheel==0.41.2,zipp==3.17.0
codestyle: commands[0]> black --check errbot/ tests/ tools/
would reformat /home/runner/work/errbot/errbot/tests/commands_test.py

Oh no! 💥 💔 💥
1 file would be reformatted, 121 files would be left unchanged.
codestyle: exit 1 (1.71 seconds) /home/runner/work/errbot/errbot> black --check errbot/ tests/ tools/ pid=6265
.pkg: _exit> python /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
  codestyle: FAIL code 1 (17.25=setup[15.55]+cmd[1.71] seconds)
  evaluation failed :( (17.34 seconds)
##[error]Process completed with exit code 1.


Changed files:
tests/base_backend_test.py
tests/commandnotfound_plugin/commandnotfound.py
tests/commands_test.py
tests/room_plugin/roomtest.py

Fix diff:
diff --git a/tests/base_backend_test.py b/tests/base_backend_test.py
index dadc6114..5406356d 100644
--- a/tests/base_backend_test.py
+++ b/tests/base_backend_test.py
@@ -1003,9 +1003,9 @@ def test_access_controls(dummy_backend):
         dummy_backend.bot_config.ACCESS_CONTROLS = test.get("acl", {})
         dummy_backend.bot_config.BOT_ADMINS = test.get("bot_admins", ())
         logger = logging.getLogger(__name__)
-        logger.info("** message: {}".format(test["message"].body))
-        logger.info("** bot_admins: {}".format(dummy_backend.bot_config.BOT_ADMINS))
-        logger.info("** acl: {!r}".format(dummy_backend.bot_config.ACCESS_CONTROLS))
+        logger.info(f"** message: {test['message'].body}")
+        logger.info(f"** bot_admins: {dummy_backend.bot_config.BOT_ADMINS}")
+        logger.info(f"** acl: {dummy_backend.bot_config.ACCESS_CONTROLS}")
         logger.info(
             "** acl_default: {!r}".format(
                 dummy_backend.bot_config.ACCESS_CONTROLS_DEFAULT
diff --git a/tests/commandnotfound_plugin/commandnotfound.py b/tests/commandnotfound_plugin/commandnotfound.py
index 3fe7e115..4a248579 100644
--- a/tests/commandnotfound_plugin/commandnotfound.py
+++ b/tests/commandnotfound_plugin/commandnotfound.py
@@ -7,4 +7,4 @@ class TestCommandNotFoundFilter(BotPlugin):
         if not emptycmd:
             return msg, cmd, args
 
-        return "Command fell through: {}".format(msg)
+        return f"Command fell through: {msg}"
diff --git a/tests/commands_test.py b/tests/commands_test.py
index cdbfa212..8d33df57 100644
--- a/tests/commands_test.py
+++ b/tests/commands_test.py
@@ -112,10 +112,7 @@ def test_plugin_cycle(testbot):
     ]
 
     for plugin in plugins:
-        testbot.assertInCommand(
-            f"!repos install {plugin}",
-            f"Installing {plugin}..."
-        ),
+        testbot.assertInCommand(f"!repos install {plugin}", f"Installing {plugin}..."),
         assert (
             "A new plugin repository has been installed correctly from errbotio/err-helloworld"
             in testbot.pop_message(timeout=60)
diff --git a/tests/room_plugin/roomtest.py b/tests/room_plugin/roomtest.py
index 4571624d..fbf87b48 100644
--- a/tests/room_plugin/roomtest.py
+++ b/tests/room_plugin/roomtest.py
@@ -13,13 +13,13 @@ class RoomTest(BotPlugin):
 
     def callback_room_joined(self, room, user, invited_by):
         log.info("join")
-        self.events.put("callback_room_joined {!s}".format(room))
+        self.events.put(f"callback_room_joined {room}")
 
     def callback_room_left(self, room, user, kicked_by):
-        self.events.put("callback_room_left {!s}".format(room))
+        self.events.put(f"callback_room_left {room}")
 
     def callback_room_topic(self, room):
-        self.events.put("callback_room_topic {}".format(room.topic))
+        self.events.put(f"callback_room_topic {room.topic}")
 
     def purge(self):
         log.info("purge")