Confuse is a configuration library for Python that uses YAML. It takes care of
defaults, overrides, type checking, command-line integration, environment
variable support, human-readable errors, and standard OS-specific locations.
Here is what Confuse brings to the table:
- An utterly sensible API resembling dictionary-and-list structures but
providing transparent validation without lots of boilerplate code. Type
config['num_goats'].get(int) to get the configured number of goats and ensure
that it is an integer.
- Combine configuration data from multiple sources. Using layering, Confuse
allows user-specific configuration to seamlessly override system-wide
configuration, which in turn overrides built-in defaults. An in-package
config_default.yaml can be used to provide bottom-layer defaults using the
same syntax that users will see. A runtime overlay allows the program to
programmatically override and add configuration values.
- Look for configuration files in platform-specific paths. Like $XDG_CONFIG_HOME
or ~/.config on Unix; "Application Support" on macOS; %APPDATA% on Windows.
Your program gets its own directory, which you can use to store additional
data. You can transparently create this directory on demand if, for example,
you need to initialize the configuration file on first run. And an environment
variable can be used to override the directory's location.
- Integration with command-line arguments via argparse or optparse from the
standard library. Use argparse's declarative API to allow command-line options
to override configured defaults.
- Include configuration values from environment variables. Values undergo
automatic type conversion, and nested dicts and lists are supported.
NOTE: If this package has multiple flavors (see below), then use one of them instead of the name specified above. NOTE: This is a Python port. Instead of py312-confuse listed in the above command, you can pick from the names under the Packages section.
all: remove explicit versions in USES=python for "3.x+"
The logic in USES=python will automatically convert this to 3.8+ by
itself.
Adjust two ports that only had Python 3.7 mentioned but build fine
on Python 3.8 too.
finance/quickfix: mark BROKEN with PYTHON
libtool: compile: c++ -DHAVE_CONFIG_H -I. -I../.. -I -I. -I.. -I../.. -I../C++
-DLIBICONV_PLUG -DPYTHON_MAJOR_VERSION=3 -Wno-unused-variable
-Wno-maybe-uninitialized -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong
-fno-strict-aliasing -DLIBICONV_PLUG -Wall -ansi
-Wno-unused-command-line-argument -Wpointer-arith -Wwrite-strings
-Wno-overloaded-virtual -Wno-deprecated-declarations -Wno-deprecated -std=c++0x
-MT _quickfix_la-QuickfixPython.lo -MD -MP -MF
.deps/_quickfix_la-QuickfixPython.Tpo -c QuickfixPython.cpp -fPIC -DPIC -o
.libs/_quickfix_la-QuickfixPython.o
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean
'-Wno-uninitialized'? [-Wunknown-warning-option]
QuickfixPython.cpp:175:11: fatal error: 'Python.h' file not found
^~~~~~~~~~
1 warning and 1 error generated.
Reviewed by: portmgr, vishwin, yuri
Differential Revision: <https://reviews.freebsd.org/D40568>
Remove WWW entries moved into port Makefiles
Commit b7f05445c00f has added WWW entries to port Makefiles based on
WWW: lines in pkg-descr files.
This commit removes the WWW: lines of moved-over URLs from these
pkg-descr files.
Approved by: portmgr (tcberner)
Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.
Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.
There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.
(Only the first 15 lines of the commit message are shown above )
audio/beets: add missing dependency.
Add devel/py-confuse to the tree since audio/beets needs it.
PR: 243601
Approved by: portmgr (blanket: missing dependency), tcberner (mentor)
MFH: 2019Q1