diff --git a/talks/structuring/example_project/setup.py b/talks/structuring/example_project/setup.py index 2705d1a462d040d82471e2e0f8dfbc36687d744f..a984015b8f7241a13f6647f51533d29d04cbd748 100644 --- a/talks/structuring/example_project/setup.py +++ b/talks/structuring/example_project/setup.py @@ -1,12 +1,22 @@ #!/usr/bin/env python from setuptools import setup +from setuptools import find_packages +# Import version number from +# the project package (see +# the section on versioning). from mypackage import __version__ +# Read in requirements from +# the requirements.txt file. with open('requirements.txt', 'rt') as f: requirements = [l.strip() for l in f.readlines()] +# Generate a list of all of the +# packages that are in your project. +packages = find_packages() + setup( name='Example project', @@ -16,6 +26,8 @@ setup( author_email='pauldmccarthy@gmail.com', license='Apache License Version 2.0', + packages=packages, + version=__version__, install_requires=requirements, diff --git a/talks/structuring/structuring.ipynb b/talks/structuring/structuring.ipynb index db36137c9ee40cafd37980f1bc31ae9b31a8c3c3..4de692ad196cc0ba52c1510f1f22997c8fbfa2a8 100644 --- a/talks/structuring/structuring.ipynb +++ b/talks/structuring/structuring.ipynb @@ -154,6 +154,7 @@ "> #!/usr/bin/env python\n", ">\n", "> from setuptools import setup\n", + "> from setuptools import find_packages\n", ">\n", "> # Import version number from\n", "> # the project package (see\n", @@ -165,6 +166,10 @@ "> with open('requirements.txt', 'rt') as f:\n", "> requirements = [l.strip() for l in f.readlines()]\n", ">\n", + "> # Generate a list of all of the\n", + "> # packages that are in your project.\n", + "> packages = find_packages()\n", + ">\n", "> setup(\n", ">\n", "> name='Example project',\n", @@ -174,6 +179,8 @@ "> author_email='pauldmccarthy@gmail.com',\n", "> license='Apache License Version 2.0',\n", ">\n", + "> packages=packages,\n", + ">\n", "> version=__version__,\n", ">\n", "> install_requires=requirements,\n", diff --git a/talks/structuring/structuring.md b/talks/structuring/structuring.md index f47c3279a07255e83eb9d405162afe1a629e40a7..f03bfc6883504bf9f421ee5293eeefc887816fcb 100644 --- a/talks/structuring/structuring.md +++ b/talks/structuring/structuring.md @@ -148,6 +148,7 @@ The `setup.py` for our example project might look like this: > #!/usr/bin/env python > > from setuptools import setup +> from setuptools import find_packages > > # Import version number from > # the project package (see @@ -159,6 +160,10 @@ The `setup.py` for our example project might look like this: > with open('requirements.txt', 'rt') as f: > requirements = [l.strip() for l in f.readlines()] > +> # Generate a list of all of the +> # packages that are in your project. +> packages = find_packages() +> > setup( > > name='Example project', @@ -168,6 +173,8 @@ The `setup.py` for our example project might look like this: > author_email='pauldmccarthy@gmail.com', > license='Apache License Version 2.0', > +> packages=packages, +> > version=__version__, > > install_requires=requirements,