A YAML based file package manifest framework for defining packages.
Project description
A Python 3 framework for creating and maintaining a generalised manifest of files inspired by the Python MANIFEST.in. The framework could be used as the basis of a packaging tool to define the files needed for distribution of the package.
1 Main Features
YAML based file format
Manifest include & exclude actions using Unix globs, ** (recursive) and *
2 Installation
The simplest way to acquire package_manifest is using pip.
pip install package-manifest
3 Getting Started
The manifest YAML file is simply a list of the include and exclude actions to comprise the formulation of a list of files. Each include/exclude action can take multiple Unix-style globs per the Python standard library.
---
# Python MANIFEST.in is used as a reference:
# https://docs.python.org/3.6/distutils/sourcedist.html
#
manifest:
# include the files ./LICENSE and ./README.md
- include:
- LICENSE
- README.md
# exclude ./*.orig files
- exclude:
# NOTE: have to be careful to quote values starting with a wildcard (*) because
# it has special meaning in YAML syntax.
- "*.orig"
# include *.h & *.c files anywhere in the ./include directory and its subdirectories.
- include:
- include/**/*.h
- include/**/*.c
# exclude all files and subdirectories in the ./temp directory.
- exclude:
- temp/**/*
# include files called "Makefile" anywhere in the tree.
- include:
- "**/Makefile"
# exclude files matching *.txt, *.tmp, test anywhere in the tree.
- exclude:
- "**/*.txt"
- "**/*.tmp"
- "**/test"
# remove the ./bin directory and all files and subdirectories.
- exclude:
- bin/**/*
# add the ./src directory and all files and subdirectories.
- include:
- src/**/*
Using the manifest file is simply a matter of importing the library and using the from_file class method to import the operations and apply them to the specified root directory of the directory tree from which to extract files.
from package_manifest import Manifest
this_manifest = Manifest.from_file( "manifest.yml" )
manifest_files = this_manifest.apply(".")
manifest_files now contains a Python set of the file names from the current working directory '.' and its subdirectories that have been filtered by the sequential include and exclude actions specified in the file manifest.yml.
4 DOI Archive
0.2.0 |
|
0.3.0 |
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
File details
Details for the file package_manifest-1.0.0.post7.tar.gz
.
File metadata
- Download URL: package_manifest-1.0.0.post7.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.1 requests/2.26.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c96989a84a7d1580432996aa48a5d15807ff8a1250e1ab992668c4d4b9b2900 |
|
MD5 | 3fcb573116e384e67d01fd7784403c5c |
|
BLAKE2b-256 | dfce7a3a3b882e952667f250f174fb746eb31c7bb260285c1049a7b47606a6b3 |
File details
Details for the file package_manifest-1.0.0.post7-py3-none-any.whl
.
File metadata
- Download URL: package_manifest-1.0.0.post7-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.1 requests/2.26.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb2f4b234b6bd15b3e4af24b04a6dd5023802b2ae8d94d3c21d613cc2193409d |
|
MD5 | bd9ce76c9f112f16b2b57d71635b6529 |
|
BLAKE2b-256 | b868ad9747233a7e86754d752b564e1b22c214431c5d17b1889d4834ba8c95ca |