Meta tags:
Headings (most frequently used words):
navigation, packaging, entry, points, project, files, installation, contents, quick, search,
Text of the page (most frequently used words):
the (17), hello (13), project (8), entry (7), click (7), points (6), python (6), you (5), #packaging (4), your (4), command (4), install (4), package (4), executable (4), script (4), with (4), pyproject (4), toml (4), contents (3), venv (3), installer (3), will (3), create (3), scripts (3), cli (3), file (3), using (2), next (2), previous (2), navigation (2), installation (2), files (2), world (2), should (2), pip (2), use (2), line (2), part (2), name (2), that (2), import (2), function (2), flit_core (2), build (2), requires (2), system (2), and (2), run (2), how (2), another (2), users (2), documentation (2), copyright, 2014, pallets, created, sphinx, quick, search, setuptools, integration, virtualenv, overview, afterwards, available, bin, activate, when, installed, based, configuration, during, development, can, editable, mode, option, remember, virtual, environment, magic, section, each, identifies, one, first, before, equals, sign, generated, second, path, followed, colon, call, buildapi, backend, dependencies, description, version, echo, prints, greeting, def, src, __init__, app, point, all, need, here, example, directory, installers, specified, these, are, known, knows, regardless, operating, work, linux, windows, macos, etc, distribution, describe, built, into, might, upload, this, pypi, distribute, way, whl, recommended, write, utilities, installable, packages, instead, telling, index,
Text of the page (random words):
packaging entry points click documentation 8 5 x navigation index next previous click documentation 8 5 x packaging entry points packaging entry points it s recommended to write command line utilities as installable packages with entry points instead of telling users to run python hello py a distribution package is a whl file you install with pip or another python installer you use a pyproject toml file to describe the project and how it is built into a package you might upload this package to pypi or distribute it to your users in another way python installers create executable scripts that will run a specified python function these are known as entry points the installer knows how to create an executable regardless of the operating system so it will work on linux windows macos etc project files to install your app with an entry point all you need is the script and a pyproject toml file here s an example project directory hello project src hello __init__ py hello py pyproject toml contents of hello py import click click command def cli prints a greeting click echo hello world contents of pyproject toml project name hello version 1 0 0 description hello cli requires python 3 11 dependencies click 8 1 project scripts hello hello hello cli build system requires flit_core 4 build backend flit_core buildapi the magic is in the project scripts section each line identifies one executable script the first part before the equals sign is the name of the script that should be generated the second part is the import path followed by a colon with the function to call the click command installation when your package is installed the installer will create an executable script based on the configuration during development you can install in editable mode using the e option remember to use a virtual environment python m venv venv venv bin activate pip install e afterwards your command should be available hello hello world contents packaging entry points project files installation navigation overview previous virtualenv next setuptools integration quick search copyright 2014 pallets created using sphinx 9 1 0
|