kvas-it / pytest-console-scripts

Pytest plugin for testing console scripts
MIT License
78 stars 14 forks source link

Fedora package for pytest-console-scripts #7

Closed ansasaki closed 1 year ago

ansasaki commented 6 years ago

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

kvas-it commented 6 years ago

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.

ansasaki commented 6 years ago

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.

kvas-it commented 6 years ago

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

ansasaki commented 6 years ago

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

kvas-it commented 6 years ago

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

ansasaki commented 6 years ago

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

kvas-it commented 6 years ago

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?

ansasaki commented 6 years ago

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.

kvas-it commented 6 years ago

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 commented 6 years ago

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

ansasaki commented 6 years ago

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.

cryptomilk commented 6 years ago

How do other modules solve this?

ansasaki commented 6 years ago

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

kvas-it commented 6 years ago

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 commented 6 years ago

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

HexDecimal commented 1 year ago

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.