Skip to content

Conversation

@sbraz
Copy link
Contributor

@sbraz sbraz commented Jan 3, 2023

Hi,
nose is no longer maintained, see
nose-devs/nose#1099 (comment).

This bug was initially submitted here: https://bugs.gentoo.org/878695.

This commit switches to pytest.

Amongst the changes, here are the most relevant ones:

  • Create a conftest.py that contains fixtures.
  • Replace nose.with_setup with yield fixtures.
  • Use pytest.skip instead of print and nose.plugins.skip.SkipTest.
  • Use pytest.mark.slow instead of nose.plugins.attrib.attr("slow").
  • Use pytest.mark.parametrize instead of parameterized, simplify parametrized tests that use both shell and inverse_order.
  • Update Travis config.
  • Update SConscript.
  • Update documentation.

@sbraz
Copy link
Contributor Author

sbraz commented Feb 11, 2023

@cebtenzzre would it please be possible to look into this?

@cebtenzzre
Copy link
Contributor

I know that nose is unmaintained, but it works fine on the distro I use (Arch Linux). I would like to replace it with something like nose2 or pytest in the future, and I will consider your changes. But it is not a priority at the moment, and I've made a lot of changes to the tests locally that would conflict with this PR.

@sbraz
Copy link
Contributor Author

sbraz commented Jul 26, 2023

@cebtenzzre any chance you could look into this at one point? If I were to rebase this on master or develop (not sure I will because I already spent hours on this PR), would you merge it?

@cebtenzzre
Copy link
Contributor

I haven't been spending much time on rmlint lately, but I would still want to push more of my own changes which include additional tests before I merge this PR.

@sbraz
Copy link
Contributor Author

sbraz commented Feb 28, 2024

Hi @cebtenzzre, FYI Gentoo is about to drop the package because it's one of the few that haven't migrated away from nose, see https://bugs.gentoo.org/878695#c5.

It saddens me as I put a lot of hours into packaging it, making the test suite work, and creating this PR. I really liked using rmlint too. I still think pytest is the way to go and nose2 is not the best solution. If you think you can fix this in the coming weeks, that would be really nice and maybe I can add it back at some point.

@fermino
Copy link
Collaborator

fermino commented Dec 9, 2024

@sbraz Thanks a lot for this PR, I know it probably took quite some time to get all sorted out. It's sad to see the package was dropped from gentoo, and the AUR package in arch is going the same direction so I'm trying to avoid it. With some luck maybe the package in gentoo can be eventually restored :)

I know it might be a lot to ask, but if you happen to have the time, would you mind rebasing this PR against master?
We just merged support for github actions and added initial support for pytest.

I'm just realizing that in that MR I likely broke support for mount_bind_teardown_func, as the tests are not being executed as root, so we might have to look into that too.

Anyways, thanks again for the work here! :)

@sbraz
Copy link
Contributor Author

sbraz commented Dec 9, 2024

@fermino I'll try at some point, maybe it's not that much work. And I know Gentoo users miss the package.
I can't give an ETA though, it could be months before I want to dive into this. On which branch should I rebase the changes? Just to be sure I'm not missing anything?

@fermino
Copy link
Collaborator

fermino commented Dec 12, 2024

@sbraz Sure, no worries about it! If I happen to have some time to give it a look I will post any updates here.

As per this comment it should be master, at least for now. I'm not comfortable pushing anything to master that could pose a risk to user data (I'm barely starting to get to know the codebase), but this is only related to the tests so I think it would be a great idea in order to get the stable branch building properly in all distros.

As a side note, you might find #677 interesting, I haven't added support for gentoo as I'm not familiar with the building process, but if we can get nose sorted out I will add it so we can keep track of its state.

@a-detiste
Copy link

Same situation on Debian & derivatives for what it's worth. Only a handful of mostly unreleasable thing depending on Nose still. From users telemetry rmlint is top 2 just behind Debian own native toolbox git-buildpackage that has been fixed in git.

This GBP has a special status of "key package" (well it really ties the whole distro together). And Nose inherit transitively this property. So any day GBP author decides to upload his package will start an autoremoval counter for rmlint.

I don't know precisely how Ubuntu manage their fork.

@vassilit
Copy link
Collaborator

vassilit commented Mar 3, 2025

@a-detiste, thank you for trying to keep rmlint in Debian.

Is there any way we could still succeed to be included in trixie ?

@vassilit
Copy link
Collaborator

vassilit commented Mar 3, 2025

@fermino I'll try at some point, maybe it's not that much work. And I know Gentoo users miss the package. I can't give an ETA though, it could be months before I want to dive into this. On which branch should I rebase the changes? Just to be sure I'm not missing anything?

I would like to merge this for 2.10.3 that should go out a few weeks before Debian trixie soft-freeze. That would ease the situation on a lot of distributions, even if most of them have patched versions of nose, this transition is very welcome.

Do you mind if I edit your PR to make it mergeable to master ?

@RayOei
Copy link
Collaborator

RayOei commented Mar 3, 2025

Do you mind if I edit your PR to make it mergeable to master ?

This is already tied into #688 which I started looking into. But I am fine if you want to have a look as you seem to have more time available 😁

@vassilit
Copy link
Collaborator

vassilit commented Mar 3, 2025

This is already tied into #688 which I started looking into. But I am fine if you want to have a look as you seem to have more time available 😁

Hmm, #688 is a work-around to avoid running tests on the Python 3.12+ that introduces incompatibilities with nose. In fine, we want #603 merged to get rid of the nose dependency altogether.

@RayOei
Copy link
Collaborator

RayOei commented Mar 3, 2025

Oops... I meant #687

@sbraz
Copy link
Contributor Author

sbraz commented Mar 3, 2025

Do you mind if I edit your PR to make it mergeable to master ?

If you're asking me, sure, go ahead!

@vassilit
Copy link
Collaborator

vassilit commented Mar 5, 2025

I've saved your actual commit before rebase (soon, there are a lot of conflicts) in https://github.com/sahib/rmlint/tree/603_sbraz_replace_nose.

@vassilit
Copy link
Collaborator

vassilit commented Mar 5, 2025

Tests have been rebased to master, adapting the new tests that have been merged since the initial commit and functions that were moved to a different module.
The tests have been tested* on a reflink-capable FS.
@RayOei can you rebase your modifications on top of this commit ?
(*) (Should we write tests to test the test that tested those test ? :))

nose is no longer maintained, see
nose-devs/nose#1099 (comment).

This was initially submitted here: https://bugs.gentoo.org/878695.

This commit switches to pytest.

Amongst the changes, here are the most relevant ones:
* Create a conftest.py that contains fixtures.
* Replace nose.with_setup with yield fixtures.
* Use pytest.skip instead of print and nose.plugins.skip.SkipTest.
* Use pytest.mark.slow instead of nose.plugins.attrib.attr("slow").
* Use pytest.mark.parametrize instead of parameterized, simplify
  parametrized tests that use both `shell` and `inverse_order`.
* Update SConscript.
* Update documentation.

Co-developed-by: Vassili Tchersky <[email protected]>
@vassilit vassilit merged commit 79a1e6b into sahib:master Mar 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants