:package: :snake: setup.py generator
Project description
Installation
$ [sudo] pip install setuppy-generator
Pros
setup.py
generator- create multiple setup.py files - dev/prod, github/pypi, etc
- python classes/cli
Features
key |
file/environment variable |
---|---|
name |
current directory basename or $SETUP_NAME |
version |
$SETUP_VERSION |
url |
$SETUP_URL |
classifiers |
classifiers.txt , $SETUP_CLASSIFIERS |
description |
$SETUP_DESCRIPTION |
keywords |
$SETUP_KEYWORDS |
long_description |
README.md /README.rst , $SETUP_LONG_DESCRIPTION |
long_description_content_type |
text/markdown if long_description is .md file |
install_requires |
requirements.txt , $SETUP_INSTALL_REQUIRES |
packages |
setuptools.find_packages() , $SETUP_PACKAGES |
py_modules |
python files in a current directory, $SETUP_PY_MODULES |
scripts |
scripts/* files, $SETUP_SCRIPTS |
Classes
class | __doc__ |
---|---|
setuppy_generator.BaseGenerator |
abstract generator class |
setuppy_generator.Generator |
generator class |
Executable modules
usage | __doc__ |
---|---|
python -m setuppy_generator |
create setup.py |
Examples
project-name.py/
├── classifiers.txt
├── module.py
├── package
| └── __init__.py
├── README.md
├── requirements.txt
└── scripts
└── script
$ cd path/to/project-name.py
$ export SETUP_VERSION="1.0.0"
$ python -m setuppy_generator > setup.py
setup(
name='project-name',
version='1.0.0',
classifiers = [...],
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
install_requires=['req1','req2'],
packages=['pkgname'],
py_modules=['module'],
scripts=['scripts/script']
)
example #2 - environment variables
$ export SETUP_URL="https://github.com/owner/repo"
$ export SETUP_CLASSIFIERS="classifiers.txt"
$ export SETUP_DESCRIPTION="description ..."
$ export SETUP_KEYWORDS="key1 key2"
$ export SETUP_LONG_DESCRIPTION="README.md"
$ export SETUP_INSTALL_REQUIRES="requirements.txt"
$ export SETUP_PACKAGES="package1 package2"
$ export SETUP_PY_MODULES="module1 module2"
$ export SETUP_SCRIPTS="scripts/script1 scripts/script2"
$ python -m setuppy_generator > setup.py
setup(
name='project-name',
version='1.0.0',
url='https://github.com/owner/repo',
classifiers = [...],
description='description ...',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
keywords='key1 key2',
install_requires=['req1','req2'],
packages=['package1','package2'],
py_modules=['module1','module2'],
scripts=['scripts/script1','scripts/script2']
)
open(path).read()
function:
$ export SETUP_VERSION="open('.config/version.txt').read().split()"
$ export SETUP_DESCRIPTION="open('.config/description.txt').read().split()"
$ export SETUP_KEYWORDS="open('.config/keywords.txt').read().split(' ')"
$ python -m setuppy_generator > setup.py
setup(
...
version=open('.config/version.txt').read().split(),
description=open('.config/description.txt').read().split(),
keywords=open('.config/keywords.txt').read().split(' '),
...
)
example #3 - minimal setup.py
$ export SETUP_CLASSIFIERS=""
$ export SETUP_DESCRIPTION=""
$ export SETUP_KEYWORDS=""
$ export SETUP_LONG_DESCRIPTION=""
$ export SETUP_URL=""
$ python -m setuppy_generator > setup.py
setup(
name='project-name',
version='1.0.0',
install_requires=['req1','req2'],
packages=['pkgname'],
py_modules=['module'],
scripts=['scripts/script']
)
Related projects
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
Close
Hashes for setuppy-generator-2019.10.24.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fba73587b55bde32151c3756ae9b7d3382092ae2b71216b3695661c892f581eb |
|
MD5 | 4da26408983c36c3a46198ae38a529b5 |
|
BLAKE2b-256 | 1299a80c47fbf07e93f306581f4c0cc465614522228fee868e9cc469ae2ff77b |