Skip to main content

A generator for Rust/Cargo ebuilds written in Python

Project description

Author:

Michał Górny

License:

MIT

Homepage:

https://github.com/projg2/pycargoebuild/

pycargoebuild is a generator for ebuilds using the Cargo infrastructure of Rust language. It is primarily meant to aid in keeping the list of CRATES and their LICENSE up-to-date. It is a rewrite of the cargo-ebuild tool in Python, with no actual dependency on Rust.

pycargoebuild reads Cargo.toml and Cargo.lock files in order to obtain the package’s metadata and dependency list, respectively. Then it fetches all dependent crates into DISTDIR and reads their Cargo.toml files to construct the complete list of licenses. The resulting data can either be used to construct a new ebuild from a template or to update the values of CRATES and LICENSE in an existing ebuild.

Why not cargo-ebuild?

pycargoebuild has the following features that cargo-ebuild 0.5.2 is missing:

  • small size (cargo-ebuild compiles to 5.5M on my system)

  • full support for SPDX-2.0 license expressions with boolean simplification (whereas cargo-ebuild just dumps all licenses it finds)

  • pretty-printing with line wrapping for license expressions

  • support for updating CRATES and crate LICENSE in existing ebuilds (whereas cargo-ebuild can only generate new ebuilds)

  • support for combining the data from multiple subpackages (useful e.g. in setuptools-rust)

  • support for fast crate fetching if aria2c is installed

  • support for skipping crate licenses (e.g. for when Crates are used at build/test time only)

Usage

To create a new ebuild, run:

pycargoebuild <package-directory>

where package-directory is the directory containing Cargo.toml. This creates an ebuild file named after the package name and version in the current directory, and outputs its name.

To update an existing ebuild, use instead:

pycargoebuild -i <current-file>.ebuild <package-directory>

Note that the existing file must contain both CRATES variable and LICENSE+= assignment like the following:

# Dependent crate licenses
LICENSE+="..."

It is also possible to explicitly specify the output filename using the -o option.

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

pycargoebuild-0.5.4.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycargoebuild-0.5.4-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file pycargoebuild-0.5.4.tar.gz.

File metadata

  • Download URL: pycargoebuild-0.5.4.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pycargoebuild-0.5.4.tar.gz
Algorithm Hash digest
SHA256 6dbe8df3effc19b3a40611c22e01c362f0f49a962900a5f1e4ae22bb3d7f50be
MD5 244b9194b66a2c1f885528edd20b72f8
BLAKE2b-256 69ea609efea2bfc60d737532b45901b19b48214bf9ac5de705638c31c4f6e98f

See more details on using hashes here.

File details

Details for the file pycargoebuild-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: pycargoebuild-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pycargoebuild-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 db60f7261c445efd66fe68e5e4dd84a2aed549b996af08885949989795f81116
MD5 6d6c5e01a3618edd9009e8fbd00d45cd
BLAKE2b-256 53e8c92886c14859181b2db39d84052e6f0e07e017890dd2e8a4201d450cf8ee

See more details on using hashes here.

Supported by

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