class documentation

class TestEggInfo: (source)

View In Hierarchy

Undocumented

Class RequiresTestHelper Undocumented
Method test_doesnt_provides_extra Undocumented
Method test_egg_info_includes_setup_py Undocumented
Method test_egg_info_save_version_info_setup_defaults 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_egg_info_save_version_info_setup_empty 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_egg_info_tag_only_once Undocumented
Method test_expected_files_produced Undocumented
Method test_extras_require_with_invalid_marker Undocumented
Method test_extras_require_with_invalid_marker_in_req Undocumented
Method test_get_pkg_info_revision_deprecated Undocumented
Method test_handling_utime_error Undocumented
Method test_install_requires_unordered_disallowed Packages that pass unordered install_requires sequences should be rejected as they produce non-deterministic builds. See #458.
Method test_license Test single line license.
Method test_license_escape Test license is escaped correctly if longer than one line.
Method test_license_file_attr_pkg_info All matched license files should have a corresponding License-File.
Method test_license_is_a_string Undocumented
Method test_long_description Undocumented
Method test_long_description_content_type Undocumented
Method test_manifest_maker_warning_suppression Undocumented
Method test_manifest_template_is_read Undocumented
Method test_metadata_version Make sure latest metadata version is used by default.
Method test_project_urls Undocumented
Method test_provides_extra Undocumented
Method test_python_requires_egg_info Undocumented
Method test_rebuilt Ensure timestamps are updated when the command is re-run.
Method test_requires Undocumented
Method test_setup_cfg_license_file Undocumented
Method test_setup_cfg_license_file_license_files Undocumented
Method test_setup_cfg_license_files Undocumented
Class Variable invalid_marker Undocumented
Class Variable mismatch_marker Undocumented
Class Variable mismatch_marker_alternate Undocumented
Class Variable setup_script Undocumented
Static Method _extract_mv_version Undocumented
Static Method _validate_content_order Assert that the strings in expected appear in content in order.
Method _create_project Undocumented
Method _run_egg_info_command Undocumented
Method _setup_script_with_requires Undocumented
def test_doesnt_provides_extra(self, tmpdir_cwd, env): (source)

Undocumented

def test_egg_info_includes_setup_py(self, tmpdir_cwd): (source)

Undocumented

def test_egg_info_save_version_info_setup_defaults(self, tmpdir_cwd, env): (source)

When running save_version_info on an existing setup.cfg with the 'default' values present from a previous run, the file should remain unchanged.

def test_egg_info_save_version_info_setup_empty(self, tmpdir_cwd, env): (source)

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.

def test_egg_info_tag_only_once(self, tmpdir_cwd, env): (source)

Undocumented

def test_expected_files_produced(self, tmpdir_cwd, env): (source)

Undocumented

def test_extras_require_with_invalid_marker(self, tmpdir_cwd, env): (source)

Undocumented

def test_extras_require_with_invalid_marker_in_req(self, tmpdir_cwd, env): (source)

Undocumented

def test_get_pkg_info_revision_deprecated(self): (source)

Undocumented

def test_handling_utime_error(self, tmpdir_cwd, env): (source)

Undocumented

def test_install_requires_unordered_disallowed(self, tmpdir_cwd, env): (source)

Packages that pass unordered install_requires sequences should be rejected as they produce non-deterministic builds. See #458.

def test_license(self, tmpdir_cwd, env): (source)

Test single line license.

def test_license_escape(self, tmpdir_cwd, env): (source)

Test license is escaped correctly if longer than one line.

def test_license_file_attr_pkg_info(self, tmpdir_cwd, env): (source)

All matched license files should have a corresponding License-File.

def test_license_is_a_string(self, tmpdir_cwd, env): (source)

Undocumented

def test_long_description(self, tmpdir_cwd, env): (source)

Undocumented

def test_long_description_content_type(self, tmpdir_cwd, env): (source)

Undocumented

def test_manifest_maker_warning_suppression(self): (source)

Undocumented

def test_manifest_template_is_read(self, tmpdir_cwd, env): (source)

Undocumented

def test_metadata_version(self, tmpdir_cwd, env): (source)

Make sure latest metadata version is used by default.

def test_project_urls(self, tmpdir_cwd, env): (source)

Undocumented

def test_provides_extra(self, tmpdir_cwd, env): (source)

Undocumented

def test_python_requires_egg_info(self, tmpdir_cwd, env): (source)

Undocumented

def test_rebuilt(self, tmpdir_cwd, env): (source)

Ensure timestamps are updated when the command is re-run.

@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)

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)

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)

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)

Undocumented

invalid_marker: str = (source)

Undocumented

mismatch_marker = (source)

Undocumented

mismatch_marker_alternate = (source)

Undocumented

setup_script = (source)

Undocumented

@staticmethod
def _extract_mv_version(pkg_info_lines: List[str]) -> Tuple[int, int]: (source)

Undocumented

@staticmethod
def _validate_content_order(content, expected): (source)

Assert that the strings in expected appear in content in order.

def _create_project(self): (source)

Undocumented

def _run_egg_info_command(self, tmpdir_cwd, env, cmd=None, output=None): (source)

Undocumented

def _setup_script_with_requires(self, requires, use_setup_cfg=False): (source)

Undocumented