mamba-org / powerloader

BSD 3-Clause "New" or "Revised" License
15 stars 9 forks source link

Context is not a Singleton anymore. #96

Closed Klaim closed 2 years ago

Klaim commented 2 years ago

Now powerloader::Context can only have one instance live at any time, but it is not accessible through global access. This helps for testing, avoiding static-init/delete-fiasco and constraining access to read-only of that instance when it make sense.

Note that right now this relies on https://github.com/mamba-org/powerloader/pull/95 being merged first which is why it have the same commits as a base. I'll set this PR as non-draft once that PR is merged.

Klaim commented 2 years ago

95 is merged, rebased over it

wolfv commented 2 years ago

I ran pre-commit run --all to get the linter green :)

Klaim commented 2 years ago

Ah yes it wasnt working for me before your change in the pre-commit config, I forgot to do it again afterwards. Thanks!