From a817a01ff9877df9443154faf18a5ebc33257574 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Mon, 19 Feb 2018 20:31:45 +0000 Subject: [PATCH] specify packages --- talks/structuring/example_project/setup.py | 12 ++++++++++++ talks/structuring/structuring.ipynb | 7 +++++++ talks/structuring/structuring.md | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/talks/structuring/example_project/setup.py b/talks/structuring/example_project/setup.py index 2705d1a..a984015 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 db36137..4de692a 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 f47c327..f03bfc6 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, -- GitLab