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
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, default=None)
>>> setupcfg.get("metadata","name")
'pkgname'
>>> setupcfg.get("options","scripts",[])
[]
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.2.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for setupcfg-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7148622f4f5feb41f5291a255566994e0c9de12ef4b9c2366340cc722d4f081e |
|
MD5 | 70fdd0e5ae199a480bf94e080becc73b |
|
BLAKE2b-256 | 81c977d73ff27d7f584d41982a734af429e90cea50630093bb4b7ec68e0cf033 |