Latest dev packages astroid/black cause format/lint failures

Error:

Latest versions of Python dev packages Astroid and Black cause format and lint checks to fail.

Can be resolve by pinning astroid==2.13.2 and black==22.12.0, or by not updating Python deps.

Version info:

  • Anki Desktop version: main branch commit b97d1ac
  • OS version: Ubuntu 22.04.1 LTS amd64
  • Problem package versions: Astroid 2.14.1, Black 23.1.0
  • Previous package versions: Astroid 2.13.2, Black 22.12.0

Reproduce:

  • Checkout current Anki Desktop:

    git checkout b97d1ac
    

  • Update Python dependencies:

    pushd python
    ./update_python_deps.sh all
    popd
    

  • Run Anki to build:

    ./run
    

  • Run checks:

    ./ninja check
    

Expected result:

Checks pass:

Build succeeded.

Actual result:

  • Build failure:

    ninja: build stopped: subcommand failed.
    
    Build failed.
    

  • Files failing checks:

    • ftl/transform-string.py
    • pylib/anki/dbproxy.py
    • pylib/anki/exporting.py
    • pylib/anki/httpclient.py
    • pylib/anki/importing/anki2.py
    • pylib/anki/importing/base.py
    • pylib/anki/importing/csvfile.py
    • pylib/anki/importing/mnemo.py
    • pylib/anki/importing/noteimp.py
    • pylib/anki/importing/supermemo_xml.py
    • pylib/anki/media.py
    • pylib/anki/stats.py
    • pylib/anki/stdmodels.py
    • pylib/anki/_vendor/stringcase.py
    • pylib/tools/genfluent.py
    • qt/aqt/addons.py
    • qt/aqt/changenotetype.py
    • qt/aqt/deckbrowser.py
    • qt/aqt/deckdescription.py
    • qt/aqt/editor.py
    • qt/aqt/import_export/import_csv_dialog.py
    • qt/aqt/importing.py
    • qt/aqt/init.py
    • qt/aqt/mediasrv.py
    • qt/aqt/models.py
    • qt/aqt/reviewer.py
    • qt/aqt/sound.py
    • qt/aqt/stats.py
    • qt/aqt/toolbar.py
    • qt/aqt/update.py
    • qt/aqt/utils.py

Patch to resolve:

diff --git a/python/requirements.dev.in b/python/requirements.dev.in
index 18f16d7c7..0333401f9 100644
--- a/python/requirements.dev.in
+++ b/python/requirements.dev.in
@@ -1,6 +1,7 @@
 -r requirements.bundle.txt
 
-black
+astroid==2.13.2
+black==22.12.0
 compare-locales
 isort
 mock

Thanks for the heads up. As the lock files in the repo already pin specific versions and this only affects tests, I will probably leave things as they are for now, and reformat the files when it comes time to update all the Python deps again.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.