Skip to content

Add suppress_context_exit to RegisteredService #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lewicki
Copy link

@lewicki lewicki commented Jul 2, 2025

Summary

As discussed in #123. I added suppress_context_exit to RegisteredService. I still need to add tests and update docs. Sharing the initial version now.
I hoped to not have to change anything not related, but I needed RegisteredService here and there so I'm passing it instead of its name and I'm storing it in _instantiated to prevent additional lookups.

Pull Request Check List

  • Typos aside (please, always submit typo fixes!), I understand that this pull request may be closed in case there was no previous discussion.
  • Do not open pull requests from your main branch – use a separate branch!
    • There's a ton of footguns waiting if you don't heed this warning. You can still go back to your project, create a branch from your main branch, push it, and open the pull request from the new branch.
    • This is not a pre-requisite for your pull request to be accepted, but you have been warned.
  • Added tests for changed code.
    • The CI fails with less than 100% coverage.
  • New APIs are added to our typing tests at https://github.com/hynek/svcs/blob/main/tests/typing/.
  • Updated documentation for changed code.
    • New functions/classes have to be added to docs/core-concepts.md or one of the integration guides by hand.
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
      • The next version is the second number in the current release + 1. The first number represents the current year. So if the current version on PyPI is 23.1.0, the next version is gonna be 23.2.0. If the next version is the first in the new year, it'll be 24.1.0.
  • Documentation in .rst and .md files is written using semantic newlines.
  • Changes (and possible deprecations) are documented in the changelog.
  • Consider granting push permissions to the PR branch, so maintainers can fix minor issues themselves without pestering you.

@hynek
Copy link
Owner

hynek commented Jul 8, 2025

aww man it looked so simple on paper :D

anyhow looks fine on a first scan except for my comment – pls write tests and see if we've missed anything and more edge cases pop up.

@lewicki lewicki force-pushed the suppress_context_exit branch from bbbc7fb to fcf892b Compare July 16, 2025 22:18
@lewicki lewicki force-pushed the suppress_context_exit branch from fcf892b to f0b200e Compare July 16, 2025 22:24
@lewicki lewicki force-pushed the suppress_context_exit branch from 6190d90 to 16378eb Compare July 16, 2025 22:44
@lewicki
Copy link
Author

lewicki commented Jul 16, 2025

Do you know why mypy is complaining? I don't see the problematic comment.

@hynek
Copy link
Owner

hynek commented Jul 27, 2025

Do you know why mypy is complaining? I don't see the problematic comment.

yeah this is not your fault.

they flip-flopped with their type hints (c.f. f6c0019)

Increasingly it looks like we’ll have to switch to a fully locked dev environment like I have with attrs. The reliance on type hints makes everything super janky. :(

I’ll fix it.

@lewicki
Copy link
Author

lewicki commented Aug 6, 2025

Getting over most of my holidays ;)
@hynek Should I update docs as well, or you prefer doing it by yourself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants