The collect_unexported Python library
Common configuration settings and definitions
Constants
collect_unexported.defs.VERSION = '0.1.1'
module-attribute
The version of the collect-unexported tool.
Runtime configuration settings
collect_unexported.defs.Source
dataclass
The paths to various files in the examined source tree.
Source code in src/collect_unexported/defs.py
changelog: pathlib.Path
class-attribute
The path to the Debian changelog file.
debian: pathlib.Path
class-attribute
The directory containing the Debian packaging files.
package_name: str
class-attribute
The name of the Debian package being processed.
top: pathlib.Path
class-attribute
The top-level source directory.
upstream_version: str
class-attribute
The upstream version of the Debian package being processed.
collect_unexported.defs.Config
dataclass
Bases: cfg_diag.Config
Runtime configuration for the collect-unexported tool.
Source code in src/collect_unexported/defs.py
noop: bool
class-attribute
Do not copy the generated output file out of the temporary directory.
src: Source
class-attribute
Information about the Debian source package being processed.
Exceptions
collect_unexported.defs.CollectError
dataclass
Examine the Debian source package structure
Constants
collect_unexported.examine.CHANGELOG_REL = pathlib.Path('debian/changelog')
module-attribute
The relative path of the changelog file to look for.
Functions
collect_unexported.examine.find_source()
Look for a debian/changelog
file higher and higher up.
Source code in src/collect_unexported/examine.py
collect_unexported.examine.get_repo_url(cfg)
Grab the repository URL out of the Debian upstream metadata file.
Source code in src/collect_unexported/examine.py
Exceptions
collect_unexported.examine.DebianChangelogError
dataclass
Bases: defs.CollectError
Base class for errors related to parsing the debian/changelog file.
Source code in src/collect_unexported/examine.py
changelog: pathlib.Path
class-attribute
The relative path to the changelog file that we were looking for.
collect_unexported.examine.NoChangelogError
dataclass
Bases: DebianChangelogError
Could not find the debian/changelog file.
Source code in src/collect_unexported/examine.py
cwd: pathlib.Path
class-attribute
The directory where we started looking.
collect_unexported.examine.ChangelogParseError
dataclass
Bases: DebianChangelogError
Could not parse the debian/changelog file.
Source code in src/collect_unexported/examine.py
collect_unexported.examine.MetaError
dataclass
Bases: defs.CollectError
Base class for errors related to parsing the debian/upstream/metadata file.
Source code in src/collect_unexported/examine.py
meta_path: pathlib.Path
class-attribute
The path to the upstream metadata file.
collect_unexported.examine.MetaReadError
dataclass
Bases: MetaError
Could not read the upstream metadata file.
Source code in src/collect_unexported/examine.py
collect_unexported.examine.MetaParseError
dataclass
Bases: MetaError
Could not parse the upstream metadata file.
Source code in src/collect_unexported/examine.py
collect_unexported.examine.MetaContentsError
dataclass
Bases: MetaError
Base class for errors related to the parsed YAML contents.
Source code in src/collect_unexported/examine.py
meta: Any
class-attribute
The parsed contents of the Debian upstream metadata file.
yaml_path: str
class-attribute
The "path" to the YAML element that is not as it ought to be.
collect_unexported.examine.MetaBadRepositoryError
dataclass
Bases: MetaContentsError
The repository URL in the upstream metadata file could not be parsed.
Source code in src/collect_unexported/examine.py
err: Exception
class-attribute
The error that occurred while trying to parse the URL string.
url: str
class-attribute
The URL string extracted from the metadata file.
__str__()
Report the bad URL in a human-readable way.
collect_unexported.examine.MetaMissingError
dataclass
Bases: MetaContentsError
There is no element at all.
Source code in src/collect_unexported/examine.py
collect_unexported.examine.MetaTypeError
dataclass
Bases: MetaContentsError
The element is not of the expected type.
Source code in src/collect_unexported/examine.py
expected: str
class-attribute
The type we expected the element to be.
__str__()
Report the missing element in a human-readable way.
Clone a Git repository, examine its files
Functions
collect_unexported.gitrepo.build_tarball(cfg, tempd, repo, to_include)
Collect the files to include again into an 'unexported' tarball.
Source code in src/collect_unexported/gitrepo.py
collect_unexported.gitrepo.clone_repo(cfg, tempd, repo_url, to_include)
Clone the upstream Git repository, validate the list of files to include.
Source code in src/collect_unexported/gitrepo.py
Exceptions
collect_unexported.gitrepo.RepoError
dataclass
Bases: defs.CollectError
Base class for errors that occurred while handling the Git repository.
Source code in src/collect_unexported/gitrepo.py
err: Exception
class-attribute
The error that occurred while switching to the Git tag.
repo_url: str
class-attribute
The upstream repository URL.
collect_unexported.gitrepo.RepoCloneError
dataclass
Bases: RepoError
Could not clone the Git repository.
Source code in src/collect_unexported/gitrepo.py
collect_unexported.gitrepo.RepoTagError
dataclass
Bases: RepoError
Could not switch to the Git tag corresponding to the upstream version.
Source code in src/collect_unexported/gitrepo.py
tag: str
class-attribute
The Git tag that we tried to switch to.
collect_unexported.gitrepo.RepoNonIgnoredError
dataclass
Bases: defs.CollectError
Some of the files to repack are not actually ignored.
Source code in src/collect_unexported/gitrepo.py
ignored: list[str]
class-attribute
The files that were specified as ignored in the .gitattributes file.
missing: list[str]
class-attribute
The files that were specified for inclusion, but are not ignored.
repo_url: str
class-attribute
The upstream repository URL.
collect_unexported.gitrepo.RenameError
dataclass
Bases: defs.CollectError
Could not rename a file.
Source code in src/collect_unexported/gitrepo.py
err: Exception
class-attribute
The error we encountered.
source: pathlib.Path
class-attribute
The file we tried to rename.
target: pathlib.Path
class-attribute
What we tried to rename it to.
Parse some configuration files
Functions
collect_unexported.parse.parse_config_file(cfg, config_file)
Parse the list of paths to include from the TOML config file.
Source code in src/collect_unexported/parse.py
collect_unexported.parse.get_ignored_files(attr_path)
Parse a .gitattributes file, return the ignored patterns.
Source code in src/collect_unexported/parse.py
Exceptions
collect_unexported.parse.ConfigError
dataclass
Bases: defs.CollectError
Base class for errors related to configuration file parsing.
Source code in src/collect_unexported/parse.py
config_file: pathlib.Path
class-attribute
The path to the config file we tried to process.
collect_unexported.parse.ConfigContentsError
dataclass
Bases: ConfigError
Something in the config file was not as we expected it to be.
Source code in src/collect_unexported/parse.py
contents: Any
class-attribute
The contents of the config file.
path: str
class-attribute
The path to the element that was not as it should be.
collect_unexported.parse.ConfigReadError
dataclass
Bases: ConfigError
An error that occurred while reading the config file.
Source code in src/collect_unexported/parse.py
collect_unexported.parse.ConfigMissingError
dataclass
Bases: ConfigContentsError
An element was not found at all in the config file.
Source code in src/collect_unexported/parse.py
collect_unexported.parse.ConfigParseError
dataclass
Bases: ConfigError
An error that occurred while parsing the config file.
Source code in src/collect_unexported/parse.py
collect_unexported.parse.ConfigTypeError
dataclass
Bases: ConfigContentsError
An element was not of the correct type.
Source code in src/collect_unexported/parse.py
expected: str
class-attribute
What the element should have been.
collect_unexported.parse.AttributesError
dataclass
Bases: defs.CollectError
Base class for errors related to .gitattributes parsing.
Source code in src/collect_unexported/parse.py
attr_path: pathlib.Path
class-attribute
The path to the .gitattributes file we tried to process.
collect_unexported.parse.AttributesReadError
dataclass
Bases: AttributesError
An error that occurred while reading the .gitattributes file.
Source code in src/collect_unexported/parse.py
collect_unexported.parse.AttributesParseError
dataclass
Bases: AttributesError
An error that occurred while parsing the .gitattributes file.