How to use the pyp2rpm.virtualenv.DirsContent function in pyp2rpm

To help you get started, we’ve selected a few pyp2rpm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fedora-python / pyp2rpm / tests / test_virtualenv.py View on Github external
def test_get_dirs_differance(self, bin_diff, package_diff, expected):
        flexmock(DirsContent).should_receive('__sub__').and_return(
            DirsContent(bin_diff, package_diff))
        self.venv.get_dirs_differance()
        assert ((self.venv.data['packages'],
                 self.venv.data['py_modules'],
                 self.venv.data['scripts'],
                 self.venv.data['has_pth']) == expected)
github fedora-python / pyp2rpm / tests / test_virtualenv.py View on Github external
def test_get_dirs_differance(self, bin_diff, package_diff, expected):
        flexmock(DirsContent).should_receive('__sub__').and_return(
            DirsContent(bin_diff, package_diff))
        self.venv.get_dirs_differance()
        assert ((self.venv.data['packages'],
                 self.venv.data['py_modules'],
                 self.venv.data['scripts'],
                 self.venv.data['has_pth']) == expected)
github fedora-python / pyp2rpm / tests / test_virtualenv.py View on Github external
def test_sub_sitepackages(self, before, after, expected):
        result = DirsContent(lib_sitepackages=after, bindir=set([])) -\
            DirsContent(lib_sitepackages=before, bindir=set([]))
        assert result.lib_sitepackages == expected
github fedora-python / pyp2rpm / tests / test_virtualenv.py View on Github external
def test_sub_bin(self, before, after, expected):
        result = DirsContent(bindir=after, lib_sitepackages=set([])) -\
            DirsContent(bindir=before, lib_sitepackages=set([]))
        assert result.bindir == expected
github fedora-python / pyp2rpm / pyp2rpm / virtualenv.py View on Github external
def __sub__(self, other):
        '''
        Makes differance of DirsContents objects attributes
        '''
        if any([self.bindir is None, self.lib_sitepackages is None,
                other.bindir is None, other.lib_sitepackages is None]):
            raise ValueError("Some of the attributes is uninicialized")
        result = DirsContent(
            self.bindir - other.bindir,
            self.lib_sitepackages - other.lib_sitepackages)
        return result
github fedora-python / pyp2rpm / pyp2rpm / virtualenv.py View on Github external
base_python_version):
        self.name = name
        self.version = version
        self.temp_dir = temp_dir
        self.name_convertor = name_convertor
        if not base_python_version:
            base_python_version = DEFAULT_PYTHON_VERSION
        python_version = 'python' + base_python_version
        self.env = VirtualEnvironment(temp_dir + '/venv',
                                      python=python_version)
        try:
            self.env.open_or_create()
        except (ve.VirtualenvCreationException,
                ve.VirtualenvReadonlyException):
            raise VirtualenvFailException('Failed to create virtualenv')
        self.dirs_before_install = DirsContent()
        self.dirs_after_install = DirsContent()
        self.dirs_before_install.fill(temp_dir + '/venv/')
        self.data = {}
github fedora-python / pyp2rpm / pyp2rpm / virtualenv.py View on Github external
self.name = name
        self.version = version
        self.temp_dir = temp_dir
        self.name_convertor = name_convertor
        if not base_python_version:
            base_python_version = DEFAULT_PYTHON_VERSION
        python_version = 'python' + base_python_version
        self.env = VirtualEnvironment(temp_dir + '/venv',
                                      python=python_version)
        try:
            self.env.open_or_create()
        except (ve.VirtualenvCreationException,
                ve.VirtualenvReadonlyException):
            raise VirtualenvFailException('Failed to create virtualenv')
        self.dirs_before_install = DirsContent()
        self.dirs_after_install = DirsContent()
        self.dirs_before_install.fill(temp_dir + '/venv/')
        self.data = {}