setup.cfg from python dict
Project description
Install
$ [sudo] pip install setupcfg
Features
python -m setupcfg
autogenerate setup.cfg :setupcfg.Setupcfg
class- dict, attr access. string, dict representation
load(path)
,save(path)
methods
setup.cfg
known sections and keys ordering
Usage
usage: python -m setupcfg
+ /usr/local/bin/python3 setupcfg.py --help
Examples
python -m setupcfg
autogenerate setup.cfg
# environment variables (metadata, options known keys)
$ export CLASSIFIERS="file: path/to/classifiers.txt"
$ export DESCRIPTION="project description"
$ export KEYWORDS="key1 key2"
$ python -m setupcfg > setup.cfg
setupcfg.Setupcfg
class
>>> import setupcfg
>>> medatata = dict(name="pkgname", version"0.0.1")
>>> options = dict(packages=["pkgname"])
>>> cfg = setupcfg.Setupcfg(metadata=medatata, options=options)
string/dict representation
>>> str(cfg) # string representation
[metadata]
name = pkgname
version = 0.0.1
[options]
packages =
pkgname
>>> dict(cfg) # dict representation
{'metadata':{...},'options':{...}}
load(path)
, save(path)
>>> cfg.load("setup.cfg")
>>> cfg.save("setup.cfg")
setupcfg.get(section, option=None, default=None)
>>> setupcfg.get("metadata") # section dict
{'name':'pkgname',...}
>>> setupcfg.get("metadata","name") # option value
'pkgname'
>>> setupcfg.get("options","scripts",[]) # option default value
[]
default values
.
├── requirements.txt (req1, req2)
├── module.py
├── package
| └── __init__.py
├── scripts
| └── script
├── setup.py
name
- repo basenamescripts
- files inscripts/
folderspackages
-setuptools.find_packages()
py_modules
- python files in repo rootinstall_requires
-install_requires
,requirements.txt
,requires.txt
content
Links
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
setupcfg-0.0.3.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for setupcfg-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d9f7f10d0c3d03432c4ec2388c7f2a1fa1a21b648e522c66ce8d0795aec2cb1 |
|
MD5 | ae2db74d3c081e736577d19c5ef78847 |
|
BLAKE2b-256 | 8006685ec23699d486e4f7a069a481fc90aa725956d0c56b8eec72a57ace8f86 |