The flit.ini config file¶
This file lives next to the module or package.
Flit 0.12 and above uses a pyproject.toml file to
store this information. Flit can still read these
flit.ini files for now,
but you should switch to
There are four required fields:
- The name of the module/package, as you’d use in an import statement.
- Your name
- Your email address
- A URL for the project, such as its Github repository.
e.g. for flit itself
[metadata] module=flit author=Thomas Kluyver email@example.com home-page=https://github.com/takluyver/flit
The remaining fields are optional:
A list of other packages from PyPI that this package needs. Each package should be on its own line, and may be followed by a version specifier in parentheses, like
(>=4.1), and/or an environment marker after a semicolon. For example:
requires = requests (>=2.6) configparser; python_version == '2.7'
Packages that are required for development. This field is in the same format as
These are not (yet) encoded in the wheel, but are used when doing
- A path (relative to the .ini file) to a file containing a longer description of your package to show on PyPI. This should be written in reStructuredText, if your long description is not valid reStructuredText, a warning will be printed, and it will be interpreted as plain text on PyPI.
- A list of Trove classifiers, one per line, indented.
- A version specifier for the versions of Python this requires, e.g.
>=3.3,<4which are equivalents.
- If you want your package’s name on PyPI to be different from the importable module name, set this to the PyPI name.
- Space separated list of words to help with searching for your package.
- The name of a license, if you’re using one for which there isn’t a Trove classifier. It’s recommended to use Trove classifiers instead of this in most cases.
- maintainer, maintainer-email
- Like author, for if you’ve taken over a project from someone else.
Here’s the full example from flit itself:
[metadata] author=Thomas Kluyver firstname.lastname@example.org home-page=https://github.com/takluyver/flit requires=requests requires-python= >=3 description-file=README.rst classifiers=Intended Audience :: Developers License :: OSI Approved :: BSD License Programming Language :: Python :: 3 Topic :: Software Development :: Libraries :: Python Modules
Each key and value in this describes a shell command to be installed along with your package. These work like setuptools ‘entry points’. Here’s the section for flit:
[scripts] flit = flit:main
This will create a
flit command, which will call the function