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

Create modular packages for zipfile and test_zipfile #98098

Closed
jaraco opened this issue Oct 8, 2022 · 5 comments
Closed

Create modular packages for zipfile and test_zipfile #98098

jaraco opened this issue Oct 8, 2022 · 5 comments
Assignees
Labels
type-feature A feature request or enhancement

Comments

@jaraco
Copy link
Member

jaraco commented Oct 8, 2022

I'm about to embark on once again syncing changes from zipp to zipfile.

Historically, I've manually copied the contents of the cpython branch to the relevant files in this repository, but that process is error prone (because it involves syncing a whole file to a portion of another file).

I'd like to instead create packages for zipfile and test_zipfile, such that the functionality that's synced with zipp can be kept separate from other zipfile functionality. Moreover, late versions of zipp bring in extra dependencies so a package can also serve as a home to vendor such functionality.

I'm not suggesting to change the user's signature at all. The names will still be presented through the zipfile module unchanged.

Linked PRs

@jaraco jaraco added the type-feature A feature request or enhancement label Oct 8, 2022
jaraco added a commit to jaraco/cpython that referenced this issue Oct 8, 2022
jaraco added a commit to jaraco/cpython that referenced this issue Oct 8, 2022
@jaraco
Copy link
Member Author

jaraco commented Oct 8, 2022

I tried moving most of zipfile.py to zipfile/_core.py but that caused problems with all of the global constants in that file, many of which are treated as mutable (at least for tests).

jaraco added a commit to jaraco/cpython that referenced this issue Oct 8, 2022
jaraco added a commit to jaraco/cpython that referenced this issue Oct 8, 2022
jaraco added a commit to jaraco/cpython that referenced this issue Oct 8, 2022
jaraco added a commit to jaraco/cpython that referenced this issue Nov 26, 2022
jaraco added a commit to jaraco/cpython that referenced this issue Nov 26, 2022
jaraco added a commit that referenced this issue Nov 26, 2022
* gh-98098: Move zipfile into a package.

* Moved test_zipfile to a package

* Extracted module for test_path.

* Add blurb

* Add jaraco as owner of zipfile.Path.

* Synchronize with minor changes found at jaraco/zipp@d9e7f4352d.
jaraco added a commit that referenced this issue Nov 26, 2022
* gh-98098: Move zipfile into a package.

* Moved test_zipfile to a package

* Extracted module for test_path.

* Add blurb

* Add jaraco as owner of zipfile.Path.

* Synchronize with minor changes found at jaraco/zipp@d9e7f4352d.

* gh-98108: Sync with zipp 3.9.1 adding pickleability.
@hauntsaninja
Copy link
Contributor

Looks like this can be closed, but not touching it since I see it was assigned to Yhg1s and I don't know what that means

@jaraco jaraco closed this as completed Feb 19, 2023
@ilia1243
Copy link

ilia1243 commented Dec 1, 2023

Hello, looks like this issue has lead to warning <frozen runpy>:128: RuntimeWarning: 'zipfile.__main__' found in sys.modules after import of package 'zipfile', but prior to execution of 'zipfile.__main__'; this may result in unpredictable behaviour when using https://docs.python.org/3/library/zipfile.html#command-line-interface

@gpshead
Copy link
Member

gpshead commented Dec 1, 2023

please file a new issue if you believe there is a bug with instructions for how to reproduce it.

@hauntsaninja
Copy link
Contributor

hauntsaninja commented Dec 1, 2023

Thanks ilia1243 for reporting! I opened an issue at #112578 and a PR at #112579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants