very new idea / very not working yet / come back later
npm init
but for Python. Takes a Python script (or a collection thereof) and generates a nice neat package with a setup.py
Before | After |
---|---|
thingy.py |
thingy/__init__.py |
imported_file.py |
thingy/imported_file.py |
setup.py |
- Dependencies
- Imports are parsed to find local imports, e.g. if
import thingy
in code andthingy.py
exists in directory - If imports aren't found locally, add to setup's
install_requires
- Could also check PyPI and output warning if package doesn't exist
- Imports are parsed to find local imports, e.g. if
- Setup fields
name
: Defaults to input entry filename, minus.py
version
: Defaults to 0.1.0 (not sure about this)description
: No default, prompt userlong_description
: Defaults to README content if existslong_description_content_type
: 'text/markdown' ifREADME.md
, etc.url
: Defaults to git remote if exists, otherwise promptauthor
: Defaults to git config name, otherwise promptauthor_email
: Defaults to git config email, otherwise promptpython_requires
: Prompt user for minimum Python 3 version, default to 3.3classifiers
: Listed here- '
Programming Language :: Python :: {version}
' for every version allowed bypython_requires
- Prompt for '
Development Status
' and 'License
'
- '