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 details)
File details
Details for the file setup-dist-2020.12.3.tar.gz
.
File metadata
- Download URL: setup-dist-2020.12.3.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6aac23d67fb096433d3f73abbc2f29948d7dc3d28398cde8be1e7dac5686eb66 |
|
MD5 | 4ecf22b3aac1262eb0a90a4cf1cc806b |
|
BLAKE2b-256 | 508192f2a823e45abecfd4d751075aad8ef605a6d080cd148b9ee4bc753b89ea |