How to deploy a python / hy package

You can pip install from the local git repo by putting the following in requirements.txt:


Notice the different format to what git itself uses to point to a remote repository. It’s also possible to install direct from the local source tree, e.g.:

python -m pip install /src/program

This last way may be the easiest, doing versioning on the git server and installing from /src.

python-for-hpc says:

A Python project will consist of a root directory with the name of the project. Somewhere inside this will be included a directory which will constitute the main installable package. Most often this has the same name as the project (This is not compulsory but makes things a bit simpler. Inside that package directory, alongside your python files, create a file called This file can be empty, and it denotes the directory as a python package. When you pip install, this directory will be installed and become importable.

A simple project may have this structure:

├── graphics
│   ├──
│   └── screen.hy
├── pyproject.toml
└── setup.cfg
name = graphics
author = Name
author_email = name@some.domain
version = 0.1.2
description = A simple ncurses UI class
url = https://some.domain

python_requires = >= 3.8
include_package_data = True
package_dir = 
packages = find:

# if a command-line utility is required
console_scripts =
    cmd-line-util = graphics.some-module:some-module

where = 

* = *.hy
# pyproject.toml
requires = [
  "setuptools >= 40.9.0",
build-backend = "setuptools.build_meta"

This means pip will throw away the top-level stuff (README etc.).

The same source goes on to recommend setuptools to make the package installable, provide package metadata, dependencies etc.

The python docs tutorials recommend setup.cfg as a simpler static alternative. However could allow using the git tag as a version.


installing packages

packaging packages