Replace, fork or copy sharedmock

Offen
#549 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
testing

Rechercherichtung

Start with the dependency entry in requirements/local.in and its use in documentcloud/common/serverless/tests/test_error_handling.py. Inspect how sharedmock supports mocks across process boundaries, then compare the options in the issue: fork it, bring the helpers into the codebase, or find a replacement. Done means those tests no longer depend on the unmaintained third-party repository and still cover the expected behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

dependencies

sharedmock is installed from a third-party git repo (elritsch/python-sharedmock) that hasn't been updated since 2017.
https://github.com/MuckRock/documentcloud/blob/fe9be7f12d525eb90defbe7035a4bcd45aa2b6a1/requirements/local.in#L15

In my PR to get us to python 3.15, I've pinned it to a specific commit to keep the expected behavior in case a commit gets pushed down the road which breaks expected behavior out from underneath us as it is currently unpinned on master.
https://github.com/elritsch/python-sharedmock@f12c7beb770bc67cccd52a25631e2ceee462a34a#egg=sharedmock

I avoided the PyPi distributed sharedmock because although the author is listed as Elmar Ritsch, it was packaged by other developers who don't have a ton of history on PyPi: https://pypi.org/project/sharedmock/. It's also out of date.

sharedmock is only used in documentcloud/common/serverless/tests/test_error_handling.py, for mocks that work across process boundaries. I'm not sure how to fix this, so I've left it for follow up cleanup.

If we absolutely need it, we can fork it or if it's small enough we can include the helpers in the code base..otherwise look for a replacement.

This is good cleanup follow up after the Python upgrade.

Vorherrschende Sprache
Python
Sterne
55
Forks
10
Ø Merge
1 T. 22 Std.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus MuckRock/documentcloud

Alle Issues in MuckRock/documentcloud

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.