Skip to content
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

Clarify container.remove() behaviour #2235

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

mathbunnyru
Copy link
Member

Describe your changes

Issue ticket if applicable

Checklist (especially for first-time contributors)

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests
  • I will try not to use force-push to make the review process easier for reviewers
  • I have updated the documentation for significant changes

@@ -39,9 +39,8 @@ def __exit__(
) -> None:
assert self.container is not None
LOGGER.info(f"Removing container {self.container.name} ...")
if self.container:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert above means that this if is always true

Comment on lines +95 to +100
if self.container is None:
LOGGER.info("No container to remove")
else:
LOGGER.info(f"Removing container {self.container.name} ...")
self.container.remove(force=True)
LOGGER.info(f"Container {self.container.name} removed")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just better logs.

There is some sort of code duplication between DockerRunner and TrackedContainer, but for now let's keep tagging/ and tests dir completely independent of each other.

@mathbunnyru mathbunnyru merged commit 18e09a7 into jupyter:main Feb 22, 2025
55 checks passed
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.

1 participant