Hello community, here is the log from the commit of package python-dephell for openSUSE:Factory checked in at 2019-12-10 22:40:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-dephell (Old) and /work/SRC/openSUSE:Factory/.python-dephell.new.4691 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-dephell" Tue Dec 10 22:40:53 2019 rev:4 rq:755643 version:0.7.9 Changes: -------- --- /work/SRC/openSUSE:Factory/python-dephell/python-dephell.changes 2019-11-27 13:51:57.608438916 +0100 +++ /work/SRC/openSUSE:Factory/.python-dephell.new.4691/python-dephell.changes 2019-12-10 22:41:02.861839734 +0100 @@ -1,0 +2,39 @@ +Tue Dec 10 17:30:41 CET 2019 - Matej Cepl <[email protected]> + +- revert previous change, apparently, that is the right one + +------------------------------------------------------------------- +Tue Dec 10 17:05:23 CET 2019 - Matej Cepl <[email protected]> + +- Fix all other dependencies to have underscored names. + +------------------------------------------------------------------- +Mon Dec 9 11:17:54 UTC 2019 - John Vandenberg <[email protected]> + +- Fix runtime dependency on dephell_setuptools + +------------------------------------------------------------------- +Mon Dec 9 09:29:46 UTC 2019 - John Vandenberg <[email protected]> + +- Remove fix_dephell_setuptools_deps.patch +- Bump dependency versions otherwise dephell fails with + an exception in pkg_resources. + +------------------------------------------------------------------- +Sun Dec 1 18:56:39 CET 2019 - Matej Cepl <[email protected]> + +- Update to 0.7.9: + - A lot of small commands: + - dephell self uncache (#312). + - dephell self upgrade (#311). + - dephell generate contributing (#255). + - dephell inspect project (#296). + - dephell project validate (#310). + - Smart setup.py parsing. Meet dephell_setuptools (#308). + - Stable setup.py generation (#292). + - Cleaner sdist (#297). + - a little bit more +- Add fix_dephell_setuptools_deps.patch to resolve incorrect + required dependencies in setup.py gh#dephell/dephell#316 + +------------------------------------------------------------------- Old: ---- dephell-0.7.8.tar.gz New: ---- dephell-0.7.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-dephell.spec ++++++ --- /var/tmp/diff_new_pack.96nVCb/_old 2019-12-10 22:41:03.925839340 +0100 +++ /var/tmp/diff_new_pack.96nVCb/_new 2019-12-10 22:41:03.933839336 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-dephell # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-dephell -Version: 0.7.8 +Version: 0.7.9 Release: 0 Summary: Dependency resolution for Python License: MIT @@ -40,8 +40,9 @@ Requires: python-dephell-discover >= 0.2.6 Requires: python-dephell-licenses >= 0.1.6 Requires: python-dephell-links >= 0.1.4 -Requires: python-dephell-markers >= 1.0.0 +Requires: python-dephell-markers >= 1.0.2 Requires: python-dephell-pythons >= 0.1.11 +Requires: python-dephell-setuptools >= 0.2.1 Requires: python-dephell-shells >= 0.1.3 Requires: python-dephell-specifier >= 0.1.7 Requires: python-dephell-venvs >= 0.1.16 @@ -50,7 +51,6 @@ Requires: python-dockerpty Requires: python-fissix Requires: python-flatdict -Requires: python-html5lib Requires: python-m2r Requires: python-packaging Requires: python-pip >= 18.0 @@ -80,8 +80,9 @@ BuildRequires: %{python_module dephell-discover >= 0.2.6} BuildRequires: %{python_module dephell-licenses >= 0.1.6} BuildRequires: %{python_module dephell-links >= 0.1.4} -BuildRequires: %{python_module dephell-markers >= 1.0.0} +BuildRequires: %{python_module dephell-markers >= 1.0.2} BuildRequires: %{python_module dephell-pythons >= 0.1.11} +BuildRequires: %{python_module dephell-setuptools >= 0.2.1} BuildRequires: %{python_module dephell-shells >= 0.1.3} BuildRequires: %{python_module dephell-specifier >= 0.1.7} BuildRequires: %{python_module dephell-venvs >= 0.1.16} @@ -114,6 +115,7 @@ %prep %setup -q -n dephell-%{version} + find tests -type d -name __pycache__ | xargs rm -rf # Network and missing dependencies rm \ ++++++ dephell-0.7.8.tar.gz -> dephell-0.7.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/PKG-INFO new/dephell-0.7.9/PKG-INFO --- old/dephell-0.7.8/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: dephell -Version: 0.7.8 +Version: 0.7.9 Summary: Dependency resolution for Python Home-Page: https://dephell.org/ Project-URL: Repository, https://github.com/dephell/dephell @@ -16,6 +16,10 @@ Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Security Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: Software Development :: Libraries :: Python Modules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/__init__.py new/dephell-0.7.9/dephell/__init__.py --- old/dephell-0.7.8/dephell/__init__.py 2019-10-22 17:37:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/__init__.py 2019-11-19 16:23:08.000000000 +0100 @@ -13,6 +13,6 @@ """ -__version__ = '0.7.8' +__version__ = '0.7.9' __author__ = 'Gram (@orsinium)' __license__ = 'MIT' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/actions/__init__.py new/dephell-0.7.9/dephell/actions/__init__.py --- old/dephell-0.7.8/dephell/actions/__init__.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/actions/__init__.py 2019-11-19 15:57:03.000000000 +0100 @@ -3,6 +3,7 @@ # app from ._autocomplete import make_bash_autocomplete, make_zsh_autocomplete +from ._contributing import make_contributing from ._converting import attach_deps from ._docker import get_docker_container from ._dotenv import read_dotenv @@ -36,6 +37,7 @@ 'git_commit', 'git_tag', 'make_bash_autocomplete', + 'make_contributing', 'make_editorconfig', 'make_json', 'make_travis', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/actions/_contributing.py new/dephell-0.7.9/dephell/actions/_contributing.py --- old/dephell-0.7.8/dephell/actions/_contributing.py 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell/actions/_contributing.py 2019-11-19 15:57:03.000000000 +0100 @@ -0,0 +1,41 @@ +from pathlib import Path +from typing import Any, Dict, Optional + +# external +from jinja2 import Environment, PackageLoader + + +env = Environment(loader=PackageLoader('dephell', 'templates')) +KNOWN_SECTIONS = ( + ('test', 'tests'), + ('tests', 'tests'), + ('testing', 'tests'), + ('unittest', 'tests'), + ('pytest', 'tests'), + + ('linter', 'lint'), + ('linters', 'lint'), + ('flake', 'lint'), + ('pylint', 'lint'), + ('flake8', 'lint'), + + ('types', 'typing'), + ('typing', 'typing'), + ('mypy', 'typing'), + + ('isort', 'isort'), + ('sort', 'isort'), +) + + +def make_contributing(config: Dict[str, Dict[str, Any]], project_path: Path) -> Optional[str]: + template = env.get_template('contributing.md.j2') + envs = dict() + for name, category in KNOWN_SECTIONS: + if name not in config: + continue + envs[category] = name + content = template.render(project_name=project_path.name, envs=envs) + while '\n\n\n' in content: + content = content.replace('\n\n\n', '\n\n') + return content diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/actions/_entrypoints.py new/dephell-0.7.9/dephell/actions/_entrypoints.py --- old/dephell-0.7.8/dephell/actions/_entrypoints.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/actions/_entrypoints.py 2019-11-19 15:56:59.000000000 +0100 @@ -23,8 +23,20 @@ if not paths: logger.critical('cannot locate dist-info for installed package') return None + path = paths[0] / 'entry_points.txt' if not path.exists(): + # entry_points.txt can be missed for egg-info. + # In that case let's try to find a binary with the same name as package. + if venv.bin_path: + paths = ( + venv.bin_path / name, + venv.bin_path / name.replace('-', '_'), + venv.bin_path / name.replace('_', '-'), + ) + for path in paths: + if path.exists: + return [EntryPoint(path=path, name=name)] logger.error('cannot find any entrypoints for package') return None return EggInfoConverter().parse_entrypoints(content=path.read_text()).entrypoints diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/actions/_travis.py new/dephell-0.7.9/dephell/actions/_travis.py --- old/dephell-0.7.8/dephell/actions/_travis.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/actions/_travis.py 2019-11-19 15:57:03.000000000 +0100 @@ -31,7 +31,7 @@ PYTEST = """ - python: "3.5" env: ENV={env} - - python: "3.6" + - python: "3.6.7" env: ENV={env} - python: "3.7" env: ENV={env} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/commands/deps_convert.py new/dephell-0.7.9/dephell/commands/deps_convert.py --- old/dephell-0.7.8/dephell/commands/deps_convert.py 2019-10-22 16:54:02.000000000 +0200 +++ new/dephell-0.7.9/dephell/commands/deps_convert.py 2019-11-19 15:56:59.000000000 +0100 @@ -65,6 +65,18 @@ return False self.logger.debug('resolved') + # filter out deps by `--envs` + if self.config.get('envs'): + if len(resolver.graph._layers) == 1: + for root in resolver.graph._roots: + for dep in root.dependencies: + dep.applied = True + resolver.graph.add(dep) + for root in resolver.graph._roots: + root.applied = True + resolver.apply_envs(set(self.config['envs'])) + resolver.graph._layers = resolver.graph._layers[:1] + # dump self.logger.debug('dump dependencies...', extra=dict( format=self.config['to']['format'], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/commands/discover.py new/dephell-0.7.9/dephell/commands/discover.py --- old/dephell-0.7.8/dephell/commands/discover.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/commands/discover.py 2019-11-19 15:57:03.000000000 +0100 @@ -27,6 +27,7 @@ 'generate authors', 'generate config', + 'generate contributing', 'generate editorconfig', 'generate license', 'generate travis', @@ -36,6 +37,7 @@ 'inspect gadget', 'inspect self', 'inspect venv', + 'inspect project', 'jail install', 'jail list', @@ -54,6 +56,10 @@ 'project build', 'project bump', 'project test', + 'project validate', + + 'self uncache', + 'self upgrade', 'vendor download', 'vendor import', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/commands/generate_contributing.py new/dephell-0.7.9/dephell/commands/generate_contributing.py --- old/dephell-0.7.8/dephell/commands/generate_contributing.py 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell/commands/generate_contributing.py 2019-11-19 15:57:03.000000000 +0100 @@ -0,0 +1,43 @@ +# built-in +from argparse import ArgumentParser +from pathlib import Path + +# external +import tomlkit + +# app +from ..actions import make_contributing +from ..config import builders +from .base import BaseCommand + + +class GenerateContributingCommand(BaseCommand): + """Create CONTRIBUTING.md for DepHell-based project. + """ + file_name = 'CONTRIBUTING.md' + + @classmethod + def get_parser(cls) -> ArgumentParser: + parser = cls._get_default_parser() + builders.build_config(parser) + builders.build_output(parser) + builders.build_other(parser) + return parser + + def __call__(self) -> bool: + if self.args.config: + path = Path(self.args.config) + else: + path = Path(self.config['project']) / 'pyproject.toml' + if not path.exists(): + self.logger.error('cannot generate file without config') + return False + + with path.open('r', encoding='utf8') as stream: + config = tomlkit.parse(stream.read()) + config = dict(config['tool']['dephell']) + project_path = Path(self.config['project']) + text = make_contributing(config=config, project_path=project_path) + (project_path / self.file_name).write_text(text) + self.logger.info('generated', extra=dict(file=self.file_name)) + return True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/commands/inspect_project.py new/dephell-0.7.9/dephell/commands/inspect_project.py --- old/dephell-0.7.8/dephell/commands/inspect_project.py 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell/commands/inspect_project.py 2019-11-19 15:56:59.000000000 +0100 @@ -0,0 +1,50 @@ +# built-in +from argparse import ArgumentParser +from pathlib import Path + +# app +from ..actions import make_json +from ..config import builders +from ..converters import CONVERTERS +from .base import BaseCommand + + +class InspectProjectCommand(BaseCommand): + """Inspect the current project. + """ + @classmethod + def get_parser(cls) -> ArgumentParser: + parser = cls._get_default_parser() + builders.build_config(parser) + builders.build_from(parser) + builders.build_output(parser) + builders.build_api(parser) + builders.build_other(parser) + return parser + + def __call__(self) -> bool: + if 'from' not in self.config: + self.logger.error('`--from` is required for this command') + return False + + loader = CONVERTERS[self.config['from']['format']] + loader = loader.copy(project_path=Path(self.config['project'])) + root = loader.load(path=self.config['from']['path']) + + result = dict( + name=root.raw_name, + version=root.version, + description=root.description, + ) + if root.python: + result['python'] = str(root.python) + if root.links: + result['links'] = root.links + + print(make_json( + data=result, + key=self.config.get('filter'), + colors=not self.config['nocolors'], + table=self.config['table'], + )) + return True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/commands/project_validate.py new/dephell-0.7.9/dephell/commands/project_validate.py --- old/dephell-0.7.8/dephell/commands/project_validate.py 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell/commands/project_validate.py 2019-11-19 15:56:59.000000000 +0100 @@ -0,0 +1,100 @@ +# built-in +from argparse import ArgumentParser +from pathlib import Path + +# app +from ..config import builders +from ..converters import CONVERTERS +from .base import BaseCommand + + +class ProjectValidateCommand(BaseCommand): + """Check package metadata. + """ + @classmethod + def get_parser(cls) -> ArgumentParser: + parser = cls._get_default_parser() + builders.build_config(parser) + builders.build_from(parser) + builders.build_output(parser) + builders.build_other(parser) + return parser + + def __call__(self) -> bool: + # get current deps + if 'from' not in self.config: + self.logger.error('`--from` is required for this command') + return False + loader = CONVERTERS[self.config['from']['format']] + loader = loader.copy(project_path=Path(self.config['project'])) + root = loader.load(path=self.config['from']['path']) + + # errors + ok = True + if root.raw_name == 'root': + self.logger.error('field is unspecified', extra=dict(field='name')) + ok = False + if root.raw_name != root.name: + self.logger.error('bad name', extra=dict( + current=root.raw_name, + expected=root.name, + )) + ok = False + if not isinstance(root.version, str): + self.logger.error('version should be str') + ok = False + if root.version == '0.0.0': + self.logger.error('field is unspecified', extra=dict(field='version')) + ok = False + if root.description and len(root.description) <= 10: + self.logger.error('short description is too short', extra=dict( + length=len(root.description), + )) + ok = False + if root.description and len(root.description) > 140: + self.logger.error('short description is too long', extra=dict( + length=len(root.description), + )) + ok = False + for field in ('license', 'keywords', 'classifiers', 'description'): + if getattr(root, field): + continue + self.logger.error('field is unspecified', extra=dict(field=field)) + ok = False + if not root.package.packages: + self.logger.error('cannot find Python files for package') + ok = False + if not root.authors: + self.logger.error('no authors specified') + ok = False + if not root.links: + self.logger.error('no links specified') + ok = False + + # classifier checks + for classifier in root.classifiers: + if classifier.startswith('License :: '): + break + else: + self.logger.error('no license specified in classifier') + ok = False + for classifier in root.classifiers: + if classifier.startswith('Development Status :: '): + break + else: + self.logger.error('no development status specified in classifier') + ok = False + for classifier in root.classifiers: + if classifier.startswith('Programming Language :: Python ::'): + break + else: + self.logger.error('no python version specified in classifier') + ok = False + + # warnings + if not root.dependencies: + self.logger.warning('no dependencies found') + + if ok: + self.logger.info('no errors found') + return ok diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/commands/self_uncache.py new/dephell-0.7.9/dephell/commands/self_uncache.py --- old/dephell-0.7.8/dephell/commands/self_uncache.py 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell/commands/self_uncache.py 2019-11-19 15:57:03.000000000 +0100 @@ -0,0 +1,31 @@ +# built-in +from argparse import ArgumentParser +from pathlib import Path +from shutil import rmtree + +# app +from ..actions import format_size, get_path_size +from ..config import builders +from .base import BaseCommand + + +class SelfUncacheCommand(BaseCommand): + """Remove dephell cache. + """ + @classmethod + def get_parser(cls) -> ArgumentParser: + parser = cls._get_default_parser() + builders.build_config(parser) + builders.build_output(parser) + builders.build_other(parser) + return parser + + def __call__(self) -> bool: + path = Path(self.config['cache']['path']) + if path.exists(): + size = format_size(get_path_size(path)) + rmtree(str(path)) + self.logger.info('cache removed', extra=dict(size=size)) + else: + self.logger.warning('no cache found') + return True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/commands/self_upgrade.py new/dephell-0.7.9/dephell/commands/self_upgrade.py --- old/dephell-0.7.8/dephell/commands/self_upgrade.py 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell/commands/self_upgrade.py 2019-11-19 15:57:03.000000000 +0100 @@ -0,0 +1,46 @@ +# built-in +import subprocess +import sys +from argparse import ArgumentParser +from pathlib import Path + +# app +from ..config import builders +from ..context_tools import chdir +from ..package_manager import PackageManager +from .base import BaseCommand + + +class SelfUpgradeCommand(BaseCommand): + """Upgrade DepHell to the latest version. + """ + + @classmethod + def get_parser(cls) -> ArgumentParser: + parser = cls._get_default_parser() + builders.build_config(parser) + builders.build_output(parser) + builders.build_other(parser) + return parser + + def __call__(self) -> bool: + path = Path(__file__).parent.parent.parent + if (path / 'README.md').exists() and (path / '.git').exists(): + return self._upgrade_repo(path=path) + return self._upgrade_package() + + def _upgrade_repo(self, path: Path) -> bool: + with chdir(path): + cmd = ['git', 'pull', 'origin', 'master'] + result = subprocess.run(cmd) + return (result.returncode == 0) + + def _upgrade_package(self) -> bool: + manager = PackageManager(executable=sys.executable) + args = ['-U'] + if manager.is_global: + args.append('--user') + else: + args.append('--upgrade-strategy=eager') + code = manager.run('install', *args, 'dephell') + return (code == 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/controllers/_dependency.py new/dephell-0.7.9/dephell/controllers/_dependency.py --- old/dephell-0.7.8/dephell/controllers/_dependency.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/controllers/_dependency.py 2019-11-19 15:57:03.000000000 +0100 @@ -21,6 +21,7 @@ logger = getLogger('dephell.controllers') # regex for names generated by pipenv rex_hash = re.compile(r'[a-f0-9]{7}') +rex_vers = re.compile(r'[a-z_-]+\-[0-9.]+') class DependencyMaker: @@ -59,8 +60,13 @@ if source.repo and source.repo.propagate: default_repo = source.repo + name = req.name + # drop version from the end + if rex_vers.fullmatch(name): + name = name.rsplit('-', maxsplit=1)[0] + base_dep = cls.dep_class( - raw_name=req.name, + raw_name=name, constraint=constraint, repo=get_repo(link, default=default_repo), link=link, @@ -88,7 +94,8 @@ link = url if link and not isinstance(link, UnknownLink): if link.name and rex_hash.fullmatch(raw_name): - raw_name = link.name + if not link.name.startswith(raw_name): + raw_name = link.name # make constraint if isinstance(constraint, str): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/controllers/_resolver.py new/dephell-0.7.9/dephell/controllers/_resolver.py --- old/dephell-0.7.8/dephell/controllers/_resolver.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/controllers/_resolver.py 2019-11-19 15:56:59.000000000 +0100 @@ -132,6 +132,9 @@ dep.group = group def apply_envs(self, envs: set) -> None: + if not any(root.dependencies for root in self.graph.get_layer(0)): + logger.debug('no dependencies, nothing to filter') + return layer = self.graph.get_layer(1) # Unapply deps that we don't need @@ -152,7 +155,7 @@ # Some child deps can be unapplied from other child deps, but we need them. # For example, if we need A, but don't need B, and A and B depends on C, - # then C will be unapplied from B. Let's retun B in the graph by apllying A. + # then C will be unapplied from B. Let's return B in the graph by re-applying A. for dep in self.graph: if not dep.applied: continue diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/converters/flit.py new/dephell-0.7.9/dephell/converters/flit.py --- old/dephell-0.7.8/dephell/converters/flit.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/converters/flit.py 2019-11-19 15:57:03.000000000 +0100 @@ -127,12 +127,16 @@ section = doc['tool']['flit']['metadata'] # project and module names - module = project.package.packages[0].module - section['module'] = module - if project.raw_name != module: - section['dist-name'] = project.raw_name - elif 'dist-name' in section: - del section['dist-name'] + packages = project.package.packages + if packages: + module = packages[0].module + section['module'] = module + if project.raw_name != module: + section['dist-name'] = project.raw_name + elif 'dist-name' in section: + del section['dist-name'] + else: + section['module'] = project.raw_name # author and maintainer for field, author in zip(('author', 'maintainer'), project.authors): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/converters/sdist.py new/dephell-0.7.9/dephell/converters/sdist.py --- old/dephell-0.7.8/dephell/converters/sdist.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/converters/sdist.py 2019-11-19 15:56:59.000000000 +0100 @@ -122,7 +122,7 @@ subdir=subdir, module='/'.join(full_path.relative_to(project.package.path).parts), ) - tar.add(name=str(full_path), arcname=fpath, filter=self._set_uid_gid) + tar.add(name=str(full_path), arcname=fpath, filter=self._sanitize_tar) self._write_additional_files(tar=tar, project=project, subdir=subdir) @@ -132,20 +132,20 @@ tar.add( name=str(project.readme.path), arcname=subdir + project.readme.path.name, - filter=self._set_uid_gid, + filter=self._sanitize_tar, ) if project.readme.markup != 'rst': rst = project.readme.to_rst() tar.add( name=str(rst.path), arcname=subdir + rst.path.name, - filter=self._set_uid_gid, + filter=self._sanitize_tar, ) elif (project.package.path / 'README.md').exists(): tar.add( name=str(project.package.path / 'README.md'), arcname=subdir + 'README.md', - filter=self._set_uid_gid, + filter=self._sanitize_tar, ) # write setup files @@ -155,7 +155,7 @@ tar.add( name=str(path / fname), arcname=subdir + fname, - filter=self._set_uid_gid, + filter=self._sanitize_tar, ) # write license files @@ -167,7 +167,7 @@ tar.add( name=str(file_path), arcname=subdir + file_path.name, - filter=self._set_uid_gid, + filter=self._sanitize_tar, ) # write tests @@ -182,19 +182,21 @@ tar.add( name=str(tests_path), arcname=subdir + tests_path.name, - filter=self._set_uid_gid, + filter=self._sanitize_tar, ) def _write_content(self, tar, path: str, content) -> None: content = content.encode('utf-8') tar_info = TarInfo(path) tar_info.size = len(content) - tar_info = self._set_uid_gid(tar_info) + tar_info = self._sanitize_tar(tar_info) tar.addfile(tar_info, BytesIO(content)) # poetry/masonry/builders/sdist.py:clean_tarinfo @staticmethod - def _set_uid_gid(tarinfo: TarInfo) -> TarInfo: + def _sanitize_tar(tarinfo: TarInfo) -> TarInfo or None: + if '__pycache__' in tarinfo.name: + return None tarinfo.uid = tarinfo.gid = 0 tarinfo.uname = tarinfo.gname = '' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/converters/setuppy.py new/dephell-0.7.9/dephell/converters/setuppy.py --- old/dephell-0.7.8/dephell/converters/setuppy.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/converters/setuppy.py 2019-11-19 15:56:59.000000000 +0100 @@ -1,7 +1,6 @@ # built-in from collections import defaultdict -from distutils.core import run_setup -from io import BytesIO, StringIO +from json import dumps as json_dumps from logging import getLogger from pathlib import Path from typing import Optional @@ -9,12 +8,11 @@ # external from dephell_discover import Root as PackageRoot from dephell_links import DirLink, FileLink, URLLink, VCSLink, parse_link +from dephell_setuptools import read_setup from dephell_specifier import RangeSpecifier from packaging.requirements import Requirement -from setuptools.dist import Distribution # app -from ..context_tools import chdir from ..controllers import DependencyMaker, Readme from ..models import Author, EntryPoint, RootDependency from .base import BaseConverter @@ -55,12 +53,6 @@ """ -def _patched_open(fname, mode='r', *args, **kwargs): - if 'b' in mode: - return BytesIO(fname.encode('utf8')) - return StringIO(fname) - - class SetupPyConverter(BaseConverter): lock = False @@ -81,60 +73,56 @@ path = self._make_source_path_absolute(path) self._resolve_path = path.parent - info = self._execute(path=path) - if info is None: - with chdir(path.parent): - info = run_setup(path.name) - + data = read_setup(path=path, error_handler=logger.debug) root = RootDependency( - raw_name=self._get(info, 'name'), - version=self._get(info, 'version') or '0.0.0', + raw_name=data['name'], + version=data.get('version', '0.0.0'), package=PackageRoot( path=self.project_path or Path(), - name=self._get(info, 'name') or None, + name=data['name'], ), - description=self._get(info, 'description'), - license=self._get(info, 'license'), + description=data.get('description'), + license=data.get('license'), - keywords=tuple(self._get_list(info, 'keywords')), - classifiers=tuple(self._get_list(info, 'classifiers')), - platforms=tuple(self._get_list(info, 'platforms')), + keywords=tuple(data.get('keywords', ())), + classifiers=tuple(data.get('classifiers', ())), + platforms=tuple(data.get('platforms', ())), - python=RangeSpecifier(self._get(info, 'python_requires')), + python=RangeSpecifier(data.get('python_requires')), readme=Readme.from_code(path=path), ) # links for key, name in (('home', 'url'), ('download', 'download_url')): - link = self._get(info, name) + link = data.get(name) if link: root.links[key] = link # authors for name in ('author', 'maintainer'): - author = self._get(info, name) + author = data.get(name) if author: root.authors += ( - Author(name=author, mail=self._get(info, name + '_email')), + Author(name=author, mail=data.get(name + '_email')), ) # entrypoints entrypoints = [] - for group, content in (getattr(info, 'entry_points', {}) or {}).items(): + for group, content in data.get('entry_points', {}).items(): for entrypoint in content: entrypoints.append(EntryPoint.parse(text=entrypoint, group=group)) root.entrypoints = tuple(entrypoints) # dependency_links urls = dict() - for url in self._get_list(info, 'dependency_links'): + for url in data.get('dependency_links', ()): parsed = parse_link(url) name = parsed.name.split('-')[0] urls[name] = url # dependencies - for req in self._get_list(info, 'install_requires'): + for req in data.get('install_requires', ()): req = Requirement(req) root.attach_dependencies(DependencyMaker.from_requirement( source=root, @@ -143,7 +131,7 @@ )) # extras - for extra, reqs in getattr(info, 'extras_require', {}).items(): + for extra, reqs in data.get('extras_require', {}).items(): extra, marker = self._split_extra_and_marker(extra) envs = {extra} if extra == 'dev' else {'main', extra} for req in reqs: @@ -204,10 +192,12 @@ entrypoints = defaultdict(list) for entrypoint in project.entrypoints: entrypoints[entrypoint.group].append(str(entrypoint)) - content.append(('entry_points', dict(entrypoints))) + content.append(('entry_points', entrypoints)) # packages, package_data content.append(('packages', sorted(str(p) for p in project.package.packages))) + if project.package.package_dir: + content.append(('package_dir', project.package.package_dir)) data = defaultdict(list) for rule in project.package.data: data[rule.module].append(rule.relative) @@ -234,14 +224,17 @@ for env in req.main_envs: extras[env].append(formatted) if extras: - content.append(('extras_require', dict(extras))) + content.append(('extras_require', extras)) if project.readme is not None: readme = project.readme.to_rst().as_code() else: readme = "readme = ''" - content = ',\n '.join('{}={!r}'.format(name, value) for name, value in content) + content = ',\n '.join( + '{}={!s}'.format(name, json_dumps(value, sort_keys=True)) + if isinstance(value, dict) else '{}={!r}'.format(name, value) + for name, value in content) content = TEMPLATE.format(kwargs=content, readme=readme) # beautify @@ -255,58 +248,6 @@ # private methods @staticmethod - def _execute(path: Path): - source = path.read_text('utf-8') - new_source = source.replace('setup(', '_dist = dict(') - if new_source == source: - logger.error('cannot modify source') - return None - - globe = { - '__file__': str(path), - '__name__': '__main__', - 'open': _patched_open, - } - with chdir(path.parent): - try: - exec(compile(new_source, path.name, 'exec'), globe) - except Exception as e: - logger.error('{}: {}'.format(type(e).__name__, str(e))) - - dist = globe.get('_dist') - if dist is None: - logger.error('distribution was not called') - return None - return Distribution(dist) - - @staticmethod - def _get(msg, name: str) -> str: - value = getattr(msg.metadata, name, None) - if not value: - value = getattr(msg, name, None) - if not value: - return '' - if value == 'UNKNOWN': - return '' - return value.strip() - - @staticmethod - def _get_list(msg, name: str) -> tuple: - if name == 'keywords': - return ' '.join(msg.get_keywords()).split() - - getter = getattr(msg, 'get_' + name, None) - if getter: - values = getter() - else: - values = getattr(msg, name, None) - if type(values) is str: - values = values.split() - if not values: - return () - return tuple(value for value in values if value != 'UNKNOWN' and value.strip()) - - @staticmethod def _format_req(req) -> str: line = req.raw_name if req.extras: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/models/requirement.py new/dephell-0.7.9/dephell/models/requirement.py --- old/dephell-0.7.8/dephell/models/requirement.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/dephell/models/requirement.py 2019-11-19 15:56:59.000000000 +0100 @@ -63,7 +63,7 @@ @cached_property def dependencies(self) -> tuple: - extra_deps = sum([dep.dependencies for dep in self.extra_deps], tuple()) + extra_deps = sum((dep.dependencies for dep in self.extra_deps), tuple()) return self.dep.dependencies + extra_deps @property diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell/templates/contributing.md.j2 new/dephell-0.7.9/dephell/templates/contributing.md.j2 --- old/dephell-0.7.8/dephell/templates/contributing.md.j2 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell/templates/contributing.md.j2 2019-11-19 15:57:03.000000000 +0100 @@ -0,0 +1,73 @@ +# Contributing to {{ project_name }} + +Thank you for deciding to contribute to {{ project_name }}! This guide is to assist you with contributing code. If you have a question that isn't answered here, please [open an issue][open issue]. + +## The basics + +So you want to contribute some code? Great! Here are the basic steps: + +1. Find an [issue][issues] that you want to work on. Good places to start are [good first issues] or [help wanted]. You could also [open an issue][open issue] if there is something specific you want to contribute. Wait for a response before you start coding though, as the thing you want might already exist somewhere! +1. Fork {{ project_name }}. +1. Clone your fork. +1. Create a branch to work against. +1. Run tests to make sure they work for your system. +{% if 'tests' in envs %} +1. Write some tests. +{% endif %} +1. Write some code. +1. Run tests to make sure it works. +{% if 'lint' in envs %} +1. Run linters. +{% endif %} +1. Document changes. +1. Push your branch (to your fork). +1. Create a pull request to {{ project_name }}/master. +1. Wait for checks to run and fix anything that was wrong. + +{% if 'tests' in envs %} +## Testing + +Any new code that you contribute will be ideally covered under an automated test. To run existing tests: + +dephell venv create --env {{ envs['tests'] }} +dephell deps install --env {{ envs['tests'] }} +dephell venv run --env {{ envs['tests'] }} + +To write new tests using [pytest], place them in the `tests` directory. This directory should roughly follow the same file structure as the source directory. +{% endif %} + +{% if 'lint' in envs %} +## Style + +Follow [PEP8]. Run linter to see how you're doing: + +```bash +dephell venv create --env {{ envs['lint'] }} +dephell deps install --env {{ envs['lint'] }} +dephell venv run --env {{ envs['lint'] }} +``` + +{% if 'isort' in envs %} +Sort imports before pushing: + +```bash +dephell venv create --env {{ envs['isort'] }} +dephell deps install --env {{ envs['isort'] }} +dephell venv run --env {{ envs['isort'] }} +``` +{% endif %} + +Main things you contribute are ideas and implementation. So, if you struggled with flake8 checks, don't worry, just ask help of maintainers in comments to your Pull Request. If your code passed CI, merging of Pull Request can't be rejected or delayed because of style. No [bikeshedding](https://en.wikipedia.org/wiki/Law_of_triviality) and meaningless discussions. +{% endif %} + +## Using an IDE + +If you want to use an IDE to edit / test {{ project_name }} code, you'll have to point that IDE to the virtual environment. You can either get this path using `dephell inspect venv` or create the venv in a directory your IDE will find (e.g. `dephell venv create --venv .venv`). + +[issues]: {{ url }}/issues?utf8=✓&q=is%3Aissue+is%3Aopen+ +[open issue]: {{ url }}/issues/new +[help wanted]: {{ url }}/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22 +[good first issues]: {{ url }}/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 + +[pytest]: https://docs.pytest.org/en/latest/ +[PEP8]: https://www.python.org/dev/peps/pep-0008/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell.egg-info/PKG-INFO new/dephell-0.7.9/dephell.egg-info/PKG-INFO --- old/dephell-0.7.8/dephell.egg-info/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell.egg-info/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: dephell -Version: 0.7.8 +Version: 0.7.9 Summary: Dependency resolution for Python Home-Page: https://dephell.org/ Project-URL: Repository, https://github.com/dephell/dephell @@ -16,6 +16,10 @@ Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Security Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: Software Development :: Libraries :: Python Modules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell.egg-info/SOURCES.txt new/dephell-0.7.9/dephell.egg-info/SOURCES.txt --- old/dephell-0.7.8/dephell.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100 @@ -99,6 +99,7 @@ dephell/actions/_entrypoints.py dephell/actions/_travis.py dephell/actions/_converting.py +dephell/actions/_contributing.py dephell/actions/_docker.py dephell/actions/_shutil.py dephell/commands/jail_install.py @@ -112,6 +113,7 @@ dephell/commands/package_show.py dephell/commands/docker_shell.py dephell/commands/package_list.py +dephell/commands/project_validate.py dephell/commands/deps_outdated.py dephell/commands/generate_authors.py dephell/commands/venv_destroy.py @@ -125,6 +127,7 @@ dephell/commands/docker_stop.py dephell/commands/project_bump.py dephell/commands/package_install.py +dephell/commands/self_upgrade.py dephell/commands/package_purge.py dephell/commands/venv_run.py dephell/commands/jail_try.py @@ -134,9 +137,11 @@ dephell/commands/deps_tree.py dephell/commands/jail_list.py dephell/commands/package_search.py +dephell/commands/inspect_project.py dephell/commands/deps_sync.py dephell/commands/deps_add.py dephell/commands/__init__.py +dephell/commands/self_uncache.py dephell/commands/generate_config.py dephell/commands/generate_editorconfig.py dephell/commands/inspect_self.py @@ -149,6 +154,7 @@ dephell/commands/package_downloads.py dephell/commands/docker_create.py dephell/commands/deps_convert.py +dephell/commands/generate_contributing.py dephell/commands/project_build.py dephell/commands/jail_remove.py dephell/commands/discover.py @@ -158,4 +164,5 @@ dephell/templates/autocomplete.sh.j2 dephell/templates/autocomplete-zsh.sh.j2 dephell/templates/state.html.j2 +dephell/templates/contributing.md.j2 dephell/templates/docker_prepare.sh \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/dephell.egg-info/requires.txt new/dephell-0.7.9/dephell.egg-info/requires.txt --- old/dephell-0.7.8/dephell.egg-info/requires.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/dephell.egg-info/requires.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ aiohttp appdirs -attrs>=19.1.0 +attrs>=19.2.0 bowler; python_version >= "3.6" bowler-py35>=0.9.1; python_version < "3.6" cerberus>=1.3 @@ -10,6 +10,7 @@ dephell-links>=0.1.4 dephell-markers>=1.0.0 dephell-pythons>=0.1.11 +dephell-setuptools>=0.2.1 dephell-shells>=0.1.3 dephell-specifier>=0.1.7 dephell-venvs>=0.1.16 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/setup.py new/dephell-0.7.9/setup.py --- old/dephell-0.7.8/setup.py 2019-10-22 17:38:37.000000000 +0200 +++ new/dephell-0.7.9/setup.py 2019-11-19 16:23:35.000000000 +0100 @@ -21,13 +21,13 @@ setup( long_description=readme, name='dephell', - version='0.7.8', + version='0.7.9', description='Dependency resolution for Python', python_requires='>=3.5', project_urls={ - 'homepage': 'https://dephell.org/', - 'repository': 'https://github.com/dephell/dephell', - 'documentation': 'https://dephell.org/docs/' + "documentation": "https://dephell.org/docs/", + "homepage": "https://dephell.org/", + "repository": "https://github.com/dephell/dephell" }, author='Gram', author_email='[email protected]', @@ -37,42 +37,48 @@ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Framework :: Setuptools Plugin', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', 'Topic :: Security', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Security', 'Topic :: Software Development :: Build Tools', 'Topic :: Software Development :: Libraries :: Python Modules' ], - entry_points={'console_scripts': ['dephell = dephell.cli:entrypoint']}, + entry_points={"console_scripts": ["dephell = dephell.cli:entrypoint"]}, packages=[ 'dephell', 'dephell.actions', 'dephell.commands', 'dephell.config', 'dephell.controllers', 'dephell.converters', 'dephell.models', 'dephell.repositories', 'dephell.repositories._conda', 'dephell.repositories._git', 'dephell.repositories._warehouse' ], - package_data={'dephell': ['templates/*.j2', 'templates/*.sh']}, + package_dir={"": "."}, + package_data={"dephell": ["templates/*.j2", "templates/*.sh"]}, install_requires=[ - 'aiohttp', 'appdirs', 'attrs>=19.1.0', + 'aiohttp', 'appdirs', 'attrs>=19.2.0', 'bowler; python_version >= "3.6"', 'bowler-py35>=0.9.1; python_version < "3.6"', 'cerberus>=1.3', 'dephell-archive>=0.1.5', 'dephell-discover>=0.2.6', 'dephell-licenses>=0.1.6', 'dephell-links>=0.1.4', 'dephell-markers>=1.0.0', 'dephell-pythons>=0.1.11', - 'dephell-shells>=0.1.3', 'dephell-specifier>=0.1.7', - 'dephell-venvs>=0.1.16', 'dephell-versioning', 'docker', 'dockerpty', + 'dephell-setuptools>=0.2.1', 'dephell-shells>=0.1.3', + 'dephell-specifier>=0.1.7', 'dephell-venvs>=0.1.16', + 'dephell-versioning', 'docker', 'dockerpty', 'fissix; python_version >= "3.6"', 'fissix-py35; python_version < "3.6"', 'flatdict', 'html5lib', 'jinja2', 'm2r', 'packaging', 'pip>=18.0', 'pygments', 'requests', 'ruamel.yaml', 'setuptools', 'tabulate', 'tomlkit', 'yaspin' ], extras_require={ - 'full': ['aiofiles', 'autopep8', 'colorama', 'graphviz', 'yapf'], - 'tests': ['aioresponses', 'pytest', 'requests-mock'], - 'dev': [ - 'aioresponses', 'alabaster', 'flake8-isort', 'isort[pyproject]', - 'pygments-github-lexers', 'pytest', 'recommonmark', 'requests-mock', - 'sphinx' + "dev": [ + "aioresponses", "alabaster", "flake8-isort", "isort[pyproject]", + "pygments-github-lexers", "pytest", "recommonmark", "requests-mock", + "sphinx" ], - 'docs': [ - 'alabaster', 'pygments-github-lexers', 'recommonmark', 'sphinx' - ] + "docs": [ + "alabaster", "pygments-github-lexers", "recommonmark", "sphinx" + ], + "full": ["aiofiles", "autopep8", "colorama", "graphviz", "yapf"], + "tests": ["aioresponses", "pytest", "requests-mock"] }, ) Binary files old/dephell-0.7.8/tests/__pycache__/__init__.cpython-37.pyc and new/dephell-0.7.9/tests/__pycache__/__init__.cpython-37.pyc differ Binary files old/dephell-0.7.8/tests/__pycache__/conftest.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/__pycache__/conftest.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/__pycache__/helpers.cpython-37.pyc and new/dephell-0.7.9/tests/__pycache__/helpers.cpython-37.pyc differ Binary files old/dephell-0.7.8/tests/__pycache__/test_cli.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/__pycache__/test_cli.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/__pycache__/test_config.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/__pycache__/test_config.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/__pycache__/test_helpers.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/__pycache__/test_helpers.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/__pycache__/test_utils.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/__pycache__/test_utils.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_actions/__pycache__/__init__.cpython-37.pyc and new/dephell-0.7.9/tests/test_actions/__pycache__/__init__.cpython-37.pyc differ Binary files old/dephell-0.7.8/tests/test_actions/__pycache__/test_dotenv.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_actions/__pycache__/test_dotenv.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_actions/__pycache__/test_transform.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_actions/__pycache__/test_transform.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_actions/__pycache__/test_travis.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_actions/__pycache__/test_travis.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/__init__.cpython-37.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/__init__.cpython-37.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_build.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_build.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_deps_convert.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_deps_convert.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_deps_install.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_deps_install.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_deps_licenses.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_deps_licenses.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_deps_outdated.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_deps_outdated.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_deps_tree.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_deps_tree.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_generate_config.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_generate_config.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_generate_editorconfig.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_generate_editorconfig.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_generate_license.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_generate_license.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_generate_travis.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_generate_travis.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_inspect_config.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_inspect_config.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_inspect_venv.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_inspect_venv.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_jail_install.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_jail_install.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_package_downloads.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_package_downloads.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_package_install.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_package_install.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_package_search.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_package_search.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_package_show.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_package_show.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_project_bump.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_project_bump.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_vendor_download.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_vendor_download.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_vendor_import.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_vendor_import.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_venv_create.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_venv_create.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_commands/__pycache__/test_venv_destroy.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_commands/__pycache__/test_venv_destroy.cpython-37-pytest-5.2.1.pyc differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/tests/test_commands/test_generate_contributing.py new/dephell-0.7.9/tests/test_commands/test_generate_contributing.py --- old/dephell-0.7.8/tests/test_commands/test_generate_contributing.py 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/tests/test_commands/test_generate_contributing.py 2019-11-19 15:57:03.000000000 +0100 @@ -0,0 +1,32 @@ +# built-in +from textwrap import dedent + +# project +from dephell.commands import GenerateContributingCommand +from dephell.config import Config + + +def test_make_contributing_pytest(temp_path): + (temp_path / 'pyproject.toml').write_text(dedent( + """ + [tool.dephell.isort] + command = "isort -y" + + [tool.dephell.flake8] + command = "flake8" + + [tool.dephell.pytest] + command = "python -m pytest tests/" + """, + )) + config = Config() + config.attach({'project': str(temp_path)}) + command = GenerateContributingCommand(argv=[], config=config) + result = command() + + assert result is True + assert (temp_path / 'CONTRIBUTING.md').exists() + content = (temp_path / 'CONTRIBUTING.md').read_text() + assert '## Testing' in content + assert '## Style' in content + assert 'Sort imports' in content diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/tests/test_commands/test_inspect_project.py new/dephell-0.7.9/tests/test_commands/test_inspect_project.py --- old/dephell-0.7.8/tests/test_commands/test_inspect_project.py 1970-01-01 01:00:00.000000000 +0100 +++ new/dephell-0.7.9/tests/test_commands/test_inspect_project.py 2019-11-19 15:57:03.000000000 +0100 @@ -0,0 +1,29 @@ +# built-in +import json +from pathlib import Path + +# project +from dephell.commands import InspectProjectCommand +from dephell.config import Config + + +def test_inspect_project_command(temp_path: Path, requirements_path: Path, capsys): + from_path = str(requirements_path / 'poetry.toml') + config = Config() + config.attach({ + 'from': {'format': 'poetry', 'path': from_path}, + 'project': str(temp_path), + 'nocolors': True, + 'silent': True, + }) + + command = InspectProjectCommand(argv=[], config=config) + result = command() + assert result is True + + captured = capsys.readouterr() + print(captured.out) + output = json.loads(captured.out) + assert set(output) == {'name', 'version', 'description', 'links', 'python'} + assert output['name'] == 'my-package' + assert output['version'] == '0.1.0' Binary files old/dephell-0.7.8/tests/test_controllers/__pycache__/__init__.cpython-37.pyc and new/dephell-0.7.9/tests/test_controllers/__pycache__/__init__.cpython-37.pyc differ Binary files old/dephell-0.7.8/tests/test_controllers/__pycache__/test_safety.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_controllers/__pycache__/test_safety.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_controllers/__pycache__/test_snyk.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_controllers/__pycache__/test_snyk.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/__init__.cpython-37.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/__init__.cpython-37.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_all.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_all.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_conda.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_conda.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_egginfo.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_egginfo.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_imports.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_imports.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_installed.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_installed.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_pip.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_pip.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_pipfile.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_pipfile.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_pipfilelock.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_pipfilelock.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_poetry.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_poetry.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_poetrylock.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_poetrylock.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_sdist.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_sdist.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_setuppy.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_setuppy.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_converters/__pycache__/test_wheel.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_converters/__pycache__/test_wheel.cpython-37-pytest-5.2.1.pyc differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/tests/test_converters/test_imports.py new/dephell-0.7.9/tests/test_converters/test_imports.py --- old/dephell-0.7.8/tests/test_converters/test_imports.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/tests/test_converters/test_imports.py 2019-11-19 15:57:03.000000000 +0100 @@ -1,3 +1,5 @@ +from pathlib import Path + # external import pytest @@ -21,6 +23,7 @@ assert modules == expected [email protected](not Path('dephell').exists(), reason='dephell source dir does not exist') @pytest.mark.allow_hosts() def test_imports_load(): converter = ImportsConverter() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/tests/test_converters/test_setuppy.py new/dephell-0.7.9/tests/test_converters/test_setuppy.py --- old/dephell-0.7.8/tests/test_converters/test_setuppy.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/tests/test_converters/test_setuppy.py 2019-11-19 15:56:59.000000000 +0100 @@ -1,5 +1,6 @@ # built-in from pathlib import Path +from textwrap import dedent # external from dephell_links import VCSLink @@ -29,6 +30,57 @@ assert not root.license +def test_dotted_setup_call(temp_path: Path): + path = temp_path / 'setup.py' + path.write_text(dedent(""" + import setuptools + setuptools.setup(name='foo') + """)) + root = SetupPyConverter().load(path) + assert root.name == 'foo' + + +def test_return_setup_call(temp_path: Path): + path = temp_path / 'setup.py' + path.write_text(dedent(""" + from setuptools import setup + def main(): + return setup(name='foo') + + if __name__ == '__main__': + main() + """)) + root = SetupPyConverter().load(path) + assert root.name == 'foo' + + +def test_run_setup_function(temp_path: Path): + path = temp_path / 'setup.py' + path.write_text(dedent(""" + from setuptools import setup + def run_setup(): + return setup(name='foo') + + if __name__ == '__main__': + run_setup() + """)) + root = SetupPyConverter().load(path) + assert root.name == 'foo' + + +def test_import(temp_path: Path): + path = temp_path / 'local_module.py' + path.write_text(dedent('name = "imported"')) + path = temp_path / 'setup.py' + path.write_text(dedent(""" + from setuptools import setup + import local_module + setup(name=local_module.name) + """)) + root = SetupPyConverter().load(path) + assert root.name == 'imported' + + def test_dumps_deps(): path = Path('tests') / 'requirements' / 'setup.py' converter = SetupPyConverter() Binary files old/dephell-0.7.8/tests/test_models/__pycache__/__init__.cpython-37.pyc and new/dephell-0.7.9/tests/test_models/__pycache__/__init__.cpython-37.pyc differ Binary files old/dephell-0.7.8/tests/test_models/__pycache__/test_author.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_models/__pycache__/test_author.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_models/__pycache__/test_marker_tracker.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_models/__pycache__/test_marker_tracker.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_models/__pycache__/test_models_dependency.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_models/__pycache__/test_models_dependency.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_models/__pycache__/test_release.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_models/__pycache__/test_release.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_models/__pycache__/test_requirement.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_models/__pycache__/test_requirement.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_repositories/__pycache__/__init__.cpython-37.pyc and new/dephell-0.7.9/tests/test_repositories/__pycache__/__init__.cpython-37.pyc differ Binary files old/dephell-0.7.8/tests/test_repositories/__pycache__/test_conda.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_repositories/__pycache__/test_conda.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_repositories/__pycache__/test_git_git.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_repositories/__pycache__/test_git_git.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_repositories/__pycache__/test_local.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_repositories/__pycache__/test_local.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_repositories/__pycache__/test_warehouse_api.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_repositories/__pycache__/test_warehouse_api.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_repositories/__pycache__/test_warehouse_local.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_repositories/__pycache__/test_warehouse_local.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_repositories/__pycache__/test_warehouse_simple.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_repositories/__pycache__/test_warehouse_simple.cpython-37-pytest-5.2.1.pyc differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dephell-0.7.8/tests/test_repositories/test_git_git.py new/dephell-0.7.9/tests/test_repositories/test_git_git.py --- old/dephell-0.7.8/tests/test_repositories/test_git_git.py 2019-10-11 12:00:55.000000000 +0200 +++ new/dephell-0.7.9/tests/test_repositories/test_git_git.py 2019-11-19 15:57:03.000000000 +0100 @@ -12,6 +12,7 @@ loop = asyncio.get_event_loop() +git_path = Path('.git') class PatchedVCSLink(VCSLink): @@ -23,6 +24,7 @@ @pytest.mark.skipif('TRAVIS_OS_NAME' in environ, reason='Travis CI has broken git repo') [email protected](not git_path.exists(), reason='.git folder does not exist') def test_releases(): link = PatchedVCSLink(server=None, author=None, project=None, name='dephell') repo = GitRepo(link) @@ -37,6 +39,7 @@ @pytest.mark.skipif('TRAVIS_OS_NAME' in environ, reason='Travis CI has broken git repo') [email protected](not git_path.exists(), reason='.git folder does not exist') def test_deps(): link = PatchedVCSLink(server=None, author=None, project=None, name='dephell') repo = GitRepo(link) @@ -48,6 +51,7 @@ @pytest.mark.skipif('TRAVIS_OS_NAME' in environ, reason='Travis CI has broken git repo') [email protected](not git_path.exists(), reason='.git folder does not exist') def test_metaversion(): link = PatchedVCSLink(server=None, author=None, project=None, name='dephell') repo = GitRepo(link) Binary files old/dephell-0.7.8/tests/test_resolving/__pycache__/__init__.cpython-37.pyc and new/dephell-0.7.9/tests/test_resolving/__pycache__/__init__.cpython-37.pyc differ Binary files old/dephell-0.7.8/tests/test_resolving/__pycache__/test_extras.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_resolving/__pycache__/test_extras.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_resolving/__pycache__/test_git_resolving.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_resolving/__pycache__/test_git_resolving.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_resolving/__pycache__/test_merging.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_resolving/__pycache__/test_merging.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_resolving/__pycache__/test_mutator.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_resolving/__pycache__/test_mutator.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_resolving/__pycache__/test_python_compat.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_resolving/__pycache__/test_python_compat.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_resolving/__pycache__/test_resolver.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_resolving/__pycache__/test_resolver.cpython-37-pytest-5.2.1.pyc differ Binary files old/dephell-0.7.8/tests/test_resolving/__pycache__/test_smoke.cpython-37-pytest-5.2.1.pyc and new/dephell-0.7.9/tests/test_resolving/__pycache__/test_smoke.cpython-37-pytest-5.2.1.pyc differ
