fedora-python/pyp2rpm

EPEL7 "Requires:" is sometime wrong

falon opened this issue · 7 comments

falon commented

A trouble with EPEL7 is the requirement (Requires:) syntax.

pyp2rpm uses syntax like python3-<packagename>, which is sometimes incorrect. For instance, many packages start with capital letter and EPEL7 downcases them (for instance see at package named Flask).

I feel fine with %{?python_enable_dependency_generator}, it works well with el8. But it doesn't work with el7 (at least some versions of el7, even with latest rpm macros installed).

%{?python_enable_dependency_generator} add requirements in the following form

python3.6dist(flask)

which is EPEL7 compatible. Instead, python3-Flask or python3dist(flask) are not compatible with EPEL7.

If I run pyp2rpm -t epel7 impacket to reproduce this, I get a dependency of the form:

BuildRequires:  python%{python3_pkgversion}-flask >= 1
Requires:       python%{python3_pkgversion}-flask >= 1

Can you provide more information about how to reproduce what you're seeing?

falon commented

The same command in my environment produces:
Requires: python%{python3_pkgversion}-Flask >= 0.10.1

The rpm Flask package provides:

# rpm -q python3-flask --provides
python3-flask = 1:0.12.2-4.el8
python3.6dist(flask) = 0.12.2
python3dist(flask) = 0.12.2

in Red Hat Enterprise Linux release 8.3 (Ootpa).

In setup.py:

install_requires=[
   ...
   'Flask>=0.10.1',
   ...
],

pyp2rpm version is 3.3.5

3.3.5 isn't selecting the newest version due to a bug. Either use pyp2rpm -t epel7 impacket -v 0.9.22 or update to 3.3.6, please.

Could you attach the output and the log produced during that run? (/tmp/pyp2rpm-$user.log)

falon commented

I have upgraded to 3.3.6 and now the result still is:

