FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Incorporate pytest-gitlab plugin back into python-gitlab · Issue #3046 · python-gitlab/python-gitlab · GitHub

Repository navigation

Incorporate pytest-gitlab plugin back into python-gitlab #3046

Description

Someone appears to have extracted our setup & fixtures for pytest and repackaged it all as a pytest plugin on pypi.org:

https://pypi.org/project/pytest-gitlab/

I was unaware of this but I have wanted something like this for years - i.e. expose our fixtures as a plugin to make them reusable in downstream projects. See https://gitlab.com/marge-org/marge-bot/-/merge_requests/479#note_2225265620 for a recent example use case.

I (and probably others @JohnVillalovos 😅 ) spent quite a few weekends adding and improving this pytest setup so IMO it would be nice to see the benefits of this shared here and also make it more discoverable for our users rather than have it a separate package that users might not trust if they can't recognize or see the sources.

I can't find the source for the project (seems to not be openly available though it reuses LGPL, purely by looking at the sdist). But I'll try to reach out to the author and see if we can incorporate it here. Otherwise the fixtures will almost definitely diverge anyway.

Activity

  1. JohnVillalovos commented on Nov 25, 2024

    Member

    I hope it doesn't have some malware in the package!

    The source should be in the *.whl and *.tar.gz: https://pypi.org/project/pytest-gitlab/0.3.1/#files

  2. nejch commented on Nov 25, 2024

    MemberAuthor

    I found the sources now: https://gitlab.com/thht_science_software/pytest-gitlab

    All looks good and in good faith. I just think it would make sense to have at least parts of that upstreamed back here and exposed along with the package. I've seen some libraries do this as well, providing their pytest plugins as a kind of public API.

    Will reach out but not really a priority just yet :)

  3. JohnVillalovos commented on Nov 25, 2024

    Member

    Yeah we could create a project under the namespace here. Maybe call it pytest-python-gitlab? or python-gitlab-pytest?

  4. nejch commented on Nov 25, 2024

    MemberAuthor

    Sentry for example has sentry.testutils inside the package itself with a similar idea, so if we want to keep it lightweight we could even just move the reusable fixtures from our conftest and tests/ subdirs to gitlab/testing and then they get published along the package if add an entrypoint:

    https://docs.pytest.org/en/stable/how-to/writing_plugins.html#making-your-plugin-installable-by-others

    I've seen this pattern elsewhere but can't find other examples right now. But it would be the easiest for us and maybe also for the users (just one package to install).

    We used to pack all our unit tests inside gitlab/ before migrating to pytest, so I'm sure people won't complain about a few extra KB 😀

  5. nejch commented on Nov 26, 2024

    MemberAuthor

    Hey @thht 👋 I think that's you behind the pytest-gitlab project right?

    Would you be interested in upstreaming some of the pytest plugin back here as part of the package? There's no rush and it's not a priority, just wanted to let you know before the projects diverge too much 🙇

  6. thht commented on Nov 26, 2024

    Hello there!
    Yes, that's me. And yes, it would be great to get the code upstream. I'm a bit short on time right now. I can either start a branch and PR beginning of next year or help/contribute if somebody else started the effort.

    And the project basically does what you describe in your comment plus it adds some convenience things.

  7. nejch commented on Nov 26, 2024

    MemberAuthor

    That's perfect @thht, thanks. I'll also probably be on vacation around that time and will be back mid-January so we can follow up then.

  8. ptalbert commented on Dec 19, 2025

    Hi. I tried to address this in #3313. Please let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL