Skip to content

Instantly share code, notes, and snippets.

@atalv
Created April 19, 2020 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atalv/c3749c4ed45c7535d5034d9c8c663d2d to your computer and use it in GitHub Desktop.
Save atalv/c3749c4ed45c7535d5034d9c8c663d2d to your computer and use it in GitHub Desktop.
Sample setup.py configuration for creating a Python Wheel/Egg
from setuptools import setup, find_packages
setup(
#this will be the package name you will see, e.g. the output of 'conda list' in anaconda prompt
name = '<some name of the distribution>',
#some version number you may wish to add - increment this after every update
version='1.0',
# Use one of the below approach to define package and/or module names:
#if there are only handful of modules placed in root directory, and no packages/directories exist then can use below syntax
# packages=[''], #have to import modules directly in code after installing this wheel, like import mod2 (respective file name in this case is mod2.py) - no direct use of distribution name while importing
#can list down each package names - no need to keep __init__.py under packages / directories
# packages=['<list of name of packages>'], #importing is like: from package1 import mod2, or import package1.mod2 as m2
#this approach automatically finds out all directories (packages) - those must contain a file named __init__.py (can be empty)
packages=find_packages(), #include/exclude arguments take * as wildcard, . for any sub-package names
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment