Skip to content
Greg Flynn edited this page Nov 7, 2019 · 12 revisions

Setup.py

This is a basic setup.py file for making a package pip installable

from setuptools import setup

setup(
    name="PackageName",
    version="1.2.3a1",
    description="What is the package",
    author="Greg Flynn",
    author_email="gregf36665@gmail.com",
    packages=['Directory']
)

Specify git repos as a requirement (And call out version)

setup(
    ...
    install_requires = ['LogHandlerUtilities @ git+ssh://git@github.com/Lakenheath/LogHandlerUtilities.git@2.0.1']
)

Note this uses ssh. See SSH for tips and tricks to make life easier

script vs package

In a setup.py file both packages and scripts can be specified

setup(
    packages=['foo', 'bar'],
    scripts=['spam.py']
)

If a script is selected then it can be run from the command line or treated as a package

todo add optional build methods

look into python setup.py build python setup.py install

Requirements.txt

todo

Clone this wiki locally