Skip to content

andrewpetrochenkov/setup-dist.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()
)

readme42.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages