Package: mkwhl
Create Python wheel based onpyproject.tomlconfiguration and/or provided
arguments. Wheels can be created by:running command line toolpyproject.tomlbuild backendcallingmkwhl.create_wheelfunctionGoal of this project is to provide simple and minimal utility based on
accepted PEPs. Usage ofpyproject.tomlshould not be mandatory and
eachpyproject.tomlproperty should be overridable by provided arguments.
Functionality should not depend on specific project’s repository layout.
User is responsible for providing correct configuration/arguments
(e.g. python/abi/platform tags) without additional “automatic” detection.Only responsibility ofmkwhlis creation of wheels. Any kind of
preprocessing, including compilation of native extensions, should be done
prior tomkwhlexecution.Requirementspython >=3.10InstallPyPI python package:$ pip install mkwhlArchlinux AUR:$ yay -S mkwhlCommand line toolUsage:$ mkwhl --helpmkwhlwill create new wheel in--build-dir(defaults tobuild)
containing files from--src-dir(defaults to.). Files in--src-dirare selected based on--src-includeand--src-excludepatterns
used aspathlib.Path.globarguments applied to--src-dir(--src-excludepatterns are prioritized over--src-includepatterns).
If--skip-confis not set, project properties, which are not explicitly
overridden by command line arguments, are read from--conf(defaults topyproject.toml) as defined byproject metadata. When wheel is created,
wheel name is printed to stdout (unless--quietflag is set).For more information:$ man 1 mkwhlpyproject.tomlbuild backendmkwhlimplements build backend according toPEP517andPEP660. To usemkwhlas build backend, add following to pyproject.toml:[build-system]
requires = ["mkwhl"]
build-backend = "mkwhl"Wheel will be build based on pyproject.tomlproject metadataand additional[tool.mkwhl]properties:src-dir(string)Source root directory. If this property is not set, existence ofsrc_pyorsrcdirectory is checked and used if available.license-path(string)Optional path to license file.src-include-patterns(list of strings)List of strings used aspathlib.Path.globpatterns applied tosrc_dir.
These patterns specify which files should be included as part of built
wheel. If not set,['**/*']is assumed.src-exclude-patterns(list of strings)List of strings used aspathlib.Path.globpatterns applied tosrc_dir.
These patterns specify which files should not be included as part of built
wheel. This patterns take priority oversrc-include-patterns. If not set,['**/__pycache__/**/*']is assumed.data-paths(list of tables)Optional data paths where list element is table withsrcanddstkeys referencing source and destination path strings.‘python-tag’ (string)Python tag (seebinary distribution format). If not set,py3is
assumed.‘abi-tag’ (string)ABI tag (seebinary distribution format). If not set,noneis
assumed.build-tag(integer)Optional build tag (seebinary distribution format).‘platform-tag’ (string)Python tag (seebinary distribution format). If not set,anyis
assumed.‘is-purelib’ (boolean)Is purelib (seebinary distribution format). If not set,trueis
assumed.optional-dependencies(list of strings)List of strings used as keys in pyproject.toml[project.optional-dependencies]. These dependencies are required as part
of build virtual environment. If not set,['dev']is assumed.Python APIIn addition to command line interface and build backend, packagemkwhlexposes single function:def create_wheel(src_dir: Path,
                 build_dir: Path,
                 *,
                 name: str | None = None,
                 version: str | None = None,
                 description: str | None = None,
                 readme_path: Path | None = None,
                 requires_python: str | None = None,
                 license: str | None = None,
                 license_path: Path | None = None,
                 authors: list[tuple[str | None, str | None]] | None = None,
                 maintainers: list[tuple[str | None, str | None]] | None = None,
                 keywords: list[str] | None = None,
                 classifiers: list[str] | None = None,
                 urls: dict[str, str] | None = None,
                 scripts: dict[str, str] | None = None,
                 gui_scripts: dict[str, str] | None = None,
                 dependencies: list[str] | None = None,
                 optional_dependencies: dict[str, list[str]] | None = None,
                 conf_path: Path | None = Path('pyproject.toml'),
                 editable: bool = False,
                 src_include_patterns: typing.Iterable[str] = ['**/*'],
                 src_exclude_patterns: typing.Iterable[str] = ['**/__pycache__/**/*'],
                 data_paths: list[tuple[Path, Path]] = [],
                 build_tag: int | None = None,
                 python_tag: str = 'py3',
                 abi_tag: str = 'none',
                 platform_tag: str = 'any',
                 is_purelib: bool = True
                 ) -> str:
    """Create wheel and return wheel name

    Argument `src_dir` is path to source root directory.

    Argument `build_dir` is path to directory where resulting wheel will be
    created.

    If one of arguments `name`, `version`, `description`, `readme_path`,
    `requires_python`, `license`, `authors`, `maintainers`, `keywords`,
    `classifiers`, `urls`, `scripts`, `gui_scripts`, `dependencies` or
    `optional_dependencies` is ``None``, associated resulting property is
    set based on project configuration read from pyproject.

    Arguments `authors` and `maintainers` are structured as list of tuples
    where first tuple element represents name and second tuple element
    represents email.

    If `conf_path` is ``None``, resulting wheel will be created based only
    on provided arguments without parsing of pyproject configuration.

    Arguments `src_include_patterns` and `src_exclude_patterns` provide
    list of strings used as `pathlib.Path.glob` patterns applied to
    `src_dir`. Include patterns specify all files that will be included in
    resulting wheel. All files specified by exclude patterns will not be
    included in resulting wheel, even if same file is specified by include
    pattern.

    Argument `data_paths` defines list of (source, destination) paths to be
    included in wheel's data directory.

    """Licensemkwhl - python wheel creation utilityCopyright (C) 2023 Bozo KopicThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.