A custom builder to build zipped directories
Project description
hatch-zipped-directory
This is a Hatch plugin that provides a custom builder to support building zip archives for quasi-manual installation into various foreign package installation systems. (Specifically, I use this for packaging Inkscape extensions and symbols libraries, but it may be useful in other contexts.)
The builder creates a zip archive. All the contents of the zip
archive will be included under a single specific top-level directory.
The default name of the top-level directory is a file-name-safe
version of the project name, however the name of the directory may be
configured by setting the install-name
key in the target-specific
configuration section.
In addition to whatever files are selected for inclusion in the archive via Hatch’s regular build configuration settings, any configured project README and license files will be included in the top level of the install directory within the zip archive.
As well, a METADATA.json
file containing the project metadata in
JSON format (as described in
PEP566)
will be included in the top level of the install directory within the
zip archive.
Example
Assume a project source directory looking something like:
.
├── pyproject.toml
├── LICENSE.txt
├── README.md
├── src
│ ├── subdir
│ │ ├── data.txt
│ │ └── more-code.py
│ └── my-code.py
└── tests
└── test_foo.py
Where pyproject.toml
looks like:
[build-system]
requires = [
"hatchling",
"hatch-zipped-directory",
]
build-backend = "hatchling.build"
[project]
name = "test-project"
version = "0.42"
[tool.hatch.build.targets.zipped-directory]
install-name = "org.example.test"
sources = [
"/src",
]
Then, running
hatch build --target zipped-directory
will build a zip archive named dist/test_project-0.42.zip
with the following
structure:
.
└── org.example.tests
├── LICENSE.txt
├── METADATA.json
├── README.md
├── my-code.py
└── subdir
├── data.txt
└── more-code.py
Author
Jeff Dairiki dairiki@dairiki.org
License
hatch-zipped-directory
is distributed under the terms of the
MIT license.
Changes
0.1.0b1 (2022-10-07)
Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hatch_zipped_directory-0.1.0b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ae447e26d80766688af52ec44d0f8c1e5b952b6982d1b739d999176dcd1403e |
|
MD5 | 1a611477efcc0c945ae8a175c0b9fc12 |
|
BLAKE2b-256 | a8df6810ccc6f3dbce0ee0cb347e725aa9619b13763b51bf335424f2bcb86078 |
Hashes for hatch_zipped_directory-0.1.0b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0714f81c01a89a0fc6487092b50a1b661414c8eb4b748d8e1a22fdd41905aefe |
|
MD5 | 63b5f807e2f71dcf27a33d5b94aa3853 |
|
BLAKE2b-256 | 13f6073e3692457f33900d8f5c688eda4006722192c928d1ba58c895fc0fe70f |