Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions pyp2rpm/convertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,10 @@ def template_py_vers(self):

def merge_versions(self, data):
"""Merges python versions specified in command lines options with
extracted versions, checks if some of the versions is not > 2 if EPEL6
template will be used. attributes base_python_version and
extracted versions. Attributes base_python_version and
python_versions contain values specified by command line options or
default values, data.python_versions contains extracted data.
"""
if self.distro == "epel6":
# if user requested version greater than 2, writes error message
# and exits
requested_versions = self.python_versions
if self.base_python_version:
requested_versions += [self.base_python_version]
if any(int(ver[0]) > 2 for ver in requested_versions):
sys.stderr.write(
"Invalid version, major number of python version for "
"EPEL6 spec file must not be greater than 2.\n")
sys.exit(1)
# if version greater than 2 were extracted it is removed
data.python_versions = [
ver for ver in data.python_versions if not int(ver[0]) > 2]

# Set python versions from default values in settings.
base_version, additional_versions = (
Expand Down
8 changes: 5 additions & 3 deletions pyp2rpm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
DEFAULT_TEMPLATE = 'fedora'
DEFAULT_PYTHON_VERSIONS = {
'fedora': ['3'],
'epel7': ['2', '3'],
'epel6': ['2'],
'epel9': ['3'],
'epel8': ['3'],
'epel7': ['3'],
'epel6': ['3'],
'mageia': ['3'],
'pld': ['2', '3']
'pld': ['3']
}
DEFAULT_PYTHON_VERSION = DEFAULT_PYTHON_VERSIONS[DEFAULT_TEMPLATE][0]
DEFAULT_PKG_SOURCE = 'pypi'
Expand Down