whey.additional_files

Parser for the additional-files option.

Classes:

AdditionalFilesEntry()

An abstract command in additional-files.

Exclude(patterns)

Exclude a single file, or multiple files with a pattern.

Include(patterns)

Include a single file, or multiple files with a pattern.

RecursiveExclude(path, patterns)

Recursively exclude files in a directory based on patterns.

RecursiveInclude(path, patterns)

Recursively include files in a directory based on patterns.

Functions:

from_entry(line)

Parse a MANIFEST.in-style entry.

class AdditionalFilesEntry[source]

Bases: ABC

An abstract command in additional-files.

Methods:

iter_files(directory)

Returns an iterator over files to be included or excluded by this command.

parse(parameters)

Parse the command’s parameters.

to_dict()

Returns a dictionary representation of the command entry.

abstract iter_files(directory)[source]

Returns an iterator over files to be included or excluded by this command.

Parameters

directory (PathPlus) – The project or build directory.

Return type

Iterator[PathPlus]

abstract classmethod parse(parameters)[source]

Parse the command’s parameters.

Parameters

parameters (str)

Return type

AdditionalFilesEntry

abstract to_dict()[source]

Returns a dictionary representation of the command entry.

Return type

Dict[str, Any]

class Exclude(patterns)[source]

Bases: whey.additional_files.AdditionalFilesEntry

Exclude a single file, or multiple files with a pattern.

Parameters

patterns (Iterable[str]) – Glob patterns.

Methods:

iter_files(directory)

Returns an iterator over files to be excluded by this command.

parse(parameters)

Parse the command’s parameters.

to_dict()

Returns a dictionary representation of the command entry.

Attributes:

patterns

Glob patterns (with complete paths from the project root)

iter_files(directory)[source]

Returns an iterator over files to be excluded by this command.

Parameters

directory (PathPlus) – The build directory.

Return type

Iterator[PathPlus]

classmethod parse(parameters)[source]

Parse the command’s parameters.

Parameters

parameters (str)

Return type

Exclude

patterns

Type:    List[str]

Glob patterns (with complete paths from the project root)

to_dict()[source]

Returns a dictionary representation of the command entry.

Return type

Dict[str, Any]

class Include(patterns)[source]

Bases: whey.additional_files.AdditionalFilesEntry

Include a single file, or multiple files with a pattern.

Parameters

patterns (Iterable[str]) – Glob patterns.

Methods:

iter_files(directory)

Returns an iterator over files to be included by this command.

parse(parameters)

Parse the command’s parameters.

to_dict()

Returns a dictionary representation of the command entry.

Attributes:

patterns

Glob patterns (with complete paths from the project root)

iter_files(directory)[source]

Returns an iterator over files to be included by this command.

Parameters

directory (PathPlus) – The project directory.

Return type

Iterator[PathPlus]

classmethod parse(parameters)[source]

Parse the command’s parameters.

Parameters

parameters (str)

Return type

Include

patterns

Type:    List[str]

Glob patterns (with complete paths from the project root)

to_dict()[source]

Returns a dictionary representation of the command entry.

Return type

Dict[str, Any]

class RecursiveExclude(path, patterns)[source]

Bases: whey.additional_files.AdditionalFilesEntry

Recursively exclude files in a directory based on patterns.

Parameters
  • path (str) – The directory to start from.

  • patterns (Iterable[str]) – Glob patterns.

Methods:

iter_files(directory)

Returns an iterator over files to be excluded by this command.

parse(parameters)

Parse the command’s parameters.

to_dict()

Returns a dictionary representation of the command entry.

Attributes:

path

The directory to start from.

patterns

Glob patterns.

iter_files(directory)[source]

Returns an iterator over files to be excluded by this command.

Parameters

directory (PathPlus) – The build directory.

Return type

Iterator[PathPlus]

classmethod parse(parameters)[source]

Parse the command’s parameters.

Parameters

parameters (str)

Return type

RecursiveExclude

path

Type:    str

The directory to start from.

patterns

Type:    List[str]

Glob patterns.

to_dict()[source]

Returns a dictionary representation of the command entry.

Return type

Dict[str, Any]

class RecursiveInclude(path, patterns)[source]

Bases: whey.additional_files.AdditionalFilesEntry

Recursively include files in a directory based on patterns.

Parameters
  • path (str) – The directory to start from.

  • patterns (Iterable[str]) – Glob patterns.

Methods:

iter_files(directory)

Returns an iterator over files to be included by this command.

parse(parameters)

Parse the command’s parameters.

to_dict()

Returns a dictionary representation of the command entry.

Attributes:

path

The directory to start from.

patterns

Glob patterns.

iter_files(directory)[source]

Returns an iterator over files to be included by this command.

Parameters

directory (PathPlus) – The project directory.

Return type

Iterator[PathPlus]

classmethod parse(parameters)[source]

Parse the command’s parameters.

Parameters

parameters (str)

Return type

RecursiveInclude

path

Type:    str

The directory to start from.

patterns

Type:    List[str]

Glob patterns.

to_dict()[source]

Returns a dictionary representation of the command entry.

Return type

Dict[str, Any]

from_entry(line)[source]

Parse a MANIFEST.in-style entry.

Parameters

line (str)

Return type

Optional[AdditionalFilesEntry]

Returns

An AdditionalFilesEntry for known commands, or None if an unknown command is found in the entry.