pytest-console-scripts icon indicating copy to clipboard operation
pytest-console-scripts copied to clipboard

Fedora package for pytest-console-scripts

Open ansasaki opened this issue 7 years ago • 15 comments

I could not find a Fedora package for pytest-console-scripts. Can you package it for Fedora? A rpm spec file can be easily obtained using pyp2rpm which creates a spec file from the pip package.

If you are not interested, I can package it in Fedora, with your permission.

depends on #8

ansasaki avatar Jun 18 '18 09:06 ansasaki

I'm interested in figuring out how Fedora packaging works but I'm afraid I won't get to it very soon. It would be lovely if you do it.

kvas-it avatar Jun 18 '18 10:06 kvas-it

To become a package maintainer in Fedora, you can follow the instructions on this wiki page. The guidelines for Fedora packages can be found here.

I am happy to help packaging your project.

ansasaki avatar Jun 18 '18 11:06 ansasaki

Hi, Anderson.

As I said, at the moment I don't have time to work on this. I'm happy to accept pull requests, in fact I'd be grateful if you make everything necessary for pytest-console-scripts to be a Fedora package, but if you leave this to me it probably won't happen in the foreseeable future. Sorry if this is disappointing.

BTW, do you know if other pytest plugins have their packages in Fedora? I'm not a Fedora user, and normally install Python packages via Pip (or Tox, when it comes to pytest plugins :), so it's a bit of new territory for me.

All the best, Vasily

kvas-it avatar Jun 18 '18 13:06 kvas-it

Ok, I will open some pull request for the missing bits.

There are some pytest plugins packaged for Fedora. A quick search gave me: python3-pytest-vcr python3-pytest-cov python3-pytest-mock python3-pytest-pep8 python3-pytest-spec python3-pytest-xdist python3-pytest-cache python3-pytest-watch python3-pytest-forked python3-pytest-runner python3-pytest-shutil python3-pytest-flakes python3-pytest-httpbin python3-pytest-relaxed python3-pytest-tornado python3-pytest-asyncio python3-pytest-testmon python3-pytest-timeout python3-pytest-catchlog python3-pytest-beakerlib python3-pytest-multihost python3-pytest-virtualenv python3-pytest-capturelog python3-pytest-sourceorder python3-pytest-faulthandler python3-pytest-fixture-config

ansasaki avatar Jun 18 '18 13:06 ansasaki

Thank you. Indeed, it seems like packaging pytest plugins as OS packages is a thing.

kvas-it avatar Jun 18 '18 14:06 kvas-it

@kvas-it Can you repack it for pip including the tests and LICENSE file?

ansasaki avatar Jun 18 '18 17:06 ansasaki

I've created a pull request #10 (more or less copying the approach from https://github.com/pytest-dev/pytest-cov) -- does this look about right?

kvas-it avatar Jun 19 '18 13:06 kvas-it

Thanks for pushing it to pip! Now the build runs the tests, but fail in the same manner as reported in #11. This is the build Log.

ansasaki avatar Jun 20 '18 16:06 ansasaki

Yeah, the problem is that the tests of pytest-console-scripts install a test package (TP) into the python environment that runs the tests and then run TP's tests that execute console scripts declared by TP's setup.py. This approach works fine for disposable virtualenvs that Tox provides, but is not appropriate when running under system-wide python. It seems like we'd need to create a temporary virtualenv specifically for testing and use that to run the inner tests. I guess if we can make the temporary virtualenv inherit pytest and pytest-console-scripts from the python installation that runs the outer tests, things would work out. I can try to change this tests this way. Or maybe you have better ideas?

kvas-it avatar Jun 21 '18 08:06 kvas-it

I'll also ask on the pytest-dev mailing list for the best practice regarding the setup of nested tests.

kvas-it avatar Jun 21 '18 08:06 kvas-it

Using a temporary virtualenv to run the tests seems a way to fix them. I am not sure how well the Fedora build environment would handle the setup of such virtualenv, though.

I will try to take a look into the tests too.

ansasaki avatar Jun 21 '18 16:06 ansasaki

How do other modules solve this?

cryptomilk avatar Jun 21 '18 18:06 cryptomilk

It seems other pytest plugins are using pytest-virtualenv to generate a disposable virtualenv in their tests.

ansasaki avatar Jun 22 '18 09:06 ansasaki

Thanks, Anderson, this seems like a good idea. I will check if I can install packages without hitting the internet (this would be undesirable for the unit tests IMO) and use this if it works.

kvas-it avatar Jun 22 '18 16:06 kvas-it

@ansasaki #11 is solved and I have published a new version to pypi. Sorry for the long wait.

kvas-it avatar Oct 01 '18 14:10 kvas-it

I've confirmed that Fedora does package this module: https://packages.fedoraproject.org/pkgs/python-pytest-console-scripts/python3-pytest-console-scripts/

It's up to packagers downstream to provide ports of open-source Python packages. Any issues preventing pytest-console-scripts from being packaged should be reported here.

HexDecimal avatar May 24 '23 04:05 HexDecimal