Skip to main content

A YAML based file package manifest framework for defining packages.

Project description

pipeline status coverage report

PyPI Version DOI v0.3.0

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

DOI v0.2.0

0.3.0

DOI v0.3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

package_manifest-1.0.0.post7.tar.gz (13.4 kB view hashes)

Uploaded Source

Built Distribution

package_manifest-1.0.0.post7-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page