extend missing-releases to look at pypi
Extend the missing-releases command to look at PyPI for uploads there. Change-Id: I5693686bbe46a4ec90944bbf2fa81e1c5c91749e Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
ceeb3cea0d
commit
6c7a19708b
@ -29,6 +29,7 @@ from requests.packages import urllib3
|
|||||||
from openstack_releases import defaults
|
from openstack_releases import defaults
|
||||||
from openstack_releases import gitutils
|
from openstack_releases import gitutils
|
||||||
from openstack_releases import links
|
from openstack_releases import links
|
||||||
|
from openstack_releases import pythonutils
|
||||||
from openstack_releases import yamlutils
|
from openstack_releases import yamlutils
|
||||||
|
|
||||||
urllib3.disable_warnings()
|
urllib3.disable_warnings()
|
||||||
@ -164,6 +165,19 @@ def main():
|
|||||||
project) + '.asc',
|
project) + '.asc',
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
sdist_name = pythonutils.guess_sdist_name(project)
|
||||||
|
pypi_info = pythonutils.get_pypi_info(sdist_name)
|
||||||
|
if release['version'] not in pypi_info.get('releases', {}):
|
||||||
|
msg = ('{} dist with version {} '
|
||||||
|
'not uploaded to PyPI').format(
|
||||||
|
sdist_name, release['version'])
|
||||||
|
print(' {}'.format(msg))
|
||||||
|
errors.append(msg)
|
||||||
|
else:
|
||||||
|
print(' found version {} on PyPI'.format(
|
||||||
|
release['version']))
|
||||||
|
|
||||||
print()
|
print()
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
|
@ -12,10 +12,15 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def get_sdist_name(workdir, repo):
|
def get_sdist_name(workdir, repo):
|
||||||
"Check out the code."
|
"Check out the code."
|
||||||
@ -46,3 +51,18 @@ def get_sdist_name(workdir, repo):
|
|||||||
print('Results: %s' % (out,))
|
print('Results: %s' % (out,))
|
||||||
name = out.splitlines()[-1].strip()
|
name = out.splitlines()[-1].strip()
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
|
||||||
|
def guess_sdist_name(project):
|
||||||
|
"Guess the name without checking out the repo."
|
||||||
|
repo_base = project['repo'].rsplit('/')[-1]
|
||||||
|
base = project.get('tarball-base', repo_base)
|
||||||
|
return base
|
||||||
|
|
||||||
|
|
||||||
|
def get_pypi_info(dist_name):
|
||||||
|
"Return PyPI information for the distribution."
|
||||||
|
LOG.debug('looking at PyPI for {}'.format(dist_name))
|
||||||
|
url = 'https://pypi.python.org/pypi/{}/json'.format(dist_name)
|
||||||
|
LOG.debug(url)
|
||||||
|
return requests.get(url).json()
|
||||||
|
Loading…
Reference in New Issue
Block a user