2021-05-17 16:58:48,625::pyp2rpm.bin::DEBUG::Convertor: <pyp2rpm.convertor.Convertor object at 0x7f2388d18eb0> created. Trying to convert.
2021-05-17 16:58:48,626::pyp2rpm.package_getters::INFO::Using /root/rpmbuild/SOURCES as directory to save source.
2021-05-17 16:58:48,633::pyp2rpm.package_getters::INFO::Local file: dist/ds-repltest-1.4.tar.gz copyed to /root/rpmbuild/SOURCES/ds-repltest-1.4.tar.gz.
2021-05-17 16:58:48,633::pyp2rpm.convertor::INFO::Getting metadata from setup.py using SetupPyMetadataExtractor.
2021-05-17 16:58:48,634::pyp2rpm.convertor::WARNING::Dnf module not found, please dnf install python3-dnf to improve accuracy of name conversion.
2021-05-17 16:58:48,634::pyp2rpm.convertor::DEBUG::Using NameConvertor to convert names of the packages.
2021-05-17 16:58:48,650::pyp2rpm.metadata_extractors::INFO::Running extract_dist command with: /usr/bin/python2
2021-05-17 16:58:49,355::pyp2rpm.name_convertor::DEBUG::Converting name: ds-repltest to rpm name, version: None.
2021-05-17 16:58:49,355::pyp2rpm.name_convertor::DEBUG::Rpmized name of ds-repltest: python-ds-repltest.
2021-05-17 16:58:49,358::pyp2rpm.dependency_parser::DEBUG::Dependencies from setup.py: ['PyYAML>=5.2', 'systemd-python>=234', 'Flask>=0.10.1', 'python-ldap>=3.1.0', 'waitress>=0.8.9'] runtime: True.
2021-05-17 16:58:49,366::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: PyYAML>=5.2 runtime: True.
2021-05-17 16:58:49,367::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'PyYAML', '{name} >= 5.2']].
2021-05-17 16:58:49,367::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: systemd-python>=234 runtime: True.
2021-05-17 16:58:49,367::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'systemd-python', '{name} >= 234']].
2021-05-17 16:58:49,367::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: Flask>=0.10.1 runtime: True.
2021-05-17 16:58:49,367::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'Flask', '{name} >= 0.10.1']].
2021-05-17 16:58:49,367::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: python-ldap>=3.1.0 runtime: True.
2021-05-17 16:58:49,367::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'python-ldap', '{name} >= 3.1']].
2021-05-17 16:58:49,368::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: waitress>=0.8.9 runtime: True.
2021-05-17 16:58:49,368::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'waitress', '{name} >= 0.8.9']].
2021-05-17 16:58:49,368::pyp2rpm.dependency_parser::DEBUG::Dependencies from setup.py in rpm format: [['Requires', 'PyYAML', '{name} >= 5.2'], ['Requires', 'systemd-python', '{name} >= 234'], ['Requires', 'Flask', '{name} >= 0.10.1'], ['Requires', 'python-ldap', '{name} >= 3.1'], ['Requires', 'waitress', '{name} >= 0.8.9']].
2021-05-17 16:58:49,368::pyp2rpm.name_convertor::DEBUG::Converting name: PyYAML to rpm name, version: 2.
2021-05-17 16:58:49,368::pyp2rpm.name_convertor::DEBUG::Rpmized name of PyYAML: python-PyYAML.
2021-05-17 16:58:49,368::pyp2rpm.name_convertor::DEBUG::Converting name: systemd-python to rpm name, version: 2.
2021-05-17 16:58:49,368::pyp2rpm.name_convertor::DEBUG::Rpmized name of systemd-python: python-systemd.
2021-05-17 16:58:49,368::pyp2rpm.name_convertor::DEBUG::Converting name: Flask to rpm name, version: 2.
2021-05-17 16:58:49,368::pyp2rpm.name_convertor::DEBUG::Rpmized name of Flask: python-Flask.
2021-05-17 16:58:49,368::pyp2rpm.name_convertor::DEBUG::Converting name: python-ldap to rpm name, version: 2.
2021-05-17 16:58:49,369::pyp2rpm.name_convertor::DEBUG::Rpmized name of python-ldap: python-ldap.
2021-05-17 16:58:49,369::pyp2rpm.name_convertor::DEBUG::Converting name: waitress to rpm name, version: 2.
2021-05-17 16:58:49,369::pyp2rpm.name_convertor::DEBUG::Rpmized name of waitress: python-waitress.
2021-05-17 16:58:49,379::pyp2rpm.dependency_parser::DEBUG::Dependencies from setup.py: ['setuptools'] runtime: False.
2021-05-17 16:58:49,380::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: setuptools runtime: False.
2021-05-17 16:58:49,380::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['BuildRequires', 'setuptools', '{name}']].
2021-05-17 16:58:49,380::pyp2rpm.dependency_parser::DEBUG::Dependencies from setup.py in rpm format: [['BuildRequires', 'setuptools', '{name}']].
2021-05-17 16:58:49,380::pyp2rpm.name_convertor::DEBUG::Converting name: setuptools to rpm name, version: 2.
2021-05-17 16:58:49,380::pyp2rpm.name_convertor::DEBUG::Rpmized name of setuptools: python-setuptools.
2021-05-17 16:58:49,386::pyp2rpm.metadata_extractors::DEBUG::Skipping virtualenv metadata extraction.
2021-05-17 16:58:49,386::pyp2rpm.metadata_extractors::WARNING::Client is None, it was probably disabled
2021-05-17 16:58:49,386::pyp2rpm.convertor::DEBUG::Extracted metadata:
2021-05-17 16:58:49,388::pyp2rpm.convertor::DEBUG::{'build_deps': [['BuildRequires', 'python2-devel', '{name}'],
                ['BuildRequires', 'python-setuptools', '{name}']],
 'description': ' ds-repltest A 389ds replication checker. With this tool you '
                "can test your LDAP replication.At this time the tool doesn't "
                'autodiscover the replication topology. You must replicate it '
                'in the configuration file.ds-repltest read the configuration '
                'and it tests every supplier and consumer for the replication. '
                'Finally it writes a brief HTML summary and detailed syslog. '
                "Knowing the config file It's a YAML file, so you have to pay "
                'attention to spaces. The core part is INSTANCES. We suggest '
                'to name them with the same name of the Directory Server '
                'instances.Every instance has one or more suppliers, one or '
                'more consumers where you want to check the replication.',
 'dirname': 'ds-repltest-1.4',
 'doc_files': ['README.md'],
 'doc_license': ['LICENSE'],
 'has_bundled_egg_info': True,
 'has_extension': False,
 'has_packages': True,
 'has_pth': False,
 'has_test_suite': False,
 'home_page': 'https://github.com/falon/ds-repltest',
 'license': 'Apache License 2.0',
 'local_file': '/root/rpmbuild/SOURCES/ds-repltest-1.4.tar.gz',
 'md5': '',
 'name': 'ds-repltest',
 'packages': ['dsReplTest'],
 'pkg_name': 'python-ds-repltest',
 'py_modules': [],
 'python_versions': ['3'],
 'runtime_deps': [['Requires', 'python-Flask', '{name} >= 0.10.1'],
                  ['Requires', 'python-PyYAML', '{name} >= 5.2'],
                  ['Requires', 'python-ldap', '{name} >= 3.1'],
                  ['Requires', 'python-systemd', '{name} >= 234'],
                  ['Requires', 'python-waitress', '{name} >= 0.8.9']],
 'scripts': ['ds-repltest.py'],
 'source0': 'ds-repltest-1.4.tar.gz',
 'sphinx_dir': None,
 'srcname': None,
 'summary': 'LDAP Replication Check for 389ds',
 'version': '1.4'}
