setup module for distributions: python -m setup_dist sdist --dist-dir=<dist_dir>
Project description
Installation
$ [sudo] pip install setup-dist
Concept
pypi/prod setup.py
without unnecessary metadata (keywords
, description
, long_description
, classifiers
, url
, etc)
Pros
- less production code and commits
How it works
project metadata is stored in the distribution PKG-INFO
file
Usage
$ usage: python -m setup_dist ...
Features
key | default value | environment variable |
---|---|---|
name |
os.path.basename(os.getcwd()).split(".")[0].lower() |
SETUP_NAME |
version |
None |
SETUP_VERSION |
packages |
setuptools.find_packages() |
SETUP_PACKAGES |
install_requires |
requirements.txt lines |
SETUP_INSTALL_REQUIRES or SETUP_INSTALL_REQUIRES_FILE |
classifiers |
classifiers.txt lines |
SETUP_CLASSIFIERS or SETUP_CLASSIFIERS_FILE |
scripts |
scripts/ files |
SETUP_SCRIPTS |
keywords |
None |
SETUP_KEYWORDS or SETUP_KEYWORDS_FILE |
description |
None |
SETUP_DESCRIPTION |
long_description |
README.md or README.rst content |
SETUP_LONG_DESCRIPTION or SETUP_LONG_DESCRIPTION_FILE |
license |
None |
SETUP_LICENSE |
url |
None |
SETUP_URL |
Examples
dist_dir="$(mktemp -d)"
export SETUP_VERSION="42"
export SETUP_DESCRIPTION="Answer to the Ultimate Question of Life, the Universe, and Everything"
python -m setup_dist sdist --dist-dir="$dist_dir" 1> /dev/null
twine upload
sdist="$(find "$dist_dir" -type f -name "*.tar.gz")"
twine upload --config-file=~/.pypirc "$sdist"
pypi/prod setup.py
import setuptools
setuptools.setup(
name='NAME',
install_requires=open('requirements.txt').read().splitlines(),
packages=setuptools.find_packages()
)
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
setup-dist-2020.12.3.tar.gz
(2.6 kB
view hashes)