Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def safe_requirement(requirement):
safe = requirement.lower().replace('_', '-')
parsed = util.parse_requirement(safe)
output = parsed.name
if parsed.extras:
output += '[{0}]'.format(','.join(parsed.extras))
if parsed.constraints:
def c(operator, version):
return version if operator == '==' \
else '{0} {1}'.format(operator, version)
output += ' ({0})'.format(
', '.join(c(*i) for i in parsed.constraints))
return output
def locate(self, requirement, prereleases=True):
pkg = dutil.parse_requirement(requirement)
for locator in self.locators:
# We're not using `util.safe_name` here cause it does actually the
# opposite of what we need. PyPi packages with underscores (`_`)
# will fall back to hyphens (`-`) but the opposite is not true.
name = pkg.name.lower().replace('-', '_')
versions = locator.get_project(name)
package = find_packages(locator, pkg, versions)
if package:
return package
# base_project_url = 'https://www.red-dove.com/pypi/projects/'
base_project_url = 'http://ciupy3-projects.global.ssl.fastly.net/pypi/projects/'
def get_project_data(name):
url = '%s%s/%s/project.json' % (base_project_url, name[0].upper(), name)
return util._get_external_data(url)
util.get_project_data = get_project_data
def get_package_data(name, version):
url = ('%s%s/%s/package-%s.json' % (base_project_url, name[0].upper(),
name, version))
return util._get_external_data(url)
util.get_package_data = get_package_data
def get_package_data(name, version):
url = ('%s%s/%s/package-%s.json' % (_base_project_url, name[0].upper(),
name, version))
return distlib.util._get_external_data(url)
distlib.util.get_package_data = get_package_data
def get_project_data(name):
url = '%s%s/%s/project.json' % (base_project_url, name[0].upper(), name)
return util._get_external_data(url)
util.get_project_data = get_project_data
# coding: utf8
import sysconfig
import distlib.util as util
PYTHON_VERSION = sysconfig.get_python_version()
LIB_PATH = sysconfig.get_path('platlib')
IS_VENV = util.in_venv()
import distlib.util
# Use the Fastly CDN instead of red-dove.com for reliability.
_base_project_url = 'http://ciupy3-projects.global.ssl.fastly.net/pypi/projects/'
def get_project_data(name):
url = '%s%s/%s/project.json' % (_base_project_url, name[0].upper(), name)
return distlib.util._get_external_data(url)
distlib.util.get_project_data = get_project_data
del get_project_data
def get_package_data(name, version):
url = ('%s%s/%s/package-%s.json' % (_base_project_url, name[0].upper(),
name, version))
return distlib.util._get_external_data(url)
distlib.util.get_package_data = get_package_data
del get_package_data
try:
CPU_COUNT = max(2, multiprocessing.cpu_count())
except NotImplementedError: #pragma: no cover
CPU_COUNT = 2
def check(requirements_paths=[], metadata=[], projects=[]):
"""Return True if all of the specified dependencies have been ported to Python 3.
The requirements_paths argument takes a sequence of file paths to
requirements files. The 'metadata' argument takes a sequence of strings
representing metadata. The 'projects' argument takes a sequence of project
names.
from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app # noqa
from distlib import util
# base_project_url = 'https://www.red-dove.com/pypi/projects/'
base_project_url = 'http://ciupy3-projects.global.ssl.fastly.net/pypi/projects/'
def get_project_data(name):
url = '%s%s/%s/project.json' % (base_project_url, name[0].upper(), name)
return util._get_external_data(url)
util.get_project_data = get_project_data
def get_package_data(name, version):
url = ('%s%s/%s/package-%s.json' % (base_project_url, name[0].upper(),
name, version))
return util._get_external_data(url)
util.get_package_data = get_package_data
def get_project_data(name):
url = '%s%s/%s/project.json' % (_base_project_url, name[0].upper(), name)
return distlib.util._get_external_data(url)
distlib.util.get_project_data = get_project_data
from __future__ import unicode_literals
from caniusepython3 import __main__ as main
from caniusepython3 import pypi
import multiprocessing
import distlib.util
# Use the Fastly CDN instead of red-dove.com for reliability.
_base_project_url = 'http://ciupy3-projects.global.ssl.fastly.net/pypi/projects/'
def get_project_data(name):
url = '%s%s/%s/project.json' % (_base_project_url, name[0].upper(), name)
return distlib.util._get_external_data(url)
distlib.util.get_project_data = get_project_data
del get_project_data
def get_package_data(name, version):
url = ('%s%s/%s/package-%s.json' % (_base_project_url, name[0].upper(),
name, version))
return distlib.util._get_external_data(url)
distlib.util.get_package_data = get_package_data
del get_package_data
try:
CPU_COUNT = max(2, multiprocessing.cpu_count())
except NotImplementedError: #pragma: no cover
CPU_COUNT = 2
def check(requirements_paths=[], metadata=[], projects=[]):