# Path: marvin_python_toolbox/_compatibility.py



import os
import pip
import sys
import subprocess
import click
import re
import os.path
import errno
import shutil
import multiprocessing
from distutils.version import LooseVersion
from .._compatibility import urlparse
def copy(src, dest, ignore=('.git', '.pyc', '__pycache__')):
    try:
        shutil.copytree(src, dest, ignore=shutil.ignore_patterns(*ignore))
    except OSError as e:
        if e.errno == errno.ENOTDIR:
            shutil.copy(src, dest)
        else:
            print('Directory not copied. Error: %s' % e)


def get_version(path):
    """Return the project version from VERSION file."""

    with open(os.path.join(path, 'VERSION'), 'rb') as f:
        version = f.read().decode('ascii').strip()
    return version.strip()


def get_repos_from_requirements(path):
    if path is None:
        path = os.path.curdir
    with open(os.path.join(path, 'requirements.txt'), 'r') as fp:
        repos = [line.strip() for line in fp if 'git@' in line and not line.strip().startswith('#')]
    return repos


def get_tag_from_repo_url(repos):
    tags = {}
    for repo in repos:
        if '@' in repo:

# Path: marvin_python_toolbox/_compatibility.py



# Path: marvin_python_toolbox/management/pkg.py
import os
import pip
import sys
import subprocess
import click
import re
import os.path
import errno
import shutil
import multiprocessing
from distutils.version import LooseVersion
from .._compatibility import urlparse

def copy(src, dest, ignore=('.git', '.pyc', '__pycache__')):
    try:
        shutil.copytree(src, dest, ignore=shutil.ignore_patterns(*ignore))
    except OSError as e:
        if e.errno == errno.ENOTDIR:
            shutil.copy(src, dest)
        else:
            print('Directory not copied. Error: %s' % e)


def get_version(path):
    """Return the project version from VERSION file."""

    with open(os.path.join(path, 'VERSION'), 'rb') as f:
        version = f.read().decode('ascii').strip()
    return version.strip()


def get_repos_from_requirements(path):
    if path is None:
        path = os.path.curdir
    with open(os.path.join(path, 'requirements.txt'), 'r') as fp:
        repos = [line.strip() for line in fp if 'git@' in line and not line.strip().startswith('#')]
    return repos


def get_tag_from_repo_url(repos):
    tags = {}
    for repo in repos:
        if '@' in repo:

            repo_parsed = urlparse(repo)