2021-05-17 17:00:17,777::pyp2rpm.bin::INFO::Pyp2rpm initialized.
2021-05-17 17:00:17,778::pyp2rpm.bin::DEBUG::Convertor: <pyp2rpm.convertor.Convertor object at 0x7f4df9720eb0> created. Trying to convert.
2021-05-17 17:00:17,778::pyp2rpm.package_getters::INFO::Using /root/rpmbuild/SOURCES as directory to save source.
2021-05-17 17:00:17,779::pyp2rpm.package_getters::INFO::Local file: dist/ds-repltest-1.4.tar.gz copyed to /root/rpmbuild/SOURCES/ds-repltest-1.4.tar.gz.
2021-05-17 17:00:17,779::pyp2rpm.convertor::INFO::Getting metadata from setup.py using SetupPyMetadataExtractor.
2021-05-17 17:00:17,779::pyp2rpm.convertor::WARNING::Dnf module not found, please dnf install python3-dnf to improve accuracy of name conversion.
2021-05-17 17:00:17,779::pyp2rpm.convertor::DEBUG::Using NameConvertor to convert names of the packages.
2021-05-17 17:00:17,803::pyp2rpm.metadata_extractors::INFO::Running extract_dist command with: /usr/bin/python2
2021-05-17 17:00:18,108::pyp2rpm.name_convertor::DEBUG::Converting name: ds-repltest to rpm name, version: None.
2021-05-17 17:00:18,108::pyp2rpm.name_convertor::DEBUG::Rpmized name of ds-repltest: python-ds-repltest.
2021-05-17 17:00:18,109::pyp2rpm.dependency_parser::DEBUG::Dependencies from setup.py: ['PyYAML>=5.2', 'systemd-python>=234', 'Flask>=0.10.1', 'python-ldap>=3.1.0', 'waitress>=0.8.9'] runtime: True.
2021-05-17 17:00:18,115::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: PyYAML>=5.2 runtime: True.
2021-05-17 17:00:18,115::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'PyYAML', '{name} >= 5.2']].
2021-05-17 17:00:18,115::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: systemd-python>=234 runtime: True.
2021-05-17 17:00:18,115::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'systemd-python', '{name} >= 234']].
2021-05-17 17:00:18,116::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: Flask>=0.10.1 runtime: True.
2021-05-17 17:00:18,116::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'Flask', '{name} >= 0.10.1']].
2021-05-17 17:00:18,116::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: python-ldap>=3.1.0 runtime: True.
2021-05-17 17:00:18,116::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'python-ldap', '{name} >= 3.1']].
2021-05-17 17:00:18,116::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: waitress>=0.8.9 runtime: True.
2021-05-17 17:00:18,116::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['Requires', 'waitress', '{name} >= 0.8.9']].
2021-05-17 17:00:18,116::pyp2rpm.dependency_parser::DEBUG::Dependencies from setup.py in rpm format: [['Requires', 'PyYAML', '{name} >= 5.2'], ['Requires', 'systemd-python', '{name} >= 234'], ['Requires', 'Flask', '{name} >= 0.10.1'], ['Requires', 'python-ldap', '{name} >= 3.1'], ['Requires', 'waitress', '{name} >= 0.8.9']].
2021-05-17 17:00:18,116::pyp2rpm.name_convertor::DEBUG::Converting name: PyYAML to rpm name, version: 2.
2021-05-17 17:00:18,116::pyp2rpm.name_convertor::DEBUG::Rpmized name of PyYAML: python-PyYAML.
2021-05-17 17:00:18,116::pyp2rpm.name_convertor::DEBUG::Converting name: systemd-python to rpm name, version: 2.
2021-05-17 17:00:18,116::pyp2rpm.name_convertor::DEBUG::Rpmized name of systemd-python: python-systemd.
2021-05-17 17:00:18,116::pyp2rpm.name_convertor::DEBUG::Converting name: Flask to rpm name, version: 2.
2021-05-17 17:00:18,116::pyp2rpm.name_convertor::DEBUG::Rpmized name of Flask: python-Flask.
2021-05-17 17:00:18,116::pyp2rpm.name_convertor::DEBUG::Converting name: python-ldap to rpm name, version: 2.
2021-05-17 17:00:18,117::pyp2rpm.name_convertor::DEBUG::Rpmized name of python-ldap: python-ldap.
2021-05-17 17:00:18,117::pyp2rpm.name_convertor::DEBUG::Converting name: waitress to rpm name, version: 2.
2021-05-17 17:00:18,117::pyp2rpm.name_convertor::DEBUG::Rpmized name of waitress: python-waitress.
2021-05-17 17:00:18,123::pyp2rpm.dependency_parser::DEBUG::Dependencies from setup.py: ['setuptools'] runtime: False.
2021-05-17 17:00:18,124::pyp2rpm.dependency_parser::DEBUG::Dependencies provided: setuptools runtime: False.
2021-05-17 17:00:18,124::pyp2rpm.dependency_parser::DEBUG::Converted dependencies: [['BuildRequires', 'setuptools', '{name}']].
2021-05-17 17:00:18,124::pyp2rpm.dependency_parser::DEBUG::Dependencies from setup.py in rpm format: [['BuildRequires', 'setuptools', '{name}']].
2021-05-17 17:00:18,124::pyp2rpm.name_convertor::DEBUG::Converting name: setuptools to rpm name, version: 2.
2021-05-17 17:00:18,124::pyp2rpm.name_convertor::DEBUG::Rpmized name of setuptools: python-setuptools.
2021-05-17 17:00:18,128::pyp2rpm.metadata_extractors::DEBUG::Skipping virtualenv metadata extraction.
2021-05-17 17:00:18,128::pyp2rpm.metadata_extractors::WARNING::Client is None, it was probably disabled
2021-05-17 17:00:18,128::pyp2rpm.convertor::DEBUG::Extracted metadata:
2021-05-17 17:00:18,130::pyp2rpm.convertor::DEBUG::{'build_deps': [['BuildRequires', 'python2-devel', '{name}'],
                ['BuildRequires', 'python-setuptools', '{name}']],
 'description': ' ds-repltest A 389ds replication checker. With this tool you '
                "can test your LDAP replication.At this time the tool doesn't "
                'autodiscover the replication topology. You must replicate it '
                'in the configuration file.ds-repltest read the configuration '
                'and it tests every supplier and consumer for the replication. '
                'Finally it writes a brief HTML summary and detailed syslog. '
                "Knowing the config file It's a YAML file, so you have to pay "
                'attention to spaces. The core part is INSTANCES. We suggest '
                'to name them with the same name of the Directory Server '
                'instances.Every instance has one or more suppliers, one or '
                'more consumers where you want to check the replication.',
 'dirname': 'ds-repltest-1.4',
 'doc_files': ['README.md'],
 'doc_license': ['LICENSE'],
 'has_bundled_egg_info': True,
 'has_extension': False,
 'has_packages': True,
 'has_pth': False,
 'has_test_suite': False,
 'home_page': 'https://github.com/falon/ds-repltest',
 'license': 'Apache License 2.0',
 'local_file': '/root/rpmbuild/SOURCES/ds-repltest-1.4.tar.gz',
 'md5': '',
 'name': 'ds-repltest',
 'packages': ['dsReplTest'],
 'pkg_name': 'python-ds-repltest',
 'py_modules': [],
 'python_versions': ['3'],
 'runtime_deps': [['Requires', 'python-Flask', '{name} >= 0.10.1'],
                  ['Requires', 'python-PyYAML', '{name} >= 5.2'],
                  ['Requires', 'python-ldap', '{name} >= 3.1'],
                  ['Requires', 'python-systemd', '{name} >= 234'],
                  ['Requires', 'python-waitress', '{name} >= 0.8.9']],
 'scripts': ['ds-repltest.py'],
 'source0': 'ds-repltest-1.4.tar.gz',
 'sphinx_dir': None,
 'srcname': None,
 'summary': 'LDAP Replication Check for 389ds',
 'version': '1.4'}
