Projet

Général

Profil

Development #36518

Imports relatifs

Ajouté par Frédéric Péters il y a plus de 4 ans. Mis à jour il y a plus de 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
30 septembre 2019
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Comme #36517.


Fichiers


Demandes liées

Lié à w.c.s. - Development #36517: Imports relatifsFermé30 septembre 2019

Actions
Lié à w.c.s. - Development #36515: Tourner (les tests) en Python 3Fermé30 septembre 201930 novembre 2019

Actions

Révisions associées

Révision 3e037e2e (diff)
Ajouté par Frédéric Péters il y a plus de 4 ans

misc: use relative imports (#36518)

Historique

#1

Mis à jour par Frédéric Péters il y a plus de 4 ans

#2

Mis à jour par Frédéric Péters il y a plus de 4 ans

#3

Mis à jour par Thomas Noël il y a plus de 4 ans

  • Statut changé de Solution proposée à Solution validée
#4

Mis à jour par Frédéric Péters il y a plus de 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)

(entre la synchro des pushs wcs et auquotidien, peut-être que ça va échouer un cas dans jenkins, je surveille).

commit 3e037e2e95cb8ce6948536a615a26357ab0bd995
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Sun Sep 29 20:51:22 2019 +0200

    misc: use relative imports (#36518)
#5

Mis à jour par Frédéric Péters il y a plus de 4 ans

#6

Mis à jour par Benjamin Dauvergne il y a plus de 4 ans

  • Statut changé de Résolu (à déployer) à En cours

J'ai ça lors des tests bijoe :

popenargs = (['wcs/wcsctl.py', 'runscript', '--app-dir', '/tmp/pytest-of-bdauvergne/pytest-251/wcs4', '--vhost', '127.0.0.1', ...],), kwargs = {}, retcode = 1
cmd = ['wcs/wcsctl.py', 'runscript', '--app-dir', '/tmp/pytest-of-bdauvergne/pytest-251/wcs4', '--vhost', '127.0.0.1', ...]

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.

        The arguments are the same as for the Popen constructor.  Example:

        check_call(["ls", "-l"])
        """ 
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           CalledProcessError: Command '['wcs/wcsctl.py', 'runscript', '--app-dir', '/tmp/pytest-of-bdauvergne/pytest-251/wcs4', '--vhost', '127.0.0.1', '/tmp/pytest-of-bdauvergne/pytest-251/wcs4/setup-auth.py']' returned non-zero exit status 1

/usr/lib/python2.7/subprocess.py:190: CalledProcessError
--------------------------------------------------------------------------- Captured stderr setup ---------------------------------------------------------------------------
Traceback (most recent call last):
  File "wcs/wcsctl.py", line 11, in <module>
    ctl.run(sys.argv[1:])
  File "/home/bdauvergne/wd/eo/wcs-olap/wcs/wcs/qommon/ctl.py", line 160, in run
    return cmd.run(args, options)
  File "/home/bdauvergne/wd/eo/wcs-olap/wcs/wcs/qommon/ctl.py", line 70, in run
    return self.execute(base_options, sub_options, args)
  File "/home/bdauvergne/wd/eo/wcs-olap/wcs/wcs/ctl/runscript.py", line 37, in execute
    import publisher
  File "/home/bdauvergne/wd/eo/wcs-olap/wcs/wcs/publisher.py", line 32, in <module>
    from .qommon.publisher import set_publisher_class, QommonPublisher
ValueError: Attempted relative import in non-package
------------------------------------------------------- generated xml file: /home/bdauvergne/wd/eo/wcs-olap/junit.xml -------------------------------------------------------

---------- coverage: platform linux2, python 2.7.16-final-0 ----------
Coverage HTML written to dir htmlcov
Coverage XML written to file coverage.xml

PS:

bdauvergne@revestel:~/wd/eo/wcs$ git grep 'import publisher'
tests/test_categories.py:from wcs import publisher
tests/test_datasource.py:from wcs import publisher
tests/test_storage.py:from wcs import publisher
tests/test_users.py:from wcs import publisher
tests/test_widgets.py:from wcs import publisher
tests/test_workflow_import.py:from wcs import publisher
tests/utilities.py:from wcs import publisher, compat
wcs/ctl/backup.py:        import publisher
wcs/ctl/check_hobos.py:        import publisher
wcs/ctl/check_hobos.py:        import publisher
wcs/ctl/delete_tenant.py:        import publisher
wcs/ctl/export_settings.py:        import publisher
wcs/ctl/hobo_notify.py:        import publisher
wcs/ctl/process_bounce.py:        from .. import publisher
wcs/ctl/rebuild_indexes.py:        import publisher
wcs/ctl/restore.py:        import publisher
wcs/ctl/runscript.py:        import publisher
wcs/ctl/shell.py:        import publisher
wcs/ctl/wipe_data.py:        import publisher
wcs/qommon/__init__.py:from . import publisher

#7

Mis à jour par Frédéric Péters il y a plus de 4 ans

Curieux qu'ils soient passés, mais ok, j'avais du coup zappé les "import publisher" faits dans ces commandes, je corrige.

#8

Mis à jour par Frédéric Péters il y a plus de 4 ans

Et j'ai fait des grep plus extensifs sans rien noter.

#9

Mis à jour par Benjamin Dauvergne il y a plus de 4 ans

  • Statut changé de Solution proposée à Solution validée
#10

Mis à jour par Frédéric Péters il y a plus de 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)

C'était le mauvais ticket réouvert mais j'ai vu ça à temps pour corriger dans le message de commit.

commit 8b9c2f838edf462eea560dc329b924d4848e885e
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Mon Sep 30 13:31:47 2019 +0200

    misc: use relative imports to get publisher in ctl command (#36517)
#11

Mis à jour par Frédéric Péters il y a plus de 4 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF