Page MenuHomeSoftware Heritage

requirements: Workaround another ImportError when running pytest
ClosedPublic

Authored by anlambert on Feb 21 2022, 1:54 PM.

Details

Summary

When calling ./bin/install from swh-environment in a freshly created
venv, for some reason pip will end up installing flask==1.1.2 when
processing swh-web (likely related to the venv state after installing
other swh modules).

That flask version is quite outdated and will fail to import the json
module from the version of itsdangerous installed in the venv.

So as a workaround pin flask to the first version that does not trigger
that ImportError issue.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build has FAILED

Patch application report for D7207 (id=26123)

Rebasing onto f7b35626cb...

Current branch diff-target is up to date.
Changes applied before test
commit 1ba97695000bbdd40fc9b1cf2e8723275ae29ce0
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Feb 21 13:44:30 2022 +0100

    requirements: Workaround another ImportError when running pytest
    
    When calling "./bin/install" from swh-environment in a freshly created
    venv, for some reason pip will end up installing flask==1.1.2 when
    processing swh-web (likely related to the venv state after installing
    other swh modules).
    
    That flask version is quite outdated and will fail to import the json
    module from the version of itsdangerous installed in the venv.
    
    So as a workaround pin flask to the first version that does not trigger
    that ImportError issue.

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1392/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1392/console

Harbormaster returned this revision to the author for changes because remote builds failed.Feb 21 2022, 1:56 PM
Harbormaster failed remote builds in B26993: Diff 26123!

Remove file committed by mistake

Build is green

Patch application report for D7207 (id=26124)

Rebasing onto f7b35626cb...

Current branch diff-target is up to date.
Changes applied before test
commit 55aa143db84a0061b412bc67baf1f7d78e6450da
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Feb 21 13:55:53 2022 +0100

    requirements: Workaround another ImportError when running pytest
    
    When calling "./bin/install" from swh-environment in a freshly created
    venv, for some reason pip will end up installing flask==1.1.2 when
    processing swh-web (likely related to the venv state after installing
    other swh modules).
    
    That flask version is quite outdated and will fail to import the json
    module from the version of itsdangerous installed in the venv.
    
    So as a workaround pin flask to the first version that does not trigger
    that ImportError issue.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1393/ for more details.

This revision is now accepted and ready to land.Feb 21 2022, 2:18 PM