A Simplified setup.py for Python Packages! Keep your setup.py
organized with a simple ini-config-file.
Example:
[General]
name: mypackage
version: scm
description: My package
long_description: file://README.md
url: https://github.com/LowieHuyghe/my-package
license: MIT
keywords: my, package
requirements: file://requirements.txt
[Author]
name: Lowie Huyghe
email: [email protected]
[Classifiers]
status: 3
programming_languages: Python 2, Python 2.7, Python 3, Python 3.3, Python 3.4, Python 3.5
audiences: Developers
topics: Build Tools
license: MIT
[Setup]
requirements: setuptools_scm
[Tests]
requirements: mock, nose
suite: nose.collector
[Packages]
include: mypackage*
exclude: tests*
[Commands]
my_command: ./bin/my-command.sh
my_command-description: This is my command
- Go to your project directory
- Add this project as a squashed subtree:
git subtree add --prefix setup [email protected]:LowieHuyghe/python-simplified-setup-py.git master --squash
# To update:
git subtree pull --prefix setup [email protected]:LowieHuyghe/python-simplified-setup-py.git master --squash
- Copy the example-files to your project
cp ./setup/setup.example.py ./setup.py
cp ./setup/setup.config.example.ini ./setup.config.ini
cp ./setup/MANIFEST.example.in ./MANIFEST.in
- Change
setup.config.ini
to your likings:
- Setup-kwargs that expect plain string:
[Section]
key: plain text value
key: file://README.md # Read from file
- Setup-kwargs that expect lists:
[Section]
key: plain, text, comma, separated
key: file://requirements.txt # Read from file. Each line is an item in the list.
- Debug the generated setup kwargs with:
python setup.py --debug
You can use the setup.py as you normally would:
python setup.py test