Eliminado venv y www del repositorio, agrege un requirements igual
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
# The following comment should be removed at some point in the future.
|
||||
# mypy: disallow-untyped-defs=False
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
from pip._internal.utils.logging import indent_log
|
||||
from pip._internal.utils.misc import (
|
||||
display_path, rmtree, split_auth_from_netloc,
|
||||
display_path,
|
||||
is_console_interactive,
|
||||
rmtree,
|
||||
split_auth_from_netloc,
|
||||
)
|
||||
from pip._internal.utils.subprocess import make_command
|
||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||
from pip._internal.vcs.versioncontrol import VersionControl, vcs
|
||||
|
||||
@@ -19,8 +25,11 @@ _svn_info_xml_url_re = re.compile(r'<url>(.*)</url>')
|
||||
|
||||
|
||||
if MYPY_CHECK_RUNNING:
|
||||
from typing import List, Optional, Tuple
|
||||
from pip._internal.vcs.versioncontrol import RevOptions
|
||||
from typing import Optional, Tuple
|
||||
from pip._internal.utils.subprocess import CommandArgs
|
||||
from pip._internal.utils.misc import HiddenText
|
||||
from pip._internal.vcs.versioncontrol import AuthInfo, RevOptions
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -47,7 +56,7 @@ class Subversion(VersionControl):
|
||||
# Note: taken from setuptools.command.egg_info
|
||||
revision = 0
|
||||
|
||||
for base, dirs, files in os.walk(location):
|
||||
for base, dirs, _ in os.walk(location):
|
||||
if cls.dirname not in dirs:
|
||||
dirs[:] = []
|
||||
continue # no sense walking uncontrolled subdirs
|
||||
@@ -82,6 +91,7 @@ class Subversion(VersionControl):
|
||||
|
||||
@classmethod
|
||||
def get_url_rev_and_auth(cls, url):
|
||||
# type: (str) -> Tuple[str, Optional[str], AuthInfo]
|
||||
# hotfix the URL scheme after removing svn+ from svn+ssh:// readd it
|
||||
url, rev, user_pass = super(Subversion, cls).get_url_rev_and_auth(url)
|
||||
if url.startswith('ssh://'):
|
||||
@@ -90,7 +100,8 @@ class Subversion(VersionControl):
|
||||
|
||||
@staticmethod
|
||||
def make_rev_args(username, password):
|
||||
extra_args = []
|
||||
# type: (Optional[str], Optional[HiddenText]) -> CommandArgs
|
||||
extra_args = [] # type: CommandArgs
|
||||
if username:
|
||||
extra_args += ['--username', username]
|
||||
if password:
|
||||
@@ -121,7 +132,7 @@ class Subversion(VersionControl):
|
||||
|
||||
@classmethod
|
||||
def _get_svn_url_rev(cls, location):
|
||||
from pip._internal.exceptions import InstallationError
|
||||
from pip._internal.exceptions import SubProcessError
|
||||
|
||||
entries_path = os.path.join(location, cls.dirname, 'entries')
|
||||
if os.path.exists(entries_path):
|
||||
@@ -140,7 +151,8 @@ class Subversion(VersionControl):
|
||||
elif data.startswith('<?xml'):
|
||||
match = _svn_xml_url_re.search(data)
|
||||
if not match:
|
||||
raise ValueError('Badly formatted data: %r' % data)
|
||||
raise ValueError(
|
||||
'Badly formatted data: {data!r}'.format(**locals()))
|
||||
url = match.group(1) # get repository URL
|
||||
revs = [int(m.group(1)) for m in _svn_rev_re.finditer(data)] + [0]
|
||||
else:
|
||||
@@ -153,13 +165,12 @@ class Subversion(VersionControl):
|
||||
# are only potentially needed for remote server requests.
|
||||
xml = cls.run_command(
|
||||
['info', '--xml', location],
|
||||
show_stdout=False,
|
||||
)
|
||||
url = _svn_info_xml_url_re.search(xml).group(1)
|
||||
revs = [
|
||||
int(m.group(1)) for m in _svn_info_xml_rev_re.finditer(xml)
|
||||
]
|
||||
except InstallationError:
|
||||
except SubProcessError:
|
||||
url, revs = None, []
|
||||
|
||||
if revs:
|
||||
@@ -177,7 +188,7 @@ class Subversion(VersionControl):
|
||||
def __init__(self, use_interactive=None):
|
||||
# type: (bool) -> None
|
||||
if use_interactive is None:
|
||||
use_interactive = sys.stdin.isatty()
|
||||
use_interactive = is_console_interactive()
|
||||
self.use_interactive = use_interactive
|
||||
|
||||
# This member is used to cache the fetched version of the current
|
||||
@@ -202,13 +213,16 @@ class Subversion(VersionControl):
|
||||
# compiled Feb 25 2019, 14:20:39 on x86_64-apple-darwin17.0.0
|
||||
# svn, version 1.7.14 (r1542130)
|
||||
# compiled Mar 28 2018, 08:49:13 on x86_64-pc-linux-gnu
|
||||
# svn, version 1.12.0-SlikSvn (SlikSvn/1.12.0)
|
||||
# compiled May 28 2019, 13:44:56 on x86_64-microsoft-windows6.2
|
||||
version_prefix = 'svn, version '
|
||||
version = self.run_command(['--version'], show_stdout=False)
|
||||
version = self.run_command(['--version'])
|
||||
|
||||
if not version.startswith(version_prefix):
|
||||
return ()
|
||||
|
||||
version = version[len(version_prefix):].split()[0]
|
||||
version_list = version.split('.')
|
||||
version_list = version.partition('-')[0].split('.')
|
||||
try:
|
||||
parsed_version = tuple(map(int, version_list))
|
||||
except ValueError:
|
||||
@@ -238,7 +252,7 @@ class Subversion(VersionControl):
|
||||
return vcs_version
|
||||
|
||||
def get_remote_call_options(self):
|
||||
# type: () -> List[str]
|
||||
# type: () -> CommandArgs
|
||||
"""Return options to be used on calls to Subversion that contact the server.
|
||||
|
||||
These options are applicable for the following ``svn`` subcommands used
|
||||
@@ -271,6 +285,7 @@ class Subversion(VersionControl):
|
||||
return []
|
||||
|
||||
def export(self, location, url):
|
||||
# type: (str, HiddenText) -> None
|
||||
"""Export the svn repository at the url to the destination location"""
|
||||
url, rev_options = self.get_url_rev_options(url)
|
||||
|
||||
@@ -280,12 +295,14 @@ class Subversion(VersionControl):
|
||||
# Subversion doesn't like to check out over an existing
|
||||
# directory --force fixes this, but was only added in svn 1.5
|
||||
rmtree(location)
|
||||
cmd_args = (['export'] + self.get_remote_call_options() +
|
||||
rev_options.to_args() + [url, location])
|
||||
self.run_command(cmd_args, show_stdout=False)
|
||||
cmd_args = make_command(
|
||||
'export', self.get_remote_call_options(),
|
||||
rev_options.to_args(), url, location,
|
||||
)
|
||||
self.run_command(cmd_args)
|
||||
|
||||
def fetch_new(self, dest, url, rev_options):
|
||||
# type: (str, str, RevOptions) -> None
|
||||
# type: (str, HiddenText, RevOptions) -> None
|
||||
rev_display = rev_options.to_display()
|
||||
logger.info(
|
||||
'Checking out %s%s to %s',
|
||||
@@ -293,21 +310,26 @@ class Subversion(VersionControl):
|
||||
rev_display,
|
||||
display_path(dest),
|
||||
)
|
||||
cmd_args = (['checkout', '-q'] +
|
||||
self.get_remote_call_options() +
|
||||
rev_options.to_args() + [url, dest])
|
||||
cmd_args = make_command(
|
||||
'checkout', '-q', self.get_remote_call_options(),
|
||||
rev_options.to_args(), url, dest,
|
||||
)
|
||||
self.run_command(cmd_args)
|
||||
|
||||
def switch(self, dest, url, rev_options):
|
||||
# type: (str, str, RevOptions) -> None
|
||||
cmd_args = (['switch'] + self.get_remote_call_options() +
|
||||
rev_options.to_args() + [url, dest])
|
||||
# type: (str, HiddenText, RevOptions) -> None
|
||||
cmd_args = make_command(
|
||||
'switch', self.get_remote_call_options(), rev_options.to_args(),
|
||||
url, dest,
|
||||
)
|
||||
self.run_command(cmd_args)
|
||||
|
||||
def update(self, dest, url, rev_options):
|
||||
# type: (str, str, RevOptions) -> None
|
||||
cmd_args = (['update'] + self.get_remote_call_options() +
|
||||
rev_options.to_args() + [dest])
|
||||
# type: (str, HiddenText, RevOptions) -> None
|
||||
cmd_args = make_command(
|
||||
'update', self.get_remote_call_options(), rev_options.to_args(),
|
||||
dest,
|
||||
)
|
||||
self.run_command(cmd_args)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user