fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
125 stars 39 forks source link

Unnecessery parsing of test_requires #61

Closed xsuchy closed 7 years ago

xsuchy commented 8 years ago

I run:

pyp2rpm tempest-lib

which results in:

BuildRequires:  sphinx < 1.3
BuildRequires:  sphinx >= 1.1.2

as this is impossible to satisfy in fedora-rawhide, I investigated from where this comes.

It is put there because tempest-lib has test-requirements.txt, which a) outdated b) actually not needed, because produced spec file does not have any %check section. a) is beyond pyp2rpm, but b) should be addressed by pyp2rpm.

It comes from:

    def build_deps(self):
        build_requires = self.get_requires(['build_requires', 'test_requires'])

where test_requires are added unconditionally. It should be added only if there are some tests.

xsuchy commented 8 years ago

Hmm that will be not enough. These test requirements get there just after

  extract_distribution.run_setup(setup_py, 'bdist_rpm')

so the change will be probably much harder.

mcyprian commented 8 years ago

^ This commit shouldn't be here I wrote number 61 instead of 62 to the commit message.

mcyprian commented 7 years ago

After refactoring of metadata_extractors %check section is included each time test_requires are not empty or 'test_suite' is specified in setup.py script. Unfortunately we can't find more reliable way to determine if package contains tests or not.