Keyword arguments:
pkg_name -- String to rename
"""
- name = re.sub('[^\w-]', '', pkg_name.lower())
+ name = re.sub(r'[^\w-]', '', pkg_name.lower())
name = name.replace('_', '-')
prefix = 'python-'
- pattern = re.compile('^(?!' + prefix + ')(.+?)$')
+ pattern = re.compile(r'^(?!' + prefix + ')(.+?)$')
name = pattern.sub(r'python-\1', name)
return name
self.pkg_req = None
return set()
self.pkg_req = self.setup_metadata['install_requires']
- self.pkg_req = [re.sub('([-.\w]+).*', r'\1', req)
+ self.pkg_req = [re.sub(r'([-.\w]+).*', r'\1', req)
for req in self.pkg_req]
# get rid of commented lines and also strip the package strings
"Mozilla Public License 2.0": "MPL-2.0",
"Zope Public License": "ZPL"
}
- regexp = re.compile('^License :* *.* *:+ (.*)( \(.*\))?$')
+ regexp = re.compile(r'^License :* *.* *:+ (.*)( \(.*\))?$')
classifiers_licenses = [regexp.sub(r"\1", lic)
for lic in self.metadata['info']['classifiers']
if regexp.match(lic)]