Add autometa keyword to setuptools.setup for automatic version, description and long_desctiption
Project description
To use it, pass module (without .py), or package name as autometa keyword argument for setup():
#! /usr/bin/env python from setuptools import setup setup( autometa='test', name='Test', packages=['test'], ... )
For example following package’s __init__.py:
"""First line of docstring. Many more lines of docstring. """ __version__ = '1.2.3.dev0' # alternatively: (1, 2, 3, 'dev0')
Is equivalent to writing:
setup( version='1.2.3.dev0', description='First line of docstring', long_description='Many\nmore\nlines\nof\ndocstring.' ... )
It will parse specified module file or package’s __init__.py and set version to its __version__ attribute, description to first line of its docstring, and long_description to the rest of the docstring. Additionally build_sphinx command’s version and release will be set.
NOTE: Please note, that version is parsed by running ast.literal_eval on the right side of assignment to __version__, so keep in mind that it can only be a string literal, or a list/tuple of string/integer literals.
NOTE: Setuptools-Autometa assumes PEP 0257 compliant docstrings, that is first line has to end with a period and be separated from description by a blank line.
Additionally you can whitelist which fields are to be parsed by using autometa_fields keyword argument and setting it to an iterable of field names (‘description’, ‘long_description’, ‘version’).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for Setuptools-Autometa-0.1.1.post0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c9d9bf4faaf63231f40bfd13a440e7e31b5e49e2134c70bc7edd703d9d11f43 |
|
MD5 | 0ab86081f376638ac8a66016cd047f87 |
|
BLAKE2b-256 | 5d5d659e060bca8bb106cd02a90229b1befef582c84642858534e57f21223d55 |
Hashes for Setuptools_Autometa-0.1.1.post0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5f2f427fb3c9cb63c16f86e27de6a3f6b576767fa2f2fc50312831679cead39 |
|
MD5 | 21a9773ba9b281627fde0ed3be6ec112 |
|
BLAKE2b-256 | c4d9a67518160bf7b624e7bb9543526c754e55c5bb42ce26069ae2f414f827fd |
Hashes for Setuptools_Autometa-0.1.1.post0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3493c5943055753cf2c09af83198a34bc7cc9b3c39977e6c9206868aae324d3 |
|
MD5 | 833d27c7852a720d4e8fbc696ffd1676 |
|
BLAKE2b-256 | 74e2f96a242be2b42fbaa5cd58a55a3d3e8d825b803e59b268f8caedcd04fe7e |