class documentation
class TestEggInfo: (source)
Undocumented
Class |
|
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
When running save_version_info on an existing setup.cfg with the 'default' values present from a previous run, the file should remain unchanged. |
Method | test |
When the egg_info section is empty or not present, running save_version_info should add the settings to the setup.cfg in a deterministic order. |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Packages that pass unordered install_requires sequences should be rejected as they produce non-deterministic builds. See #458. |
Method | test |
Test single line license. |
Method | test |
Test license is escaped correctly if longer than one line. |
Method | test |
All matched license files should have a corresponding License-File. |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Make sure latest metadata version is used by default. |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Ensure timestamps are updated when the command is re-run. |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Class Variable | invalid |
Undocumented |
Class Variable | mismatch |
Undocumented |
Class Variable | mismatch |
Undocumented |
Class Variable | setup |
Undocumented |
Static Method | _extract |
Undocumented |
Static Method | _validate |
Assert that the strings in expected appear in content in order. |
Method | _create |
Undocumented |
Method | _run |
Undocumented |
Method | _setup |
Undocumented |
When running save_version_info on an existing setup.cfg with the 'default' values present from a previous run, the file should remain unchanged.
When the egg_info section is empty or not present, running save_version_info should add the settings to the setup.cfg in a deterministic order.
Packages that pass unordered install_requires sequences should be rejected as they produce non-deterministic builds. See #458.
@RequiresTestHelper.parametrize( '\n install_requires_deterministic\n\n install_requires=["wheel>=0.5", "pytest"]\n\n [options]\n install_requires =\n wheel>=0.5\n pytest\n\n wheel>=0.5\n pytest\n ', '\n install_requires_ordered\n\n install_requires=["pytest>=3.0.2,!=10.9999"]\n\n [options]\n install_requires =\n pytest>=3.0.2,!=10.9999\n\n pytest!=10.9999,>=3.0.2\n ', '\n install_requires_with_marker\n\n install_requires=["barbazquux;{mismatch_marker}"],\n\n [options]\n install_requires =\n barbazquux; {mismatch_marker}\n\n [:{mismatch_marker_alternate}]\n barbazquux\n ', '\n install_requires_with_extra\n {\'cmd\': [\'egg_info\']}\n\n install_requires=["barbazquux [test]"],\n\n [options]\n install_requires =\n barbazquux [test]\n\n barbazquux[test]\n ', '\n install_requires_with_extra_and_marker\n\n install_requires=["barbazquux [test]; {mismatch_marker}"],\n\n [options]\n install_requires =\n barbazquux [test]; {mismatch_marker}\n\n [:{mismatch_marker_alternate}]\n barbazquux[test]\n ', '\n setup_requires_with_markers\n\n setup_requires=["barbazquux;{mismatch_marker}"],\n\n [options]\n setup_requires =\n barbazquux; {mismatch_marker}\n\n ', '\n tests_require_with_markers\n {\'cmd\': [\'test\'], \'output\': "Ran 0 tests in"}\n\n tests_require=["barbazquux;{mismatch_marker}"],\n\n [options]\n tests_require =\n barbazquux; {mismatch_marker}\n\n ', '\n extras_require_with_extra\n {\'cmd\': [\'egg_info\']}\n\n extras_require={{"extra": ["barbazquux [test]"]}},\n\n [options.extras_require]\n extra = barbazquux [test]\n\n [extra]\n barbazquux[test]\n ', '\n extras_require_with_extra_and_marker_in_req\n\n extras_require={{"extra": ["barbazquux [test]; {mismatch_marker}"]}},\n\n [options.extras_require]\n extra =\n barbazquux [test]; {mismatch_marker}\n\n [extra]\n\n [extra:{mismatch_marker_alternate}]\n barbazquux[test]\n ', '\n extras_require_with_marker\n\n extras_require={{":{mismatch_marker}": ["barbazquux"]}},\n\n @xfail\n [options.extras_require]\n :{mismatch_marker} = barbazquux\n\n [:{mismatch_marker}]\n barbazquux\n ', '\n extras_require_with_marker_in_req\n\n extras_require={{"extra": ["barbazquux; {mismatch_marker}"]}},\n\n [options.extras_require]\n extra =\n barbazquux; {mismatch_marker}\n\n [extra]\n\n [extra:{mismatch_marker_alternate}]\n barbazquux\n ', '\n extras_require_with_empty_section\n\n extras_require={{"empty": []}},\n\n [options.extras_require]\n empty =\n\n [empty]\n ', invalid_marker=invalid_marker, 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): (source) ¶
def test_requires(self, tmpdir_cwd, env, requires, use_setup_cfg, expected_requires, install_cmd_kwargs): (source) ¶
Undocumented
@pytest.mark.parametrize( 'files, license_in_sources', [ ( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICENSE\n '), 'LICENSE': 'Test license'}, True), ( { 'setup.cfg': DALS( '\n [metadata]\n license_file = INVALID_LICENSE\n '), 'LICENSE': 'Test license'}, False), ( { 'setup.cfg': DALS( '\n '), 'LICENSE': 'Test license'}, True), ( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICENSE\n '), 'MANIFEST.in': 'exclude LICENSE', 'LICENSE': 'Test license'}, True), pytest.param( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICEN[CS]E*\n '), 'LICENSE': 'Test license'}, True, id='glob_pattern')])
def test_setup_cfg_license_file(self, tmpdir_cwd, env, files, license_in_sources): (source) ¶
def test_setup_cfg_license_file(self, tmpdir_cwd, env, files, license_in_sources): (source) ¶
Undocumented
@pytest.mark.parametrize( 'files, incl_licenses, excl_licenses', [ ( { 'setup.cfg': DALS( '\n [metadata]\n license_file =\n license_files =\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-XYZ': 'XYZ license'}, [], [ 'LICENSE-ABC', 'LICENSE-XYZ']), ( { 'setup.cfg': DALS( '\n [metadata]\n license_file =\n LICENSE-ABC\n LICENSE-XYZ\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-XYZ': 'XYZ license'}, [], [ 'LICENSE-ABC', 'LICENSE-XYZ']), ( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICENSE-ABC\n license_files =\n LICENSE-XYZ\n LICENSE-PQR\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-PQR': 'PQR license', 'LICENSE-XYZ': 'XYZ license'}, [ 'LICENSE-ABC', 'LICENSE-PQR', 'LICENSE-XYZ'], []), ( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICENSE-ABC\n license_files =\n LICENSE-ABC\n LICENSE-XYZ\n LICENSE-PQR\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-PQR': 'PQR license', 'LICENSE-XYZ': 'XYZ license'}, [ 'LICENSE-ABC', 'LICENSE-PQR', 'LICENSE-XYZ'], []), ( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICENSE-ABC\n license_files =\n LICENSE-XYZ\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-PQR': 'PQR license', 'LICENSE-XYZ': 'XYZ license'}, [ 'LICENSE-ABC', 'LICENSE-XYZ'], [ 'LICENSE-PQR']), ( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICENSE-ABC\n license_files =\n LICENSE-XYZ\n LICENSE-PQR\n '), 'LICENSE-PQR': 'Test license'}, [ 'LICENSE-PQR'], [ 'LICENSE-ABC', 'LICENSE-XYZ']), ( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICENSE-ABC\n license_files =\n LICENSE-PQR\n LICENSE-XYZ\n '), 'MANIFEST.in': 'exclude LICENSE-ABC\nexclude LICENSE-PQR', 'LICENSE-ABC': 'ABC license', 'LICENSE-PQR': 'PQR license', 'LICENSE-XYZ': 'XYZ license'}, [ 'LICENSE-ABC', 'LICENSE-PQR', 'LICENSE-XYZ'], []), pytest.param( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICENSE*\n '), 'LICENSE-ABC': 'ABC license', 'NOTICE-XYZ': 'XYZ notice'}, [ 'LICENSE-ABC'], [ 'NOTICE-XYZ'], id='no_default_glob_patterns'), pytest.param( { 'setup.cfg': DALS( '\n [metadata]\n license_file = LICENSE*\n license_files =\n NOTICE*\n '), 'LICENSE-ABC': 'ABC license', 'NOTICE-ABC': 'ABC notice', 'AUTHORS-ABC': 'ABC authors'}, [ 'LICENSE-ABC', 'NOTICE-ABC'], [ 'AUTHORS-ABC'], id='combined_glob_patterrns')])
def test_setup_cfg_license_file_license_files(self, tmpdir_cwd, env, files, incl_licenses, excl_licenses): (source) ¶
def test_setup_cfg_license_file_license_files(self, tmpdir_cwd, env, files, incl_licenses, excl_licenses): (source) ¶
Undocumented
@pytest.mark.parametrize( 'files, incl_licenses, excl_licenses', [ ( { 'setup.cfg': DALS( '\n [metadata]\n license_files =\n LICENSE-ABC\n LICENSE-XYZ\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-XYZ': 'XYZ license'}, [ 'LICENSE-ABC', 'LICENSE-XYZ'], []), ( { 'setup.cfg': DALS( '\n [metadata]\n license_files = LICENSE-ABC, LICENSE-XYZ\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-XYZ': 'XYZ license'}, [ 'LICENSE-ABC', 'LICENSE-XYZ'], []), ( { 'setup.cfg': DALS( '\n [metadata]\n license_files =\n LICENSE-ABC\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-XYZ': 'XYZ license'}, [ 'LICENSE-ABC'], [ 'LICENSE-XYZ']), ( { 'setup.cfg': DALS( '\n [metadata]\n license_files =\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-XYZ': 'XYZ license'}, [], [ 'LICENSE-ABC', 'LICENSE-XYZ']), ( { 'setup.cfg': DALS( '\n [metadata]\n license_files = LICENSE-XYZ\n '), 'LICENSE-ABC': 'ABC license', 'LICENSE-XYZ': 'XYZ license'}, [ 'LICENSE-XYZ'], [ 'LICENSE-ABC']), ( { 'setup.cfg': DALS( '\n [metadata]\n license_files =\n LICENSE-ABC\n INVALID_LICENSE\n '), 'LICENSE-ABC': 'Test license'}, [ 'LICENSE-ABC'], [ 'INVALID_LICENSE']), ( { 'setup.cfg': DALS( '\n '), 'LICENSE': 'Test license'}, [ 'LICENSE'], []), ( { 'setup.cfg': DALS( '\n [metadata]\n license_files = LICENSE\n '), 'MANIFEST.in': 'exclude LICENSE', 'LICENSE': 'Test license'}, [ 'LICENSE'], []), ( { 'setup.cfg': DALS( '\n [metadata]\n license_files =\n LICENSE-ABC\n LICENSE-XYZ\n '), 'MANIFEST.in': 'exclude LICENSE-XYZ', 'LICENSE-ABC': 'ABC license', 'LICENSE-XYZ': 'XYZ license'}, [ 'LICENSE-ABC', 'LICENSE-XYZ'], []), pytest.param( { 'setup.cfg': '', 'LICENSE-ABC': 'ABC license', 'COPYING-ABC': 'ABC copying', 'NOTICE-ABC': 'ABC notice', 'AUTHORS-ABC': 'ABC authors', 'LICENCE-XYZ': 'XYZ license', 'LICENSE': 'License', 'INVALID-LICENSE': 'Invalid license'}, [ 'LICENSE-ABC', 'COPYING-ABC', 'NOTICE-ABC', 'AUTHORS-ABC', 'LICENCE-XYZ', 'LICENSE'], [ 'INVALID-LICENSE'], id='default_glob_patterns'), pytest.param( { 'setup.cfg': DALS( '\n [metadata]\n license_files =\n LICENSE*\n '), 'LICENSE-ABC': 'ABC license', 'NOTICE-XYZ': 'XYZ notice'}, [ 'LICENSE-ABC'], [ 'NOTICE-XYZ'], id='no_default_glob_patterns'), pytest.param( { 'setup.cfg': DALS( '\n [metadata]\n license_files =\n LICENSE-ABC\n LICENSE*\n '), 'LICENSE-ABC': 'ABC license'}, [ 'LICENSE-ABC'], [], id='files_only_added_once')])
def test_setup_cfg_license_files(self, tmpdir_cwd, env, files, incl_licenses, excl_licenses): (source) ¶
def test_setup_cfg_license_files(self, tmpdir_cwd, env, files, incl_licenses, excl_licenses): (source) ¶
Undocumented