pypi.lister: Normalize pypi name to PyPI
Related T422
This commit is contained in:
parent
cba22b7d19
commit
ed64d24634
5 changed files with 12 additions and 12 deletions
|
@ -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()
|
||||
>>>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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/'
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue