Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if self.FIELD_DESCRIPTION in metadata_config:
return
description_config = config.setdefault(facility_section_name, {})
filename = description_config.get(self.FIELD_FILE)
if not filename:
filename = self._find_readme_file('.')
if not filename:
return
metadata_config[self.FIELD_DESCRIPTION] = self._read_file(filename)
files_config = config.setdefault('files', {})
packaging.append_text_list(files_config, 'extra_files', [filename])
def hook(self):
packaging.append_text_list(self.config, 'requires_dist', packaging.parse_requirements())
def __call__(self, config, facility_section_name):
metadata = config.setdefault('metadata', {})
backwards_compat = config.setdefault('backwards_compat', {})
dependencies_facility_config = config.setdefault(facility_section_name, {})
install_requirements = self._get_requirements(dependencies_facility_config, self.FIELD_INSTALL_REQUIRES,
self.requirements_base)
test_requirements = self._get_requirements(dependencies_facility_config, self.FIELD_TEST_REQUIRES,
self.requirements_test)
packaging.append_text_list(metadata, 'requires_dist', packaging.parse_requirements(install_requirements))
packaging.append_text_list(backwards_compat, 'tests_require', packaging.parse_requirements(test_requirements))
base_links = packaging.parse_dependency_links(install_requirements)
test_links = packaging.parse_dependency_links(test_requirements)
links = list(set(base_links + test_links))
packaging.append_text_list(backwards_compat, 'dependency_links', links)
referenced_files = self._find_linked_requirements_files(chain(install_requirements, test_requirements))
files_config = config.setdefault('files', {})
packaging.append_text_list(files_config, 'extra_files', referenced_files)
def __call__(self, config, facility_section_name):
license_config = config.setdefault(facility_section_name, {})
license_file = license_config.get(self.FIELD_LICENSE_FILE)
if not license_file:
license_file = self._find_license_file('.')
if not license_file:
return
files_config = config.setdefault('files', {})
packaging.append_text_list(files_config, 'extra_files', [license_file])
dependencies_facility_config = config.setdefault(facility_section_name, {})
install_requirements = self._get_requirements(dependencies_facility_config, self.FIELD_INSTALL_REQUIRES,
self.requirements_base)
test_requirements = self._get_requirements(dependencies_facility_config, self.FIELD_TEST_REQUIRES,
self.requirements_test)
packaging.append_text_list(metadata, 'requires_dist', packaging.parse_requirements(install_requirements))
packaging.append_text_list(backwards_compat, 'tests_require', packaging.parse_requirements(test_requirements))
base_links = packaging.parse_dependency_links(install_requirements)
test_links = packaging.parse_dependency_links(test_requirements)
links = list(set(base_links + test_links))
packaging.append_text_list(backwards_compat, 'dependency_links', links)
referenced_files = self._find_linked_requirements_files(chain(install_requirements, test_requirements))
files_config = config.setdefault('files', {})
packaging.append_text_list(files_config, 'extra_files', referenced_files)
def hook(self):
self.config['version'] = packaging.get_version(
self.config['name'], self.config.get('version', None))
packaging.append_text_list(
self.config, 'requires_dist',
packaging.parse_requirements())
def hook(self):
self.config['include_package_data'] = 'True'
packaging.append_text_list(
self.config, 'dependency_links',
packaging.parse_dependency_links())
packaging.append_text_list(
self.config, 'tests_require',
packaging.parse_requirements(
packaging.TEST_REQUIREMENTS_FILES,
strip_markers=True))