Skip to main content

Flot is a simple tool to easily build multiple packages (wheel and sdist) from a single repo without having to create a subdir or another repo for each package, and by simply listing which files to include.

Project description

Flot is a simple way to create one or more Python packages from a single repository or code tree, just listing the files you want top include.

Because “Explicit is better than implicit” and “Simple is better than complex.”

You can now have multiple pyproject.toml files and enjoy the benefits of a simpler monolithic code layout and still be able to easily share and package multiple Pypi packages to foster reuse of subsets of your larger project.

Other tools assume that you can only build a single Python package from a given directory or repository and use a lot of magic to find which module or file to include in your package.

flot takes the magic away: you just specify a list of paths or path patterns for the files you want to include in your package. No mystery! Include data files, multiple modules or any files as easily as listing their paths.

See Why use Flot? for more details.

Flot is derived from and based on a modified Flit https://github.com/pypa/flit/ by Thomas Kluyver @takluyver

It was started following this discussion https://github.com/pypa/flit/discussions/669

Install

$ pip install flot

Usage

Say you’re writing a module foobar — either as a single file foobar.py, or as a directory — and you want to distribute it.

  1. Install flot if you don’t already have it:

    pip install flot
  2. Create a pyproject.toml file in the directory containing the module. It will look something like this:

    [build-system]
    requires = ["flot"]
    build-backend = "flot.buildapi"
    
    [project]
    name = "foobar"
    version = "1.0.0"
    description = "foobar frobinator"
    authors = [{name = "Sir Robin", email = "robin@camelot.uk"}]
    
    [project.urls]
    Home = "https://github.com/sirrobin/foobar"
    
    [tool.flot]
    includes = ["foobar.py"]

    You can edit this file to add other metadata, for example to set up command line scripts. See the pyproject.toml page of the documentation.

  3. Run this command to build your wheel in the dist/ directory:

    flot

Once your package is published to PyPI (like with the twine tool), people can install it using pip or any other Python packaging tool just like any other package.

  1. Say you’re writing a second module baz as a single file baz.py. Just create a second file named for instance baz-pyproject.toml. It will look something like this:

    [build-system]
    requires = ["flot"]
    build-backend = "flot.buildapi"
    
    [project]
    name = "baz"
    version = "1.0.0"
    description = "baz frobinator"
    authors = [{name = "Sir Robin", email = "robin@camelot.uk"}]
    
    [project.urls]
    Home = "https://github.com/sirrobin/foobar"
    
    [tool.flot]
    includes = ["baz.py"]
  2. Run this command to build a second wheel in the dist/ directory:

    flot --pyproject baz-pyproject.toml

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

flot-0.6.1.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

flot-0.6.1-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file flot-0.6.1.tar.gz.

File metadata

  • Download URL: flot-0.6.1.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.10

File hashes

Hashes for flot-0.6.1.tar.gz
Algorithm Hash digest
SHA256 8eac9d43cd528122c18aa8466be69278ae9605ee21972553a9ac62bda4649078
MD5 77af5e4883af3f9eb959cac840625dfc
BLAKE2b-256 a1439d451711905fb5c20eec95280a9d86c131f613d0b7ae57becfae1e3365d5

See more details on using hashes here.

Provenance

File details

Details for the file flot-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: flot-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.10

File hashes

Hashes for flot-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bd918fca04bf84d587b20d4565de0d6fd3ed33297387d5e682fb9a89847576db
MD5 7a762ef6655ea343d9758b45336f0335
BLAKE2b-256 a5c03d77b8b4da394693bd940416480e57d2825515087ad5568ebfadc5b18ca8

See more details on using hashes here.

Provenance

Supported by

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