From ed64d24634fe02f3ae474be313718d9de9d39a73 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" Date: Fri, 14 Sep 2018 13:24:48 +0200 Subject: [PATCH] pypi.lister: Normalize pypi name to PyPI Related T422 --- README.md | 2 +- swh/lister/cli.py | 4 ++-- swh/lister/pypi/lister.py | 6 +++--- swh/lister/pypi/models.py | 4 ++-- swh/lister/pypi/tasks.py | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0607ce4..f1a1711 100644 --- a/README.md +++ b/README.md @@ -198,5 +198,5 @@ Note: This expects storage (5002) and scheduler (5008) services to run locally Python 3.6.6 (default, Jun 27 2018, 14:44:17) [GCC 8.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. - >>> from swh.lister.pypi.tasks import PyPiListerTask; PyPiListerTask().run_task() + >>> from swh.lister.pypi.tasks import PyPIListerTask; PyPIListerTask().run_task() >>> diff --git a/swh/lister/cli.py b/swh/lister/cli.py index 4997fe6..c5503ec 100644 --- a/swh/lister/cli.py +++ b/swh/lister/cli.py @@ -73,8 +73,8 @@ def cli(db_url, lister, create_tables, drop_tables, with_data): elif lister == 'pypi': from .pypi.models import ModelBase - from .pypi.lister import PyPiLister - _lister = PyPiLister(override_config=override_conf) + from .pypi.lister import PyPILister + _lister = PyPILister(override_config=override_conf) else: raise ValueError('Only supported listers are %s' % SUPPORTED_LISTERS) diff --git a/swh/lister/pypi/lister.py b/swh/lister/pypi/lister.py index 6d04d78..4d1b54e 100644 --- a/swh/lister/pypi/lister.py +++ b/swh/lister/pypi/lister.py @@ -5,15 +5,15 @@ import random import xmltodict -from .models import PyPiModel +from .models import PyPIModel from swh.scheduler import utils from swh.lister.core.simple_lister import SimpleLister from swh.lister.core.lister_transports import ListerOnePageApiTransport -class PyPiLister(ListerOnePageApiTransport, SimpleLister): - MODEL = PyPiModel +class PyPILister(ListerOnePageApiTransport, SimpleLister): + MODEL = PyPIModel LISTER_NAME = 'pypi' PAGE = 'https://pypi.org/simple/' diff --git a/swh/lister/pypi/models.py b/swh/lister/pypi/models.py index b035f4c..f34eef9 100644 --- a/swh/lister/pypi/models.py +++ b/swh/lister/pypi/models.py @@ -7,8 +7,8 @@ from sqlalchemy import Column, String from ..core.models import ModelBase -class PyPiModel(ModelBase): - """a PyPi repository representation +class PyPIModel(ModelBase): + """a PyPI repository representation """ __tablename__ = 'pypi_repo' diff --git a/swh/lister/pypi/tasks.py b/swh/lister/pypi/tasks.py index d8b0e2c..df2d275 100644 --- a/swh/lister/pypi/tasks.py +++ b/swh/lister/pypi/tasks.py @@ -3,17 +3,17 @@ # See top-level LICENSE file for more information from ..core.tasks import ListerTaskBase -from .lister import PyPiLister +from .lister import PyPILister -class PyPiListerTask(ListerTaskBase): - """Full PyPi lister (list all available origins from the api). +class PyPIListerTask(ListerTaskBase): + """Full PyPI lister (list all available origins from the api). """ task_queue = 'swh_lister_pypi_refresh' def new_lister(self): - return PyPiLister() + return PyPILister() def run_task(self): lister = self.new_lister()