2021-05-17 17:00:18,130::pyp2rpm.convertor::WARNING::Template: epel7.spec was not found in /root/PycharmProjects/ds-repltest/epel7.spec using default template dir.
2021-05-17 17:00:18,187::pyp2rpm.convertor::INFO::Using default template: epel7.spec.
2021-05-17 17:00:18,265::pyp2rpm.bin::DEBUG::Convertor: <pyp2rpm.convertor.Convertor object at 0x7f4df9720eb0> succesfully converted.
2021-05-17 17:00:18,266::pyp2rpm.bin::DEBUG::Printing specfile to stdout.
2021-05-17 17:00:18,266::pyp2rpm.bin::DEBUG::Specfile printed.
2021-05-17 17:00:18,266::pyp2rpm.bin::INFO::That's all folks!```
falon commented

021-05-17 16:58:48,634::pyp2rpm.convertor::WARNING::Dnf module not found, please dnf install python3-dnf to improve accuracy of name conversion.

uhm... I could suspect that python38 in EL8 doesn't support python3-dnf and this could affect what I see. I can't be sure, but if it is true, it could be an environment issue...

I think this is addressed in the latest pyp2rpm.

These should never be written as "python3-" dependencies. These should always be be written as "python%{python3_pkgversion}-" dependencies, for consistency and backwards compatibility.