Page MenuHomeSoftware Heritage

requirements-swh: Bump requirements to fix webapp build
AbandonedPublic

Authored by ardumont on Oct 22 2020, 3:58 PM.

Details

Reviewers
anlambert
Group Reviewers
Reviewers
Summary

That fixes the build [1] to unstuck @anlambert.

I'm not entirely satisfied though but i don't see how to fix it otherwise. I
don't really get what's pulling this (I see nothing explicitely requiring
something from the core.db...).

D4300 (included in swh.core 0.6.1) does introduce the new postgresql_fact
fixture factory (to make pg db tests using the built fixture ouf of that
factory faster). Which pulls the pytest_postgresql as runtime dependency...

[1] https://jenkins.softwareheritage.org/job/DWAPPS/job/tests/1743/console

Test Plan

tox

Diff Detail

Repository
rDWAPPS Web applications
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16559
Build 25520: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 25519: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D4332 (id=15332)

Rebasing onto d3b1bf3839...

Current branch diff-target is up to date.
Changes applied before test
commit fe2117ba8cfe64c5602dfa4ab73e1f7477bcdd6e
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Oct 22 15:53:57 2020 +0200

    requirements-swh: Bump requirements to fix build
    
    https://jenkins.softwareheritage.org/job/DWAPPS/job/tests/1743/console

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

Why don't you make the pytest_postgresql import optional in swh-core?

or move it to a new file (eg. swh/core/db/db_testing.py), that doesn't get transitively imported by swh-web

Why don't you make the pytest_postgresql import optional in swh-core?

something like

try:
    from pytest_postgres import ...
except ImportError:
    pass

?

or move it to a new file (eg. swh/core/db/db_testing.py), that doesn't get transitively imported by swh-web

but is the other module that actually need it will be able to work with it then?

I missed that diff during the afternoon. I am not a big fan of getting postgresql related modules when installing swh-web.

The fix should be done at the swh-core level IMHO. Same opinion as @vlorentz the pytest_postgresql module should not be imported by transitivity.

The fix should be done at the swh-core level IMHO. Same opinion as @vlorentz the pytest_postgresql module should not be imported by transitivity.

Based on mr grep results, the SWHDatabaseJanitor class could be moved to swh/core/db/pytest_plugin.py

18:31 $ mr grep SWHDatabaseJanitor
mr grep: /home/anlambert/swh/swh-environment/snippets

mr grep: /home/anlambert/swh/swh-environment/swh-core
swh/core/db/db_utils.py:class SWHDatabaseJanitor(DatabaseJanitor):
swh/core/db/pytest_plugin.py:from swh.core.db.db_utils import SWHDatabaseJanitor
swh/core/db/pytest_plugin.py:        with SWHDatabaseJanitor(

Thanks, closing this wrong fix.