def get_src_requirement(cls, location, project_name):
     repo = cls.get_remote_url(location)
     if repo is None:
         return None
     repo = 'svn+' + repo
     rev = cls.get_revision(location)
     return make_vcs_requirement_url(repo, rev, project_name)
 def get_src_requirement(cls, location, project_name):
     repo = cls.get_remote_url(location)
     if not repo:
         return None
     if not repo.lower().startswith('bzr:'):
         repo = 'bzr+' + repo
     current_rev = cls.get_revision(location)
     return make_vcs_requirement_url(repo, current_rev, project_name)
Exemplo n.º 3
0
 def get_src_requirement(self, dist, location):
     repo = self.get_url(location)
     if not repo.lower().startswith('hg:'):
         repo = 'hg+' + repo
     current_rev_hash = self.get_revision_hash(location)
     egg_project_name = dist.egg_name().split('-', 1)[0]
     return make_vcs_requirement_url(repo, current_rev_hash,
                                     egg_project_name)
Exemplo n.º 4
0
 def get_src_requirement(self, dist, location):
     repo = self.get_url(location)
     if not repo:
         return None
     if not repo.lower().startswith('bzr:'):
         repo = 'bzr+' + repo
     current_rev = self.get_revision(location)
     egg_project_name = dist.egg_name().split('-', 1)[0]
     return make_vcs_requirement_url(repo, current_rev, egg_project_name)
Exemplo n.º 5
0
 def get_src_requirement(self, dist, location):
     repo = self.get_url(location)
     if repo is None:
         return None
     repo = 'svn+' + repo
     rev = self.get_revision(location)
     # FIXME: why not project name?
     egg_project_name = dist.egg_name().split('-', 1)[0]
     return make_vcs_requirement_url(repo, rev, egg_project_name)
Exemplo n.º 6
0
    def get_src_requirement(self, dist, location):
        repo = self.get_url(location)
        if not repo.lower().startswith('git:'):
            repo = 'git+' + repo
        current_rev = self.get_revision(location)
        egg_project_name = dist.egg_name().split('-', 1)[0]
        subdir = self._get_subdirectory(location)
        req = make_vcs_requirement_url(repo, current_rev, egg_project_name,
                                       subdir=subdir)

        return req
Exemplo n.º 7
0
    def get_src_requirement(cls, location, project_name):
        repo = cls.get_remote_url(location)
        if not repo.lower().startswith('git:'):
            repo = 'git+' + repo
        current_rev = cls.get_revision(location)
        subdir = cls._get_subdirectory(location)
        req = make_vcs_requirement_url(repo,
                                       current_rev,
                                       project_name,
                                       subdir=subdir)

        return req
Exemplo n.º 8
0
 def get_src_requirement(cls, location, project_name):
     repo = cls.get_remote_url(location)
     if not repo.lower().startswith('hg:'):
         repo = 'hg+' + repo
     current_rev_hash = cls.get_revision_hash(location)
     return make_vcs_requirement_url(repo, current_rev_hash, project_name)
Exemplo n.º 9
0
    def _init_args_from_dist(cls, dist, dependency_links):
        """
        Compute and return arguments (req, editable, comments) to pass to
        FrozenRequirement.__init__().

        This method is for use in FrozenRequirement.from_dist().
        """
        location = os.path.normcase(os.path.abspath(dist.location))
        comments = []
        from pipenv.patched.notpip._internal.vcs import vcs, get_src_requirement
        if dist_is_editable(dist) and vcs.get_backend_name(location):
            editable = True
            try:
                req = get_src_requirement(dist, location)
            except InstallationError as exc:
                logger.warning(
                    "Error when trying to get requirement for VCS system %s, "
                    "falling back to uneditable format", exc)
                req = None
            if req is None:
                logger.warning('Could not determine repository location of %s',
                               location)
                comments.append(
                    '## !! Could not determine repository location')
                req = dist.as_requirement()
                editable = False
        else:
            editable = False
            req = dist.as_requirement()
            specs = req.specs
            assert len(specs) == 1 and specs[0][0] in ["==", "==="], \
                'Expected 1 spec with == or ===; specs = %r; dist = %r' % \
                (specs, dist)
            version = specs[0][1]
            ver_match = cls._rev_re.search(version)
            date_match = cls._date_re.search(version)
            if ver_match or date_match:
                svn_backend = vcs.get_backend('svn')
                if svn_backend:
                    svn_location = svn_backend().get_location(
                        dist,
                        dependency_links,
                    )
                if not svn_location:
                    logger.warning(
                        'Warning: cannot find svn location for %s',
                        req,
                    )
                    comments.append(
                        '## FIXME: could not find svn URL in dependency_links '
                        'for this package:')
                else:
                    deprecated(
                        "SVN editable detection based on dependency links "
                        "will be dropped in the future.",
                        replacement=None,
                        gone_in="18.2",
                        issue=4187,
                    )
                    comments.append(
                        '# Installing as editable to satisfy requirement %s:' %
                        req)
                    if ver_match:
                        rev = ver_match.group(1)
                    else:
                        rev = '{%s}' % date_match.group(1)
                    editable = True
                    egg_name = cls.egg_name(dist)
                    req = make_vcs_requirement_url(svn_location, rev, egg_name)

        return (req, editable, comments)