Skip to content

Restricted Guests Synapse module: Fix the check_codestyle tox job by bumping flake8 from 4.0.1 -> 7.3.0#186

Open
anoadragon453 wants to merge 1 commit intoelement-hq:mainfrom
anoadragon453:anoa/update_flake
Open

Restricted Guests Synapse module: Fix the check_codestyle tox job by bumping flake8 from 4.0.1 -> 7.3.0#186
anoadragon453 wants to merge 1 commit intoelement-hq:mainfrom
anoadragon453:anoa/update_flake

Conversation

@anoadragon453
Copy link
Copy Markdown
Member

Otherwise we get this cryptic error when trying to lint the Restricted Guests Synapse module:

➜ tox -e check_codestyle
.pkg: _optional_hooks> python /home/work/code/element-modules/.venv/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_sdist> python /home/work/code/element-modules/.venv/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_wheel> python /home/work/code/element-modules/.venv/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: prepare_metadata_for_build_wheel> python /home/work/code/element-modules/.venv/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_sdist> python /home/work/code/element-modules/.venv/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
check_codestyle: recreate env because dependencies removed: flake8==7.1.1
check_codestyle: remove tox env folder /home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle
check_codestyle: install_package_deps> python -I -m pip install aiounittest attrs black==22.3.0 coverage flake8==4.0.1 isort==5.9.3 matrix-synapse mypy==1.10.0 parameterized pydantic==2.4.2 tox twisted
check_codestyle: install_package> python -I -m pip install --force-reinstall --no-deps /home/work/code/element-modules/modules/restricted-guests/synapse/.tox/.tmp/package/63/synapse_guest_module-1.0.0.tar.gz
check_codestyle: commands[0]> flake8 synapse_guest_module tests
Traceback (most recent call last):
  File "/home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle/bin/flake8", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle/lib/python3.12/site-packages/flake8/main/cli.py", line 22, in main
    app.run(argv)
  File "/home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle/lib/python3.12/site-packages/flake8/main/application.py", line 375, in run
    self._run(argv)
  File "/home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle/lib/python3.12/site-packages/flake8/main/application.py", line 363, in _run
    self.initialize(argv)
  File "/home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle/lib/python3.12/site-packages/flake8/main/application.py", line 343, in initialize
    self.find_plugins(config_finder)
  File "/home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle/lib/python3.12/site-packages/flake8/main/application.py", line 157, in find_plugins
    self.check_plugins = plugin_manager.Checkers(local_plugins.extension)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle/lib/python3.12/site-packages/flake8/plugins/manager.py", line 363, in __init__
    self.manager = PluginManager(
                   ^^^^^^^^^^^^^^
  File "/home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle/lib/python3.12/site-packages/flake8/plugins/manager.py", line 243, in __init__
    self._load_entrypoint_plugins()
  File "/home/work/code/element-modules/modules/restricted-guests/synapse/.tox/check_codestyle/lib/python3.12/site-packages/flake8/plugins/manager.py", line 261, in _load_entrypoint_plugins
    eps = importlib_metadata.entry_points().get(self.namespace, ())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'EntryPoints' object has no attribute 'get'
check_codestyle: exit 1 (0.09 seconds) /home/work/code/element-modules/modules/restricted-guests/synapse> flake8 synapse_guest_module tests pid=3205348
  check_codestyle: FAIL code 1 (30.23=setup[30.14]+cmd[0.09] seconds)
  evaluation failed :( (30.25 seconds)

Bumping the flake8 version fixes this, with no code style changes needed.

@anoadragon453 anoadragon453 requested a review from a team as a code owner January 23, 2026 17:12
@t3chguy
Copy link
Copy Markdown
Member

t3chguy commented Jan 23, 2026

Looks like a dup of #101 - why 7.1.1 over 7.3.0 ooi?

7.3.0 is the latest version at the time of writing.
@anoadragon453 anoadragon453 changed the title Restricted Guests Synapse module: Fix the check_codestyle tox job by bumping flake8 from 4.0.1 -> 7.1.1 Restricted Guests Synapse module: Fix the check_codestyle tox job by bumping flake8 from 4.0.1 -> 7.3.0 Jan 23, 2026
@anoadragon453
Copy link
Copy Markdown
Member Author

Looks like a dup of #101

So it is 🤦 Feel free to pick your favourite!

@t3chguy
Copy link
Copy Markdown
Member

t3chguy commented Jan 23, 2026

/me is unable to review either so is free of any decision making here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants