Merge pull request #92 from yan12125/fix-pypi

pypi: fix valueless items
This commit is contained in:
依云 2019-01-07 14:19:50 +08:00 committed by GitHub
commit 2f24822c88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -8,7 +8,7 @@ python:
- "3.7"
- "nightly"
- "pypy3.5"
install: pip install -U $DEPS pytest pytest-asyncio pytest-xdist flaky structlog
install: pip install -U $DEPS "pytest<4.1" pytest-asyncio pytest-xdist flaky structlog
script: pytest
env:
global:

View File

@ -1,18 +1,14 @@
# MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
from . import cmd, conf_cacheable_with_name, session
from . import conf_cacheable_with_name, session
get_cacheable_conf = conf_cacheable_with_name('pypi')
async def get_version(name, conf, **kwargs):
package = conf.get('pypi')
package = conf.get('pypi') or name
use_pre_release = conf.getboolean('use_pre_release', False)
headers = {
'Accept': 'application/json',
'User-Agent': 'lilydjwg/nvchecker',
}
url = 'https://pypi.org/pypi/{}/json'.format(package)
async with session.get(url) as res: