Skip to main content

A simple packaging tool for simple packages.

Project description

Flit is a simple way to put Python packages and modules on PyPI.

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. Make sure that foobar’s docstring starts with a one-line summary of what the module is, and that it has a __version__:

    """An amazing sample package!"""
    
    __version__ = '0.1'
  2. Create a file flit.ini next to the module. It should look like this:

    [metadata]
    module=foobar
    author=Sir Robin
    author-email=robin@camelot.uk
    home-page=http://github.com/sirrobin/foobar
    
    # If you want command line scripts, this is how to declare them.
    # If not, you can leave this section out completely.
    [scripts]
    # foobar:main means the script will do: from foobar import main; main()
    foobar=foobar:main

    You can use flit init to easily create a basic flit.ini file for your package.

    Besides the details shown above, there are other fields you can add—see the flit.ini page of the docs.

  3. Install flit if you don’t already have it:

    pip install flit
  4. Run this command to upload your code to PyPI:

    flit publish

If your package is not registered on PyPI yet, flit will try to register it for you during the upload step.

To install a package locally for development, run:

flit install [--symlink] [--python path/to/python]

Flit packages a single importable module or package at a time, using the import name as the name on PyPI. All subpackages and data files within a package are included automatically.

Flit requires Python 3, but you can use it to distribute modules for Python 2, so long as they can be imported on Python 3.

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

flit-0.11.tar.gz (58.9 kB view details)

Uploaded Source

Built Distribution

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

flit-0.11-py3-none-any.whl (131.0 kB view details)

Uploaded Python 3

File details

Details for the file flit-0.11.tar.gz.

File metadata

  • Download URL: flit-0.11.tar.gz
  • Upload date:
  • Size: 58.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flit-0.11.tar.gz
Algorithm Hash digest
SHA256 14d21e58245d1a9dee68863bf553e73aaf2eb31cd816992beac40b201e71c320
MD5 b9583dee70a11224b4dcc9dc0ca0ef32
BLAKE2b-256 3fcfb7457a2967d376b1bd58f804f14a1a15ab09b1e97ee87318ff422719beb5

See more details on using hashes here.

File details

Details for the file flit-0.11-py3-none-any.whl.

File metadata

  • Download URL: flit-0.11-py3-none-any.whl
  • Upload date:
  • Size: 131.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flit-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a4904e722563967ce2dd6d527a797f34b86a59ebea7e7c3e5cfca1a3cd300143
MD5 b940130d254c52dca1d451828c4eb238
BLAKE2b-256 6dc51c3655d52b302eb3695b3cd6a2add644f777957fb737348ea002f7ea399e

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