repo_helper.build

PEP 517 build backend.

Classes:

Builder(repo_dir[, build_dir, out_dir, …])

Builds source and binary distributions using metadata read from repo_helper.yml.

Functions:

build_sdist(sdist_directory[, config_settings])

PEP 517 hook to build a source distribution.

build_wheel(wheel_directory[, …])

PEP 517 hook to build a wheel binary distribution.

class Builder(repo_dir, build_dir=None, out_dir=None, *, verbose=False, colour=None)[source]

Bases: WheelBuilder

Builds source and binary distributions using metadata read from repo_helper.yml.

Parameters
  • repo_dir (Path) – The repository to build the distribution for.

  • build_dir (Union[str, Path, PathLike, None]) – The temporary build directory. Default <repo_dir>/build/repo_helper_build.

  • out_dir (Union[str, Path, PathLike, None]) – The output directory. Default <repo_dir>/dist.

  • verbose (bool) – Enable verbose output. Default False.

Attributes:

archive_name

The archive name, without the tag

build_dir

The (temporary) build directory.

colour

Whether to use coloured output.

config

repo_helper’s configuration dictionary.

import_name

The directory containing the source files.

info_dir

The info directory in the build directory for Conda builds.

out_dir

The output directory.

pkg_dir

The path of the package directory.

project_dir

The repository

repo_dir

The repository

verbose

Whether to enable verbose output.

Methods:

build_conda()

Build the Conda distribution.

build_sdist()

Build the source distribution.

copy_license(dest_dir[, dest_filename])

Copy the any files matching LICEN[CS]E.

copy_manifest_additional()

Copy additional files to the build directory, as specfied in manifest_additional.

create_conda_archive(wheel_contents_dir[, …])

Create the conda archive.

create_sdist_archive()

Create the sdist archive.

iter_source_files()

Iterate over the files in the source directory.

write_conda_about()

Write the conda about.json file.

write_conda_index([build_number])

Write the conda index.json file.

write_entry_points()

Write the list of entry points to the wheel, as specified in console_scripts.

write_license(dest_dir[, dest_filename])

Copy the any files matching LICEN[CS]E.

write_metadata(metadata_file)

Write Core Metadata to the given file.

write_wheel()

Write the metadata to the WHEEL file.

archive_name

The archive name, without the tag

build_conda()[source]

Build the Conda distribution.

Return type

str

Returns

The filename of the created archive.

build_dir

The (temporary) build directory.

build_sdist()[source]

Build the source distribution.

Return type

str

Returns

The filename of the created archive.

colour

Whether to use coloured output.

config

repo_helper’s configuration dictionary.

copy_license(dest_dir, dest_filename='LICENSE')

Copy the any files matching LICEN[CS]E.

Parameters

dest_dir (PathPlus) – The directory to copy the files into.

copy_manifest_additional()[source]

Copy additional files to the build directory, as specfied in manifest_additional.

create_conda_archive(wheel_contents_dir, build_number=1)[source]

Create the conda archive.

Parameters
  • wheel_contents_dir (Union[str, Path, PathLike]) – The directory containing the installed contents of the wheel.

  • build_number (int) – Default 1.

Return type

str

Returns

The filename of the created archive.

create_sdist_archive()[source]

Create the sdist archive.

Return type

str

Returns

The filename of the created archive.

property import_name

The directory containing the source files.

Return type

str

property info_dir

The info directory in the build directory for Conda builds.

Return type

PathPlus

iter_source_files()[source]

Iterate over the files in the source directory.

Return type

Iterator[PathPlus]

out_dir

The output directory.

property pkg_dir

The path of the package directory.

Return type

str

project_dir

The repository

repo_dir

Type:    PathPlus

The repository

verbose

Whether to enable verbose output.

write_conda_about()[source]

Write the conda about.json file.

write_conda_index(build_number=1)[source]

Write the conda index.json file.

Parameters

build_number (int) – Default 1.

write_entry_points()[source]

Write the list of entry points to the wheel, as specified in console_scripts.

write_license(dest_dir, dest_filename='LICENSE')[source]

Copy the any files matching LICEN[CS]E.

Parameters

dest_dir (PathPlus) – The directory to copy the files into.

write_metadata(metadata_file)[source]

Write Core Metadata to the given file.

Parameters

metadata_file (PathPlus)

write_wheel()[source]

Write the metadata to the WHEEL file.

build_sdist(sdist_directory, config_settings=None)[source]

PEP 517 hook to build a source distribution.

Parameters
  • sdist_directory

  • config_settings – Default None.

build_wheel(wheel_directory, config_settings=None, metadata_directory=None)[source]

PEP 517 hook to build a wheel binary distribution.

Parameters
  • wheel_directory

  • config_settings – Default None.

  • metadata_directory – Default None.