def test_get_inhouse_dependencies(): with Workspace() as workspace: with open(os.path.join(workspace.workspace, 'setup.cfg'), 'wb') as fp: fp.write("""[metadata] name = acme.foo version = 2.3.5 install_requires = scipy numpy acme.a acme.b>=1.0.0 acme.c<3.0 """) assert [i for i in manage.get_inhouse_dependencies(workspace.workspace)] == \ ['acme.a', 'acme.b', 'acme.c']
def test_get_inhouse_dependencies(workspace): with mock.patch.object(manage, 'CONFIG', TEST_CONFIG): with open(os.path.join(workspace.workspace, 'setup.cfg'), 'wb') as fp: fp.write("""[metadata] name = acme.foo version = 2.3.5 install_requires = scipy numpy acme.a acme.b>=1.0.0 acme.c<3.0 """) result = [i for i in manage.get_inhouse_dependencies(workspace.workspace)] assert result == ['acme.a', 'acme.b', 'acme.c']
def process_pkg(pypi, pkg, dest_dir, options, recurse, indent=0): """ Checks out and sets up a package by name. """ global INSPECTED_PACKAGES INSPECTED_PACKAGES.append(pkg) indent_txt = ' ' * indent if not os.path.isdir(dest_dir): os.makedirs(dest_dir) checkout_pkg(dest_dir, pypi, pkg, options, options.branch, indent_txt) if recurse: # Do our children too for dep in get_inhouse_dependencies(pkg, indent_txt): log.info("%s Descending to dependency: %s" % (indent_txt, dep)) dest_dir = os.path.join(os.path.dirname(dest_dir), dep) process_pkg(pypi, dep, dest_dir, options, options.recursive, indent + 4) setup_pkg(sys.exec_prefix, dest_dir, options, indent_txt)
def test_get_inhouse_dependencies(workspace): with mock.patch.object(manage, 'CONFIG', TEST_CONFIG): with open(os.path.join(workspace.workspace, 'setup.cfg'), 'wb') as fp: fp.write("""[metadata] name = acme.foo version = 2.3.5 install_requires = scipy numpy acme.a acme.b>=1.0.0 acme.c<3.0 """) result = [ i for i in manage.get_inhouse_dependencies(workspace.workspace) ] assert result == ['acme.a', 'acme.b', 'acme.c']