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

Feature request: adding files without a prefix in the ZIP archive #1

Closed
gwerbin opened this issue Jan 10, 2023 · 2 comments
Closed

Comments

@gwerbin
Copy link

gwerbin commented Jan 10, 2023

Thanks for the useful Hatch plugin!

It would be very useful if we could pass a null "root path" for the ZIP archive, thereby disabling the filename prefix for archive members.

That is, if I have the following project:

src/
  a.py
  b.py
  c.py

would like to be able to write install-name = '' and sources = [ 'src' ] and obtain the following archive members:

a.py
b.py
c.py
MANIFEST.json

Currently this can be achieved by setting install-name = '.' in the plugin config, but this seems somewhat dependent on undocumented behaviors of the ZipFile class and the unzip utility.

Here is my (not-yet-tested) patch to implement explicit support for install-name = '': master...gwerbin:hatch-zipped-directory:support-null-install-name

If you're interested, I can try working this into the test suite, although it might be a little tricky given the current fixture setup. Also happy to consider alternative designs.

dairiki added a commit that referenced this issue Jan 10, 2023
Thanks to @gwerbin (see #1)
@dairiki
Copy link
Owner

dairiki commented Jan 10, 2023

@gwerbin Thank you for the suggestion and patch!

I've implemented this in this commit, more or less following your patch. I've just published release 0.1.0b2 which includes this.

@dairiki dairiki closed this as completed Jan 10, 2023
@gwerbin
Copy link
Author

gwerbin commented Jan 10, 2023

Nice, this is going to be really useful for me!

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

No branches or pull requests

2 participants