Skip to content

gh-99138: Isolate _zoneinfo #99218

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

Merged
merged 30 commits into from
Feb 15, 2023
Merged

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Nov 7, 2022

@erlend-aasland erlend-aasland changed the title gh-99138: Isolate zoneinfo gh-99138: Isolate _zoneinfo Nov 7, 2022
@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Nov 7, 2022

@pganssle I can break this up in several PRs; let me know what works best for you.

@@ -701,28 +801,37 @@ zoneinfo_reduce(PyObject *obj_self, PyObject *unused)
return rv;
}

/*[clinic input]
@classmethod
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need the defining_class converter for @classmethods?

@erlend-aasland erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 7, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 573aec1 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 7, 2022
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

You've beat me to it :)
Thanks!

@erlend-aasland
Copy link
Contributor Author

You've beat me to it :)
Thanks!

Sorry, I was not aware that you were working on a PR; I should've asked first.

@erlend-aasland erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 15, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 6e69e93 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 15, 2022
Copy link
Contributor

@kumaraditya303 kumaraditya303 left a comment

Choose a reason for hiding this comment

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

LGTM

@erlend-aasland
Copy link
Contributor Author

Thanks for the review, Kumar. I'll wait until Monday with landing this, to give @pganssle a chance to chime in.

@erlend-aasland erlend-aasland self-assigned this Feb 8, 2023
Copy link
Member

@pganssle pganssle left a comment

Choose a reason for hiding this comment

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

One minor suggestion here, and it's mostly a documentation thing, otherwise this looks good to me!

Thanks for doing this Erland, sorry for the long delay in reviewing.

Hopefully the tests I put in place for the cache stuff are robust 😅 That kind of thing is hard to test well, and this is the kind of change that really needs it 😛

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@erlend-aasland
Copy link
Contributor Author

Hopefully the tests I put in place for the cache stuff are robust 😅 That kind of thing is hard to test well, and this is the kind of change that really needs it 😛

Yeah, I know, changes like this need really good test suites! I'll take a look at the coverage before and after the change, just to see that we've at least got all the branches covered.

Thanks for the review 🙂

@erlend-aasland
Copy link
Contributor Author

Good to go, @pganssle?

Copy link
Member

@pganssle pganssle left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks again for doing this @erlend-aasland and thanks for doing the heavy lifting in the review @kumaraditya303

@pganssle
Copy link
Member

I don't think it needs to block this particular PR, but is the subinterpreter work advanced enough that we can add an actual test that the module isolation worked yet?

I'm guessing the answer is no because we need to import datetime to get the timedeltas, and datetime is not isolated?

@erlend-aasland
Copy link
Contributor Author

I don't think it needs to block this particular PR, but is the subinterpreter work advanced enough that we can add an actual test that the module isolation worked yet?

Subinterpreter testing is not optimal yet. There's some machinery in test_embed / Programs/_testembed.c. See also #98627. Thanks for bringing that up.

I'm guessing the answer is no because we need to import datetime to get the timedeltas, and datetime is not isolated?

Correct, _datetime is not isolated yet; I've got a fairly up to date proof-of-concept patch for it, though.

@erlend-aasland
Copy link
Contributor Author

Thanks again for the reviews, Kumar and Paul; highly appreciated.

@erlend-aasland erlend-aasland merged commit c1ce0d1 into python:main Feb 15, 2023
@erlend-aasland erlend-aasland deleted the isolate-zoneinfo branch February 15, 2023 21:58
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.

5 participants