inferred_env_var
can now infer additional parameter data from theEnv
annotation metadata.SchemaEnvVars
can now be initialized withargs=...
to use all keyword arguments withEnv
annotations as arguments.
- Fixed type annotations for
LookupParser.case_insensitive
- added
AbsoluteName
to create env vars with names that never have a prefix
- fixed code snippets around documentation
envolved
no longer supports python 3.7
FindIterCollectionParser
with_prefix
can now override many of an env-var's parameters
CollectionParser
'sopener
andcloser
arguments now correctly handle matches that would be split by the delimiterCollectionParser
'scloser
argument now correctly handles overlapping matchesCollectionParser
'scloser
argument is now faster when using non-regex matchesCollectionParser.pair_wise_delimited
will now be more memory efficient when using a mappingvalue_type
- fixed some documentation typos
- this is the last release to support python 3.7
BoolParser
is now a subclass ofLookupParser
- environment sys-hooks can now handle invalid arguments gracefully
- update formatter to ruff 0.3.0
- unittests now automatically run on all supported platforms
- using sluth for documentation
- single-environment variable can now be given additional arguments, that are passed to the parser.
- env-var defaults can now be wrapped in a
Factory
to allow for a default Factory.
- type annotation correctness is no longer supported for python 3.7
- Fixed some typos in the documentation
- The children of envvars that are excluded from the description are now also excluded.
- new argument
strip_items
forCollectionParser
. - new arguments
strip_keys
andstrip_values
forCollectionParser.pairwise_delimited
. missing
,as_default
,no_patch
, anddiscard
consts are now available in theenvolved
namespace.- envvar descriptions can now also be a sequence of strings to denote multiple paragraphs.
- many new options for describing env vars
- inferred env vars can now be used for parameters that don't have a type hint, so long as the default and type are provided.
- the default
case_sensitive
value forinferred_env_var
s is nowFalse
instead ofTrue
. - envvars create with
with_prefix
are now correctly added to the description - calling
describe_env_vars
without any envvars defined no longer raises an error
- changed documentation theme with furo
- usage of the
basevar
andinfer_env_var
modules is deprecated - usage of the
envvar
function to create inferred envvars is deprecated
- changed type of
args
to be an invariantMapping
instead of adict
- fixed type hint for auto-typed env vars.
- Single env vars can now accept pydantic models and type adapters, they will be parsed as jsons.
- added
py.typed
file to the package. - added
inferred_env_var
to the rootenvolved
namespace. - schema env vars can now have keyword arguments passed to their
get
method, to add values to the schema. - new parse:
LookupParser
, as a faster alternative toMatchParser
(that does not support regex matches).
- the special parser of
Enum
s is nowLookupParser
instead ofMatchParser
.
exclude_from_description
now ignores inferred env vars.
inferred_env_var
to explicitly infer the type, name and default value of an env var.pos_args
to allow for positional arguments in a schema.discard
default value for schema args, which discards an argument from the schema if the value is missing.MatchParser
to return values from discrete matches. This is now the default parser for Mappings and Enums.Optional
s can now be used as parsers- added official support for python 3.11 and 3.12
- auto-typed env vars are deprecated, use
infer_env_var
instead.
- fixed possible race condition when reloading the environment parser, causing multiple reloads.
- significantly improved performance for case-insensitive env var repeat retrieval.
- use ruff + black for formatting
This release is a complete overhaul of the project. Refer to the documentation for details.
- Partial Schema error is no longer triggered from default members
- Env Vars no longer default to case sensitive if not uppercase.
- Env vars can now be supplied with
prefix_capture
, causing them to become a prefix env var. - all env vars can now be supplied with the optional
description
keyword argument. describe_env_vars
to make a best-effort attempt to describe all the environment variables defined.raise_for_partial
parameter for schema vars, to not accept partially filled schemas, regardless of default value.
- The caching mechanism from basic vars has been removed
env_parser.reload
- the parser is now self-updating!MappingEnvVar
- useSchema(dict, ...)
instead- The same envvar cannot be used twice in the same schema anymore
- The environment parsing is now self-updating, no more need to manually reload the environment when testing.
- When manifesting
EnvVar
s, additional keyword arguments can be provided. - When creating a schema, you can now omit the factory type to just use a
SimpleNamespace
. - Validators can now be used inside a schema class.
- Validators can now be static methods.
- EnvVar children can now overwrite template parameters.
- EnvVar template can be without a name.
BoolParser
's parameters now all have default values.
- Inner variables without a default value would act as though given a default value.
- If the variadic annotation of
__new__
and__init__
would disagree, we would have__new__
's win out, this has been corrected. EnvVar
is now safe to use both as a parent and as a manifest- EnvVar validators now correctly transition to children
- added examples page
- removed recordclasses dependency
- initial release