diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2018-01-04 20:42:12 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-04 20:42:12 -0500 |
| commit | c0edf9323c1e124ae34f96ccfb7cf21df0f32252 (patch) | |
| tree | 3e2c19e8371c90d3c0d7fbfb6d8122e47def47de /setuptools/tests/test_egg_info.py | |
| parent | 7af7f8a68ea4b0f7d45a739273684832fa609935 (diff) | |
| parent | 85747b8ccc2a2da7ecb59c6aff2561c052c463d2 (diff) | |
| download | python-setuptools-git-c0edf9323c1e124ae34f96ccfb7cf21df0f32252.tar.gz | |
Merge branch 'master' into master
Diffstat (limited to 'setuptools/tests/test_egg_info.py')
| -rw-r--r-- | setuptools/tests/test_egg_info.py | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index e05498b8..7d12434e 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -191,7 +191,8 @@ class TestEggInfo(object): test_params = test.lstrip().split('\n\n', 3) name_kwargs = test_params.pop(0).split('\n') if len(name_kwargs) > 1: - install_cmd_kwargs = ast.literal_eval(name_kwargs[1].strip()) + val = name_kwargs[1].strip() + install_cmd_kwargs = ast.literal_eval(val) else: install_cmd_kwargs = {} name = name_kwargs[0].strip() @@ -211,9 +212,11 @@ class TestEggInfo(object): expected_requires, install_cmd_kwargs, marks=marks)) - return pytest.mark.parametrize('requires,use_setup_cfg,' - 'expected_requires,install_cmd_kwargs', - argvalues, ids=idlist) + return pytest.mark.parametrize( + 'requires,use_setup_cfg,' + 'expected_requires,install_cmd_kwargs', + argvalues, ids=idlist, + ) @RequiresTestHelper.parametrize( # Format of a test: @@ -228,6 +231,20 @@ class TestEggInfo(object): # expected contents of requires.txt ''' + install_requires_deterministic + + install_requires=["fake-factory==0.5.2", "pytz"] + + [options] + install_requires = + fake-factory==0.5.2 + pytz + + fake-factory==0.5.2 + pytz + ''', + + ''' install_requires_with_marker install_requires=["barbazquux;{mismatch_marker}"], @@ -361,9 +378,9 @@ class TestEggInfo(object): mismatch_marker=mismatch_marker, mismatch_marker_alternate=mismatch_marker_alternate, ) - def test_requires(self, tmpdir_cwd, env, - requires, use_setup_cfg, - expected_requires, install_cmd_kwargs): + def test_requires( + self, tmpdir_cwd, env, requires, use_setup_cfg, + expected_requires, install_cmd_kwargs): self._setup_script_with_requires(requires, use_setup_cfg) self._run_install_command(tmpdir_cwd, env, **install_cmd_kwargs) egg_info_dir = os.path.join('.', 'foo.egg-info') @@ -376,6 +393,17 @@ class TestEggInfo(object): assert install_requires.lstrip() == expected_requires assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == [] + def test_install_requires_unordered_disallowed(self, tmpdir_cwd, env): + """ + Packages that pass unordered install_requires sequences + should be rejected as they produce non-deterministic + builds. See #458. + """ + req = 'install_requires={"fake-factory==0.5.2", "pytz"}' + self._setup_script_with_requires(req) + with pytest.raises(AssertionError): + self._run_install_command(tmpdir_cwd, env) + def test_extras_require_with_invalid_marker(self, tmpdir_cwd, env): tmpl = 'extras_require={{":{marker}": ["barbazquux"]}},' req = tmpl.format(marker=self.invalid_marker) |
