FLIT(1)
π FLIT(1) β the flit manual, bestie edition π
okay so. welcome to FLIT(1), the manual page for flit, and honestly? you're gonna eat this up. grab a boba, sit down, let's get into it π«Ά
β¨ NAME β¨
flit β Flit Documentation
Flit is a simple way to put Python packages and modules on PyPI. It tries to require less thought about packaging and help you avoid common mistakes. See [Why use Flit?](https://flit.readthedocs.io/en/latest/rationale.html) for more about how it compares to other Python packaging tools.
lowkey the whole point is: less thinking, fewer mistakes. it's giving β¨effortlessβ¨.
π INSTALL π
$ python3 -m pip install flit
Flit requires Python 3 and therefore needs to be installed using the Python 3 version of pip.
Python 2 modules can be distributed using Flit, but need to be importable on Python 3 without errors.
ngl, Python 2? that's giving 2010. but the note's there, so there it is π
π 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.
- 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"
- Install flit if you don't already have it:
python3 -m pip install flit
- Run
flit initin the directory containing the module to create apyproject.tomlfile. It will look something like this:
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
[project]
name = "foobar"
authors = [{name = "Sir Robin", email = "robin@camelot.uk"}]
dynamic = ["version", "description"]
[project.urls]
Home = "https://github.com/sirrobin/foobar"
You can edit this file to add other metadata, for example to set up command line scripts. See the [pyproject.toml page](https://flit.readthedocs.io/en/latest/pyproject_toml.html#scripts-section) of the documentation.
If you have already got a flit.ini file to use with older versions of Flit, convert it to pyproject.toml by running python3 -m flit.tomlify.
- Run this command to upload your code to PyPI:
flit publish
Once your package is published, people can install it using pip just like any other package. In most cases, pip will download a 'wheel' package, a standard format it knows how to install. If you specifically ask pip to install an 'sdist' package, it will install and use Flit in a temporary environment.
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.
the way that it just... handles subpackages and data files automatically? obsessed. no cap π₯
π DOCUMENTATION CONTENTS π
π The pyproject.toml config file π
This file lives next to the module or package.
NOTE: π Older version of Flit (up to 0.11) used aflit.inifile for similar information. These files no longer work with Flit 3 and above. Runpython3 -m flit.tomlifyto convert aflit.inifile topyproject.toml.
π¦ Build system section π¦
This tells tools like pip to build your project with flit. It's a standard defined by PEP 517. For any new project using Flit, it will look like this:
[build-system]
requires = ["flit_core >=3.11,<4"]
build-backend = "flit_core.buildapi"
Version constraints:
- For now, all packages should specify
<4, so they won't be impacted by changes in the next major version. license-filesand license expressions in thelicensefield requireflit_core >=3.11.- New style metadata requires
flit_core >=3.2 - Old style metadata requires
flit_core >=2,<4 - The older
flit.inifile requiresflit_core <3. - TOML features new in version 1.0 require
flit_core >=3.4. flit_core3.3 is the last version supporting Python 3.4 & 3.5. Packages supporting these Python versions can only use [TOML v0.5](https://toml.io/en/v0.5.0).- Only
flit_core2.x can build packages on Python 2, so packages still supporting Python 2 cannot use new-style metadata (the[project]table).
fr fr read the version constraints, they will humble you π
β¨ New style metadata β¨
Added in version 3.2.
The new standard way to specify project metadata is in a [project] table, as defined by [PEP 621](https://peps.python.org/pep-0621/). Flit works for now with either this or the older [tool.flit.metadata] table (described below), but it won't allow you to mix them.
A simple [project] table might look like this:
[project]
name = "astcheck"
authors = [
{name = "Thomas Kluyver", email = "thomas@kluyver.me.uk"},
]
readme = "README.rst"
license = "MIT"
requires-python = ">=3.5"
dynamic = ["version", "description"]
The allowed fields are:
nameβ The name your package will have on PyPI. This field is required. For Flit, this name, with any hyphens replaced by underscores, is also the default value of the import name (see Module section if that needs to be different).
Changed in version 3.8: Hyphens in the project name are now translated to underscores for the import name.
versionβ Version number as a string. If you want Flit to get this from a__version__attribute, leave it out of the TOML config and include"version"in thedynamicfield.descriptionβ A one-line description of your project. If you want Flit to get this from the module docstring, leave it out of the TOML config and include"description"in thedynamicfield.readmeβ A path (relative to the.tomlfile) to a file containing a longer description of your package to show on PyPI. This should be written in [reStructuredText](http://docutils.sourceforge.net/docs/user/rst/quickref.html), Markdown or plain text, and the filename should have the appropriate extension (.rst,.mdor.txt). Alternatively,readmecan be a table with either afilekey (a relative path) or atextkey (literal text), and an optionalcontent-typekey (e.g.text/x-rst).requires-pythonβ A version specifier for the versions of Python this requires, e.g.~=3.3or>=3.3,<4, which are equivalents.licenseβ A valid [SPDX license expression](https://peps.python.org/pep-0639/#term-license-expression) or a table with either afilekey (a relative path to a license file) or atextkey (the license text).license-filesβ A list of glob patterns for license files to include. Defaults to['COPYING*', 'LICEN[CS]E*'].authorsβ A list of tables withnameandemailkeys (both optional) describing the authors of the project.maintainersβ Same format asauthors.keywordsβ A list of words to help with searching for your package.classifiersβ A list of [Trove classifiers](https://pypi.python.org/pypi?%3Aaction=list_classifiers). AddPrivate :: Do Not Uploadinto the list to prevent a private package from being uploaded to PyPI by accident.dependencies&optional-dependenciesβ See Dependencies.urlsβ See URLs table.scripts&gui-scriptsβ See Scripts section.entry-pointsβ See Entry points sections.dynamicβ A list of field names which aren't specified here, for which Flit should find a value at build time. Only"version"and"description"are accepted.
the Private :: Do Not Upload classifier is the safety net you didn't know you needed. iconic π«Ά
π Dependencies π
The dependencies field is a list of other packages from PyPI that this package needs. Each package may be followed by a version specifier like >=4.1, and/or an [environment marker](https://www.python.org/dev/peps/pep-0508/#environment-markers) after a semicolon. For example:
dependencies = [
"requests >=2.6",
"configparser; python_version == '2.7'",
]
The [project.optional-dependencies] table contains lists of packages needed for every optional feature. The requirements are specified in the same format as for dependencies. For example:
[project.optional-dependencies]
test = [
"pytest >=2.7.3",
"pytest-cov",
]
doc = ["sphinx"]
You can call these optional features anything you want, although test and doc are common ones. You specify them for installation in square brackets after the package name or directory, e.g. pip install '.[test]'.
optional extras are literally the "choose your own adventure" of packaging, and I'm obsessed πΈ
π§ URLs table π§
Your project's page on [pypi.org](https://pypi.org/) can show a number of links. You can point people to documentation or a bug tracker, for example.
This section is called [project.urls] in the file. You can use any names inside it. Here it is for flit:
[project.urls]
Documentation = "https://flit.pypa.io"
Source = "https://github.com/pypa/flit"
π Scripts section π
This section is called [project.scripts] in the file. Each key and value describes a shell command to be installed along with your package. These work like setuptools 'entry points'. Here's the section for flit:
[project.scripts]
flit = "flit:main"
This will create a flit command, which will call the function main() imported from flit.
A similar table called [project.gui-scripts] defines commands which launch a GUI. This only makes a difference on Windows, where GUI scripts are run without a console.
main character energy: your package gets its own command π
β Entry points sections β
You can declare [entry points](http://entrypoints.readthedocs.io/en/latest/) using sections named [project.entry-points.groupname]. E.g. to provide a pygments lexer from your package:
[project.entry-points."pygments.lexers"]
dogelang = "dogelang.lexer:DogeLexer"
In each package:name value, the part before the colon should be an importable module name, and the latter part should be the name of an object accessible within that module. The details of what object to expose depend on the application you're extending.
If the group name contains a dot, it must be quoted ("pygments.lexers" above). Script entry points are defined in scripts tables, so you can't use the group names console_scripts or gui_scripts here.
dogelang?? such a vibe. also: quote your dotted group names or it simply won't work, bestie π
πΈ Module section πΈ
If your package will have different names for installation and import, you should specify the install (PyPI) name in the [project] table (see above), and the import name in a [tool.flit.module] table:
[project]
name = "pynsist"
# ...
[tool.flit.module]
name = "nsist"
Flit looks for the source of the package by its import name. The source may be located either in the directory that holds the pyproject.toml file, or in a src/ subdirectory.
install name β import name? totally valid, [tool.flit.module] has your back π¦
π Old style metadata π
okay so Flit's OG way of doing metadata lives in a [tool.flit.metadata] table, and it hangs out with [tool.flit.scripts] and [tool.flit.entrypoints], which we'll get to in a sec. It's still recognised for now, bestie, but here's the thing:
π¨ you cannot mix it with New style metadata. Pick a lane. That's it, that's the rule. π¨
There are three required fields, and you literally cannot skip them:
moduleβ the name of the module/package, exactly like you'd write it in animportstatement. πauthorβ your name, yes your name, the icon behind the code. πauthor-emailβ your email address.
like, for flit itself it's giving:
[tool.flit.metadata]
module = "flit"
author = "Thomas Kluyver"
author-email = "thomas@kluyver.me.uk"
Changed in version 1.1: home-page was previously required.
The rest of the fields are optional β take 'em or leave 'em:
home-pageβ a URL for the project, like its Github repository. πrequiresβ a list of other packages from PyPI that this package needs. Each package can be followed by a version specifier like(>=4.1)or>=4.1, and/or an environment marker <https://www.python.org/dev/peps/pep-0508/#environment-markers> after a semicolon. fr fr, like:
requires = [
"requests >=2.6",
"configparser; python_version == '2.7'",
]
requires-extraβ lists of packages needed for every optional feature. Same format asrequires, no cap. The requirements of the two reserved extrastestanddoc, plus the extradev, get installed byflit install. slay. for example:
[tool.flit.metadata.requires-extra]
test = [
"pytest >=2.7.3",
"pytest-cov",
]
doc = ["sphinx"]
Added in version 1.1.
description-fileβ a path (relative to the.tomlfile) pointing at a file with a longer description of your package, the one that shows up on PyPI. Write it in reStructuredText <http://docutils.sourceforge.net/docs/user/rst/quickref.html>, Markdown, or plain text, and give the filename the matching extension (.rst,.md, or.txt). πclassifiersβ a list of Trove classifiers <https://pypi.python.org/pypi?%3Aaction=list_classifiers>. π psst: dropPrivate :: Do Not Uploadinto that list and your private package will not get uploaded to PyPI by accident. protection, periodt.requires-pythonβ a version specifier for the Python versions this needs, e.g.~=3.3or>=3.3,<4, which are equivalents. β¨dist-nameβ if you want your package's name on PyPI to be different from the importable module name, set this to the PyPI name.keywordsβ comma separated list of words to help with searching for your package. πlicenseβ the name of a license, for when you're using one that doesn't have a Trove classifier. It's recommended to use Trove classifiers instead of this in most cases.maintainer,maintainer-emailβ likeauthor, for if you've taken over a project from someone else. π«Ά passing the torch, iconic behaviour.
here was the metadata section from flit using the older style, for the visual learners:
[tool.flit.metadata]
module="flit"
author="Thomas Kluyver"
author-email="thomas@kluyver.me.uk"
home-page="https://github.com/pypa/flit"
requires=[
"flit_core >=2.2.0",
"requests",
"docutils",
"tomli",
"tomli-w",
]
requires-python=">=3.6"
description-file="README.rst"
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
]
π URLs subsection π
Your project's page on pypi.org <https://pypi.org/> can show a bunch of links, on top of the home-page URL we just talked about. Point people at your docs, your bug tracker, whatever. π¦
This section is called [tool.flit.metadata.urls] in the file, and you can use any names you want inside it. Here it is for flit:
[tool.flit.metadata.urls]
Documentation = "https://flit.pypa.io"
Added in version 1.0.
π§ Scripts section π§
A [tool.flit.scripts] table can be used alongside [tool.flit.metadata]. Same format as the newer [project.scripts] table described above, so if you already know that one you're chilling. π
β Entry points sections β
[tool.flit.entrypoints] tables can be used alongside [tool.flit.metadata]. Same format as the newer [project.entry-points] tables described above. copy paste energy, but make it metadata. π
π¦ Sdist section π¦
Added in version 2.0.
With no configuration at all, Flit can make an sdist with everything it needs to build and install your module: the package contents (including non-Python data files, but not .pyc bytecode files), your pyproject.toml file, the readme & license files given in the metadata, and the external data folder if you specified that. it just works. β¨
But if you want more control, you can hand it lists of paths or glob patterns as include and exclude in this section. like so:
[tool.flit.sdist]
include = ["doc/"]
exclude = ["doc/*.html"]
These paths:
- Always use
/as a separator (POSIX style) - Must be relative paths from the directory containing
pyproject.toml - Cannot go outside that directory (no
../paths) π« - Cannot contain control characters or
<>:"\\ - Can refer to directories, in which case they include everything under the directory, including subdirectories
- Should match the case of the files they refer to, as case-insensitive matching is platform dependent π
Changed in version 3.8: Include and exclude patterns can now use recursive glob patterns (**).
Exclusions have priority over inclusions. And bytecode? Excluded by default and it cannot be included. not up for discussion, bestie. π
π Including files committed in git/hg π
If you use flit build or flit publish, you can also make sdists with the files which are committed in version control (git or hg). It's a shortcut to, like, include documentation source files but not the built HTML or PDF documentation. The include and exclude patterns are then applied on top of this list. π₯
For now, including files from version control is the default for flit build and flit publish, and can be disabled with --no-use-vcs. The default will switch in a future version. so heads up, this vibe is temporary.
Using flit_core as a backend to other tools such as build <https://pypa-build.readthedocs.io/en/latest/> never gets the list of files for the sdist from version control. nope. not a thing. π
πΈ External data section πΈ
Added in version 3.7.
Data files which your code will use should go inside the Python package folder. Flit will package these with no special configuration. easy. π
But sometimes it's useful to package external files for system integration β man pages, or files defining a Jupyter extension, that kind of thing. To do this, arrange the files within a directory such as data, next to your pyproject.toml file, and add a section like this:
[tool.flit.external-data]
directory = "data"
Paths within this directory are typically installed to corresponding paths under a prefix (such as a virtualenv directory). E.g. you might save a man page for a script as (data)/share/man/man1/foo.1. π
Whether these files are detected by the systems they're meant to integrate with depends on how your package is installed and how those systems are configured. For instance, installing in a virtualenv usually doesn't affect anything outside that environment.
β οΈ Don't rely on these files being picked up unless you have close control of how the package will be installed. seriously. β οΈ
If you install a package with flit install --symlink, a symlink is made for each file in the external data directory. Otherwise (including development installs with pip install -e), these files are copied to their destination, so changes here won't take effect until you reinstall the package. π
NOTE: For users coming from setuptools: external data corresponds to setuptools' data_files parameter, although setuptools offers more flexibility. π«Ά
π Flit command line interface π
All operations use the flit command, followed by one of a number of subcommands. that's the whole vibe.
β¨ Common options β¨
-f <path>,--ini-file <path>β path to a config file specifying the module to build. The default ispyproject.toml.--versionβ show the version of Flit in use.--helpβ show help on the command-line interface.--debugβ show more detailed logs about what flit is doing. π
π¦ flit build π¦
Build a wheel and an sdist (tarball) from the package. both of them. the full set. π
--format <format>β limit to building eitherwheelorsdist.--setup-pyβ generate asetup.pyfile in the sdist, so it can be installed by older versions of pip.--no-setup-pyβ don't generate asetup.pyfile in the sdist. This is the default. An sdist built without this will only work with tools that support PEP 517, but the wheel will still be usable by any compatible tool.
Changed in version 3.5: Generating setup.py disabled by default.
--use-vcsβ use the files checked in to git or mercurial as the starting list to include in an sdist, and then apply inclusions and exclusions frompyproject.toml.
This is the default for now, but we're planning to switch to --no-use-vcs as the default in a future version. π
--no-use-vcsβ create the sdist starting with only the files inside the installed module or package, along with any inclusions and exclusions defined inpyproject.toml.
With this option, sdists from flit build are equivalent to those built by tools calling Flit as a backend, such as build <https://pypa-build.readthedocs.io/en/stable/>.
π flit publish π
Build a wheel and an sdist (tarball) from the package, and upload them to PyPI or another repository. βοΈ
--format <format>β limit to publishing eitherwheelorsdist. You should normally publish the two formats together. fr fr, don't split them up.--setup-py--no-setup-py--use-vcs--no-use-vcsβ These options affecting what goes in the sdist are described forflit buildabove. β¬οΈ--repository <repository>β name of a repository to upload packages to. Should match a section in~/.pypirc. The default ispypi.--pypirc <pypirc>β the.pypircconfig file to be used. The default is~/.pypirc.
SEE ALSO: Controlling package uploads
π flit install π
Install the package on your system. π
By default, the package is installed to the same Python environment that Flit itself is installed in; use --python or FLIT_INSTALL_PYTHON to override this.
If you don't have permission to modify the environment (like, say, the system Python on Linux π), Flit might just do a user install instead. Bestie, do not make it guess β use the --user or --env flags to force it one way or the other. π
-s,--symlinkβ symlink the module into site-packages instead of copying it, so you can test your changes without reinstalling the module. iconic behaviour fr β¨--pth-fileβ create a.pthfile in site-packages rather than copying the module, so you can test changes without reinstalling. It's a less elegant alternative to--symlink, but it works on Windows, which typically doesn't allow symlinks. πͺ--deps <dependency option>β which dependencies to install. One ofall,production,develop, ornone.allanddevelopinstall the extrastest,doc, anddev. Defaultall.--extras <extra[,extra,...]>β which named extra features to install dependencies for. Specifyallto install all optional dependencies, or a comma-separated list of extras. Default depends on--deps.--only-depsβ install the dependencies of this package, but not the package itself.
This can be useful for e.g. building a container image, where your own code is copied or mounted into the container at a later stage. π³
Added in version 3.8.
--userβ do a user-local installation. This is the default ifflitis not in a virtualenv or conda env (if the environment's library directory is read-only andsite.ENABLE_USER_SITEis true).--envβ install into the environment β the exact opposite of--user. This is the default in a virtualenv or conda env (if the environment's library directory is writable orsite.ENABLE_USER_SITEis false).--python <path to python>β install for another Python, identified by the path of thepythonexecutable. Using this option, you can install a module for Python 2, for instance. SeeFLIT_INSTALL_PYTHONif this option is not given.
Changed in version 2.1: Added FLIT_INSTALL_PYTHON and use its value over the Python running Flit when an explicit --python option is not given.
NOTE: Flit callspipto do the installation. You can set any of pip's options using its environment variables βhttps://pip.pypa.io/en/stable/topics/configuration/#environment-variables. When you use the--symlinkor--pth-fileoptions,pipis used to install dependencies. Otherwise, Flit builds a wheel and then callspipto install that. π
π± flit init π±
Create a new pyproject.toml config file by prompting you for information about the module in the current directory. It's giving "interview but make it cozy". π
π Environment variables π
FLIT_NO_NETWORK
Added in version 0.10.
Setting this to any non-empty value will stop flit from making network connections (unless you explicitly ask to upload a package). This is intended for downstream packagers, so if you use this, it's up to you to ensure any necessary dependencies are installed. No cap. π«π
FLIT_ROOT_INSTALL
By default, flit install will fail when run as root on POSIX systems, because installing Python modules systemwide is not recommended. Setting this to any non-empty value allows installation as root. It has no effect on Windows. π
FLIT_USERNAMEFLIT_PASSWORDFLIT_INDEX_URL
Added in version 0.11.
Set a username, password, and index URL for uploading packages. See uploading packages with environment variables for more information.
Token-based upload to PyPI is supported. To upload using a PyPI token, set FLIT_USERNAME to __token__, and FLIT_PASSWORD to the token value. π
FLIT_ALLOW_INVALID
Added in version 0.13.
Setting this to any non-empty value tells Flit to continue if it detects invalid metadata, instead of failing with an error. Problems will still be reported in the logs, but won't cause Flit to stop.
If the metadata is invalid, uploading the package to PyPI may fail. This environment variable provides an escape hatch in case Flit incorrectly rejects your valid metadata. If you need to use it and you believe your metadata is valid, please open an issue β https://github.com/pypa/flit/issues. π
FLIT_INSTALL_PYTHON
Added in version 2.1.
Set a default Python interpreter for flit install to use when --python is not specified. The value can be either an absolute path, or a command name (which will be found in PATH). If this is unset or empty, the module is installed for the copy of Python that is running Flit. π
SOURCE_DATE_EPOCH
To make reproducible builds, set this to a timestamp as a number of seconds since the start of the year 1970 in UTC, and document the value you used. On Unix systems, you can get a value for the current time by running:
date +%s
SEE ALSO:
The SOURCE_DATE_EPOCH specification β https://reproducible-builds.org/specs/source-date-epoch/ β°
π¦ Controlling package uploads π¦
The command flit publish will upload your package to a package index server. The default settings let you upload to PyPI β https://pypi.org/, the default Python Package Index β with a single user account.
If you want to upload to other servers, or with more than one user account, or upload packages from a continuous integration job, you can configure Flit in two main ways. π
π Using .pypirc π
You can create or edit a config file in your home directory, ~/.pypirc, that will be used by default β or you can specify a custom location. This is also used by other Python tools such as twine (https://pypi.python.org/pypi/twine). iykyk π
For instance, to upload a package to the Test PyPI server (https://test.pypi.org/) instead of the normal PyPI, use a config file looking like this:
[distutils]
index-servers =
pypi
testpypi
[pypi]
repository = https://upload.pypi.org/legacy/
username = sirrobin # Replace with your PyPI username
[testpypi]
repository = https://test.pypi.org/legacy/
username = sirrobin # Replace with your TestPyPI username
You can select an index server from this config file with the --repository option:
flit publish --repository testpypi
If you don't use this option, Flit will use the server called pypi in the config file. If that doesn't exist, it uploads to PyPI at https://upload.pypi.org/legacy/ by default.
If you publish a package and you don't have a .pypirc file, Flit will create it to store your username. π«Ά
Flit tries to store your password securely using the keyring library (https://pypi.python.org/pypi/keyring). If keyring is not installed, Flit will ask for your password for each upload. Alternatively, you can also manually add your password to the .pypirc file (password = ...).
πΈ Using environment variables πΈ
You can specify a server to upload to with FLIT_INDEX_URL, and pass credentials with FLIT_USERNAME and FLIT_PASSWORD. Environment variables take precedence over the config file, except if you use the --repository option to explicitly pick a server from the config file.
This can make it easier to automate uploads, for example to release packages from a continuous integration job. π€
WARNING: Storing a password in an environment variable is convenient, but it's easy to accidentally leak it β https://www.diogomonica.com/2017/03/27/why-you-shouldnt-use-env-variables-for-secret-data/. Look out for scripts that helpfully print all environment variables for debugging, and remember that other scripts and libraries you run in that environment have access to your password. π Be careful bestie, fr fr.
π§ Reproducible builds π§
Added in version 0.8.
Wheels built by flit are reproducible: if you build from the same source code, you should be able to make wheels that are exactly identical, byte for byte. This is useful for verifying software. For more details, see reproducible-builds.org β https://reproducible-builds.org/. β¨
There is a caveat, however: wheels (which are zip files) include the modification timestamp from each file. This will probably be different on each computer, because it indicates when your local copy of the file was written, not when it was changed in version control. These timestamps can be overridden by the environment variable SOURCE_DATE_EPOCH.
SOURCE_DATE_EPOCH=$(date +%s)
flit publish
# Record the value of SOURCE_DATE_EPOCH in release notes for reproduction
Changed in version 0.12: Normalising permission bits
Flit normalises the permission bits of files copied into a wheel to either 755 (executable) or 644. This means that a file is readable by all users and writable only by the user who owns it.
The most popular version control systems only track the executable bit, so checking out the same repository on systems with different umasks (e.g. Debian and Fedora) produces files with different permissions. With Flit 0.11 and earlier, this difference would produce non-identical wheels. π
π Why use Flit? π
Make the easy things easy and the hard things possible is an old motto from the Perl community. Flit is entirely focused on the easy things part of that, and leaves the hard things up to other tools.
Specifically, the easy things are pure Python packages with no build steps (neither compiling C code, nor bundling Javascript, etc.). The vast majority of packages on PyPI are like this: plain Python code, with maybe some static data files like icons included. π
It's easy to underestimate the challenges involved in distributing and installing code, because it seems like you just need to copy some files into the right place. There's a whole lot of metadata and tooling that has to work together around that fundamental step. But with the right tooling, a developer who wants to release their code doesn't need to know about most of that. the way that justβ¦ works π
What, specifically, does Flit make easy?
flit inithelps you set up the information Flit needs about your package. π- Subpackages are automatically included: you only need to specify the top-level package. π¦
- Data files within a package directory are automatically included. Missing data files has been a common packaging mistake with other tools. π€
- The version number is taken from your package's
__version__attribute, so that always matches the version that tools like pip see. π₯ flit publishuploads a package to PyPI, so you don't need a separate tool to do this. π
Setuptools, aka the most common tool for Python packaging, has been out here adding shortcuts for a lot of the same stuff lately. But bestie, it's got baggage β it has to stay compatible with projects published literal years ago, and that lowkey limits what it can do by default. π
Flit also has some support for reproducible builds, which is a feature some people care about a lot. β¨
And there have been so many other efforts to glow-up the Python packaging user experience, like pbr (https://pypi.org/project/pbr/), but before Flit, all of those tended to build on top of setuptools and distutils. Which was a pragmatic decision, sure, but it's genuinely hard to build something radically different when you're standing on those two libraries. The existence of Flit is literally what spurred the development of new standards like PEP 518 (https://peps.python.org/pep-0518/) and PEP 517 (https://peps.python.org/pep-0517/) β and those are now used by other packaging tools such as Poetry (https://python-poetry.org/) and Enscons (https://pypi.org/project/enscons/). Main character energy fr fr. π
πΈ Other options πΈ
So if your package needs a build step, bestieβ¦ you won't be able to use Flit. π Setuptools (https://setuptools.readthedocs.io/en/latest/) is the de-facto standard for that, but newer tools such as Enscons (https://pypi.org/project/enscons/) also cover this case.
Flit also doesn't help you manage dependencies β you have to add them to pyproject.toml by hand, no autocomplete, no nothing. Tools like Poetry (https://python-poetry.org/) and Pipenv (https://pypi.org/project/pipenv/) have features which help add and update dependencies on other packages. So likeβ¦ it's giving "bring your own dependency manager", iykyk. π
π Bootstrapping π
Flit is itself packaged using Flit, and so are some foundational packaging tools such as pep517. So where do you even start if you need to install everything from source?? π¦
NOTE: For most users, pip handles all this automatically. You should only need to deal with this if you're building things entirely from scratch, such as putting Python packages into another package format.
The key piece is flit_core. This is a package which can build itself using nothing except Python and the standard library. From an unpacked source archive, you can make a wheel by running:
python -m flit_core.wheel
And then you can install this wheel with the bootstrap_install.py script included in the sdist (or by unzipping it to the correct directory):
# Install to site-packages for this Python:
python bootstrap_install.py dist/flit_core-*.whl
# Install somewhere else:
python bootstrap_install.py --installdir /path/to/site-packages dist/flit_core-*.whl
As of version 3.6, flit_core bundles the tomli TOML parser, to avoid a dependency cycle. If you need to unbundle it, you will need to special-case installing flit_core and/or tomli to get around that cycle. π
After flit_core, I recommend that you get installer (https://pypi.org/project/installer/) set up. You can use python -m flit_core.wheel again to make a wheel, and then use installer itself (from the source directory) to install it.
After that, you probably want to get build (https://pypi.org/project/build/) and its dependencies installed as the goal of the bootstrapping phase. You can then use build to create wheels of any other Python packages, and installer to install them. Chain complete, slay. βοΈβ¨
π§ Developing Flit π§
To get a development installation of Flit itself:
git clone https://github.com/pypa/flit.git
cd flit
python3 -m pip install docutils requests
python3 bootstrap_dev.py
This links Flit into the current Python environment, so you can make changes and try them without having to reinstall each time. Live-edit your own tool, iconic behaviour. π
π Testing π
To run the tests in separate environments for each available Python version:
tox
tox (https://tox.readthedocs.io/en/latest/) has many options.
To run the tests in your current environment, run:
pytest
π Release history π
β Version 3.12
- Support for license expressions using the
ANDandORoperators (:ghpull:731``). - Recognise
__version__: str = "0.1"annotated assignments when finding the version number (:ghpull:728``). - Clear error message when referring to a license file in a parent directory, which is not supported (
:ghpull:725``).
β Version 3.11
- Support for SPDX license expressions and multiple license files, as detailed in PEP 639 (https://peps.python.org/pep-0639/):
license = "BSD-3-Clause"
license-files = ["LICENSE"]
For now, only a single license identifier is allowed. More complex expressions describing multiple licenses & expressions may be supported in a future version.
- The metadata format (https://packaging.python.org/en/latest/specifications/core-metadata/) in produced packages is now version
2.4, to support the expanded license information.
β Version 3.10.1
- The sdist of
flit_corenow includes the corresponding tests (:ghpull:704``). These were missing in 3.10.
β Version 3.10
flit publishcan now use PyPI tokens stored inkeyring(:ghpull:649``), either project tokens with a 'username' likepypi_token:project:project_name(use the normalised form of the name (https://packaging.python.org/en/latest/specifications/name-normalization/)) or user tokens (pypi_token:user:username).- The
--pythonoption can now take the path of a virtualenv folder, as an alternative to a Python executable (:ghpull:667``). - Flit will work with current development versions of Pythona again (
:ghpull:684``). - The
flitcommand line package now requires Python 3.8 or above (:ghpulL:660``).flit_corestill works with Python 3.6 or above. - The metadata in packages now has the names of optional dependency groups ("extras") normalised, complying with version
2.3of the metadata standard (:ghpull:676, `:ghpull:`697). - The
flitcommand line package now depends onpip(:ghpull:647``). - Fix potential substitution of environment variables into passwords read from
.pypircfiles (:ghpull:652``). - A warning is now shown when building packages which specify the old
flit.buildapibackend, which should be replaced byflit_core.buildapi(:ghpull:674``). It's a good idea to always set a maximum version for the build requirement, to protect against changes in future major versions of Flit. - Avoid using the deprecated
datetime.utcfromtimestamp()(:ghpull:682``). - Flit now has a
SECURITY.mdfile in the Github repository (:ghpull:665``). - The tests for
flit_coreare no longer part of the installed package, reducing the size of the wheels (:ghpull:691``).
β Version 3.9
- New options
flit build --use-vcsandflit build --no-use-vcsto enable & disable including all committed files in the sdist. For now--use-vcsis the default, but this is likely to change in a future version, to bringflit buildin line with standard build frontends likepython -m build(:ghpull:625``). - Sdist file names, and the name of the top-level folder in an sdist, are now normalised, in accordance with PEP 625 (https://peps.python.org/pep-0625/) (
:ghpull:628``). - A statically defined version number can now be parsed from files called
version.py,_version.pyor__version__.pyinside a package, as well as from__init__.py, so executing code is required in fewer cases (:ghpull:630``). - Fix setting the flag for regular files in zip metadata (
:ghpull:639``). - The timestamp embedded in the gzip wrapper for sdists now defaults to a fixed date, so building an sdist twice on the same machine should produce identical results, even without any special steps (
:ghpull:635``). SettingSOURCE_DATE_EPOCHis still recommended for properly reproducible builds.
β Version 3.8
- A project name containing hyphens is now automatically translated to use underscores for the import name (
:ghpull:566``). - New option
flit install --only-depsto install the dependencies of the package, but not the package itself. - Add support for recursive globbing (
**) in sdist includes and excludes (:ghpull:550``). - Python's bytecode cache files (
__pycache__folders and.pycfiles) are now always excluded from sdists (:ghpull:581``). - Use
tomllibin Python 3.11, rather thantomli(:ghpull:573, `:ghpull:`604). - Fix crash when unable to get a password from keyring (
:ghpull:567``). - Fix including modified files in sdist when using Mercurial (
:ghpull:541``). - Fix for some cases of determining whether a package supports Python 2 or not (
:ghpull:593``). - Fix parsing version number from code using multiple assignments (
:ghpull:474``). - Document how to use a PyPI token with
FLIT_PASSWORD(:ghpull:602``). - Fix link to information about environment variables for pip (
:ghpull:576``). - Link to the docs for the latest stable version in package metadata (
:ghpull:589``). - Remove a mention of the
tomlpackage, which is no longer needed, from the Developing Flit page (:ghpull:601``). - The bootstrap install script for
flit_coreaccepts a new--install-rootoption. - Ensure the license file is included in packages on PyPI (
:ghpull:603``).
β Version 3.7.1
- Fix building packages which need execution to get the version number, and have a relative import in
__init__.py(:ghpull:531``).
β Version 3.7
- Support for external data files such as man pages or Jupyter extension support files (
:ghpull:510``). - Project names are now lowercase in wheel filenames and
.dist-infofolder names, in line with the specifications (:ghpull:498``). - Improved support for bootstrapping a Python environment, e.g. for downstream packagers (
:ghpull:511``).flit_core.wheelis usable withpython -mto create wheels before the build (https://pypi.org/project/build/) tool is available, andflit_coresdists also include a script to install itself from a wheel before installer (https://pypi.org/project/installer/) is available. - Use newer
importlibAPIs, fixing some deprecation warnings (:ghpull:499``).
πΈ Version 3.6
flit_corenow bundles thetomliTOML parser library (version 1.2.3) right inside itself (https://pypi.org/project/tomli/), so we can dodge that circular dependency betweenflit_coreandtomli(:ghpull:`492`). Bestie, this meansflit_corenow has no dependencies except Python itself, both at build time and at runtime. Bootstrapping just got so much easier, periodt π
πΈ Version 3.5.1
- Fixed development installs with
flit install --symlinkand--pth-file, which were broken in 3.5.0 π β especially for packages using asrcfolder (:ghpull:`472`).
πΈ Version 3.5
- You can now use Flit to distribute a module or package that lives inside a namespace package (as defined by PEP 420, https://peps.python.org/pep-0420/). To do it, you specify the import name of the concrete, inner module you're packaging β like
name = "sphinxcontrib.foo"β either in the[project]table, or under[tool.flit.module]if you wanna use a different name on PyPI (:ghpull:`468`). Slay. - Flit no longer generates a
setup.pyfile in sdists (.tar.gzpackages) by default (:ghpull:`462`). Modern packaging tools literally don't need it. You can use the--setup-pyflag to keep adding it for now, but it'll probably get removed at some point in the future, so don't get attached π - Fixed how
flit inithandles authors' names with non-ASCII characters (:ghpull:`460`). - When
flit initgenerates aLICENSEfile, the newpyproject.tomlnow references it (:ghpull:`467`). Obsessed.
πΈ Version 3.4
- Python 3.6 or above is now required, both for
flitandflit_core. - Added a
--setup-pyoption toflit buildandflit publish, plus a warning when neither that nor--no-setup-pyis specified (:ghpull:`431`). Heads up: a future version will stop generatingsetup.pyfiles in sdists by default. - Added support for standardised editable installs β
pip install -eβ according to PEP 660 (https://peps.python.org/pep-0660/) (:ghpull:`400`). Iconic behaviour. - Added a
--pypircoption forflit publishto specify an alternative path to a.pypircconfig file describing package indexes (:ghpull:`434`). - Fixed installing dependencies specified in a
[project]table (:ghpull:`433`). - Fixed building wheels when
SOURCE_DATE_EPOCH(see Reproducible builds) is set to a date before 1980 (:ghpull:`448`). - Switched to using the
tomliTOML parser (https://pypi.org/project/tomli/), in common with other packaging projects (:ghpull:`438`). This supports TOML version 1.0. - Added a document on Bootstrapping (
:ghpull:`441`).
πΈ Version 3.3
PKG-INFOfiles in sdists are now generated the same way asMETADATAin wheels, which fixed some issues with sdists (:ghpull:`410`).flit publishnow sends SHA-256 hashes, fixing uploads to GitLab package repositories (:ghpull:`416`).- The
[project]metadata table from PEP 621 (https://peps.python.org/pep-0621/) is now fully supported and documented. Projects using this can now specifyrequires = ["flit_core >=3.2,<4"]in the[build-system]table.
πΈ Version 3.2
- Experimental support for specifying metadata in a
[project]table inpyproject.tomlas specified by PEP 621 (https://peps.python.org/pep-0621/) (:ghpull:`393`). If you try using this, please specifyrequires = ["flit_core >=3.2.0,<3.3"]in the[build-system]table for now, in case it needs to change for the next release. - Fixed writing the
METADATAfile with multi-line information in certain fields such asAuthor(:ghpull:`402`). - Fixed building a wheel when a directory such as
LICENSESappears in the project root directory (:ghpull:`401`).
πΈ Version 3.1
- Updated handling of names & version numbers in wheel filenames and
.dist-infofolders, in line with changes in the specs (:ghpull:`395`). - Switched from the deprecated
pytomlpackage totoml(:ghpull:`378`). - Fixed specifying
backend-pathinpyproject.tomlforflit-core(as a list instead of a string).
πΈ Version 3.0
Breaking changes:
- Projects must now provide Flit with information in
pyproject.tomlfiles, not the olderflit.iniformat (:ghpull:`338`). RIPflit.iniπͺ¦ flit_coreonce again requires Python 3 (>=3.4). Packages that support Python 2 can still be built byflit_core2.x, but they can't rely on new features (:ghpull:`342`).- The deprecated
flit installfromcommand was removed (:ghpull:`334`). You can usepip install git+https://github.com/...instead.
Features and fixes:
- Fixed building sdists from a git repository with non-ASCII characters in filenames (
:ghpull:`346`). - Fixed identifying the version number when the code contains a subscript assignment before
__version__ =(:ghpull:`348`). - Script entry points can now use a class method (
:ghpull:`359`). - Set suitable permission bits on metadata files in wheels (
:ghpull:`256`). - Fixed line endings in the
RECORDfile when installing on Windows (:ghpull:`368`). - Support for recording the source of local installations, as in PEP 610 (https://peps.python.org/pep-0610/) (
:ghpull:`335`). flit initwill check for aREADMEin the root of the project and automatically set it asdescription-file(:ghpull:`337`).- Pygments is not required for checking reStructuredText READMEs (
:ghpull:`357`). - Packages where the version number can be recognised without executing their code don't need their dependencies installed to build, which should make them build faster (
:ghpull:`361`). - Ensured the installed
RECORDfile is predictably ordered (:ghpull:`366`).
πΈ Version 2.3
- New projects created with
flit initnow declare that they requireflit_core >=2,<4(:ghpull:`328`). Any projects usingpyproject.toml(notflit.ini) should be compatible with flit 3.x. - Fixed selecting files from a git submodule to include in an sdist (
:ghpull:`324`). - Fixed checking classifiers when no writeable cache directory is available (
:ghpull:`319`). - Better errors when trying to install to a mis-spelled or missing Python interpreter (
:ghpull:`331`). - Fixed specifying
--repositorybeforeupload(:ghpull:`322`). Passing the option like this is deprecated, and you should now pass it afterupload. - Documentation improvements (
:ghpull:`327`,:ghpull:`318`,:ghpull:`314`).
πΈ Version 2.2
- Allow underscores in package names with Python 2 (
:ghpull:`305`). - Added a
--no-setup-pyoption to build sdists without a backwards-compatiblesetup.pyfile (:ghpull:`311`). - Fixed the generated
setup.pyfile for packages using asrc/layout (:ghpull:`303`). - Fixed detecting when more than one file matches the module name specified (
:ghpull:`307`). - Fixed installing to a venv on Windows with the
--pythonoption (:ghpull:`300`). - Don't echo the command in scripts installed with
--symlinkor--pth-fileon Windows (:ghpull:`310`). - New
bootstrap_dev.pyscript to set up a development installation of Flit from the repository (:ghpull:`301`,:ghpull:`306`).
πΈ Version 2.1
- Use compression when adding files to wheels.
- Added the
FLIT_INSTALL_PYTHONenvironment variable (:ghpull:`295`), to configure flit to always install into a Python other than the one it's running on. flit_coreuses theintreehooksshim package to load its bootstrapping backend, until a released version of pip supports the standardbackend-pathmechanism.
πΈ Version 2.0
Flit 2 is a major architecture change, bestie. The flit_core package now provides a PEP 517 (https://peps.python.org/pep-0517/) backend for building packages, while flit is a command line interface extending that.
The build backend works on Python 2, so tools like pip should be able to install packages built with flit from source on Python 2. The flit command requires Python 3.5 or above. You will need to change the build-system table in your pyproject.toml file to look like this:
[build-system]
requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"
Other changes include:
- Support for storing your code under a
src/folder (:ghpull:`260`). You don't need to change any configuration if you do this π«Ά - Options to control what files are included in an sdist β see the Sdist section for the details.
- Requirements can specify a URL 'direct reference', as an alternative to a version number, with the syntax defined in PEP 440 (https://peps.python.org/pep-0440/):
requests @ https://example.com/requests-2.22.0.tar.gz. - Fixed the shebang of scripts installed with the
--pythonoption and the--symlinkflag (:ghpull:`286`). - Installing with
--deps developnow installs normal dependencies as well as development dependencies. - Author email is no longer required in the metadata table (
:ghpull:`289`). - More error messages are now shown without a traceback (
:ghpull:`254`).
πΈ Version 1.3
- Fix for building sdists from a subdirectory in a Mercurial repository (
:ghpull:`233`). - Fix for getting the docstring and version from modules defining their encoding (
:ghpull:`239`). - Fix for installing packages with
flit installfrom(:ghpull:`221`). - Packages with requirements no longer get a spurious
Provides-Extra: .nonemetadata entry (:ghissue:`228`). - Better check of whether
python-requiresincludes any Python 2 version (:ghpull:`232`). - Better check of home page URLs in
flit init(:ghpull:`230`). - Better error message when the description file is not found (
:ghpull:`234`). - Updated a help message to refer to
pyproject.toml(:ghpull:`240`). - Improve tests of
flit init(:ghpull:`229`).
πΈ Version 1.2.1
- Fix for installing packages with
flit install. - Making
requests_downloadan extra dependency, so we don't get a circular build dependency situation π. If you wanna useflit installfrom, you can install it withpip install flit[installfrom]. Heads up bestie: theinstallfromsubcommand is deprecated, because soon you'll be able to just usepipto install Flit projects straight from a VCS URL. Periodt.
β¨ Version 1.2 β¨
- Fixes for packages that specify
requires-extra: sdists should work now, and environment markers can be used alongsiderequires-extraπ. - Fixed running
flit installfromwhen there's no config file in the working directory. - The error message for a missing or empty docstring now tells you which file the docstring is supposed to live in. Iconic, honestly.
- Docs got better around version selectors for requirements.
πΈ Version 1.1 πΈ
- Packages can now have 'extras', specified as
requires-extrain thepyproject.tomlfile. These are extra dependencies for optional features π . - The
home-pagemetadata field is no longer required. - Additional project URLs are now validated.
flit -Vis now equivalent toflit --version.- Various documentation improvements.
π¦ Version 1.0 π¦
- The description file may now be written in reStructuredText, Markdown or plain text. The file extension should indicate which format it is (
.rst,.mdor.txt). Before this, only reStructuredText was officially supported. - Multiple links (like docs, bug tracker) can now be specified in a new
[tool.flit.metadata.urls]section ofpyproject.toml. - Dependencies are now correctly installed to the target Python when you use the
--symlinkor--pth-fileoptions. - Dependencies are only installed to the Python where Flit is running if it fails to get the docstring and version number without them.
- The commands deprecated back in 0.13 β
flit wheel,flit sdistandflit registerβ have been removed.
Okay so even though version 1.0 sounds like a big milestone moment, there's genuinely nothing that makes this release especially significant. It doesn't represent a step change in stability or completeness. Flit has been gradually maturing for a while, and the author chose this point to end the whole 0.x version number era. No cap.
π Version 0.13 π
- Better validation of several metadata fields (
dist-name,requires,requires-python,home-page), plus of the version number. - New
FLIT_ALLOW_INVALIDenvironment variable to ignore validation failures in case they go wrong. - The list of valid classifiers is now fetched from Warehouse (
https://pypi.org), rather than the olderhttps://pypi.python.orgsite. - Deprecated
flit wheelandflit sdistsubcommands: useflit buildinstead. - Deprecated
flit register: you can no longer register a package separately from uploading it.
π Version 0.12.3 π
- Fix building and installing packages with a
-in the distribution name. - Fix numbering in README. (lol, relatable)
π§ Version 0.12.2 π§
- New tool to convert
flit.initopyproject.toml:
python3 -m flit.tomlify
- Use the PAX tar format for sdists, as specified by PEP 517.
π Version 0.12.1 π
- Restore dependency on the
zipfile36backport package. - Add some missing options to the documentation of the
flit installsubcommand. - Rearrange environment variables in the docs.
β Version 0.12 β
- Switch the config to
pyproject.tomlby default instead offlit.ini, and implement the PEP 517 API. - A new
--pth-fileoption allows for development installation on Windows (where--symlinkusually won't work). - Normalise file permissions in the zip file, making builds more reproducible across different systems.
- Sdists (
.tar.gzpackages) can now also be reproducibly built by settingSOURCE_DATE_EPOCH. - For most modules, Flit can now extract the version number and docstring without importing it. It will still fall back to importing where getting these from the AST fails.
flit buildwill build the wheel from the sdist, helping to ensure that files aren't left out of the sdist.- All list fields in the INI file now ignore blank lines (
requires,dev-requires,classifiers). - Fix the path separator in the
RECORDfile of a wheel built on Windows. - Some minor fixes to building reproducible wheels.
- If building a wheel fails, the temporary file created will be cleaned up. π§Ή
- Various improvements to docs and README.
π Version 0.11.4 π
- Explicitly open various files as UTF-8, rather than relying on locale encoding.
- Link to docs from README.
- Better test coverage, and a few minor fixes for problems revealed by tests.
π Version 0.11.3 π
- Fixed a bug causing failed uploads when the password is entered in the terminal.
β¨ Version 0.11.2 β¨
- A couple of behaviour changes when uploading to warehouse.
πΈ Version 0.11.1 πΈ
- Fixed a bug when you use
flitto build an sdist from a subdirectory inside a VCS checkout. The VCS is now correctly detected. - Fix the rst checker for newer versions of docutils, by upgrading the bundled copy of
readme_renderer.
π Version 0.11 π
- Flit can now build sdists (tarballs) and upload them to PyPI, if your code is in a git or mercurial repository. There are new commands:
flit buildbuilds both a wheel and an sdist.flit publishbuilds and uploads a wheel and an sdist.
- Smarter ways of getting the information needed for upload:
- If you have the
keyringpackage installed (https://github.com/jaraco/keyring), flit can use it to store your password, rather than keeping it in plain text in~/.pypirc. - If
~/.pypircdoes not already exist, and you are prompted for your username, flit will write it into that file. - You can provide the information as environment variables:
FLIT_USERNAME,FLIT_PASSWORDandFLIT_INDEX_URL. Use this to upload packages from a CI service, for instance.
- If you have the
- Include
LICENSEorCOPYINGfiles in wheels. - Fix for
flit install --symlinkinside a virtualenv.
π¦ Version 0.10 π¦
- Downstream packagers can use the
FLIT_NO_NETWORKenvironment variable to stop flit downloading data from the network.
π Version 0.9 π
flit installandflit installfromnow take an optional--pythonargument, with the path to the Python executable you want to install it for. Using this, you can install modules to Python 2.- Installing a module normally (without
--symlink) builds a wheel and uses pip to install it, which should work better in some corner cases.
π«Ά Version 0.8 π«Ά
- A new
flit installfromsubcommand to install a project from a source archive, such as from Github. - Reproducible builds β you can produce byte-for-byte identical wheels. π₯
- A warning for non-canonical version numbers according to PEP 440 (
https://www.python.org/dev/peps/pep-0440/). - Fix for installing projects on Windows.
- Better error message when module docstring is only whitespace.
π Version 0.7 π
- A new
dev-requiresfield in the config file for development requirements, used when doingflit install. - Added a
--depsoption forflit installto control which dependencies are installed. - Flit can now be invoked with
python -m flit.
π Version 0.6 π
flit installnow ensures requirements specified inflit.iniare installed, using pip.- If you specify a description file, flit now warns you if it's not valid reStructuredText (since invalid reStructuredText is treated as plain text on PyPI).
- Improved the error message for mis-spelled keys in
flit.ini.
π§ Version 0.5 π§
- A new
flit initcommand to quickly define the essential basic metadata for a package. - Support for entry points.
- A new
flit registercommand to register a package without uploading it, for when you want to claim a name before you're ready to release. - Added a
--repositoryoption for specifying an alternative PyPI instance. - Added a
--debugflag to show debug-level log messages. - Better error messages when the module docstring or
__version__is missing.
β Version 0.4 β
- Users can now specify
dist-namein the config file if they need to use different names on PyPI and for imports. - Classifiers are now checked against a locally cached list of valid classifiers.
- Packages can be locally installed into environments for development.
- Local installation now creates a PEP 376
.dist-infofolder instead of.egg-info. - Index
- Search Page
π AUTHOR π
Thomas Kluyver
π COPYRIGHT π
2015, Thomas Kluyver
And that's the whole thing bestie, we did it π₯Ήβ¨ This page is from Flit version 3.12.0, dated Mar 30, 2025, and it's the FLIT(1) manual page. Go build something cute with it π
ππ
π¦ where this page comes from
- debian trixie: flit 3.12.0-1 Β· BSD-3-Clause
- ubuntu questing: flit 3.12.0-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms