Skip to main content

Configuration for sier2-blocks.

Project description

This package provides configuration options for Sier2 blocks.

Sier2 can be used in a variety of environments. However, these enviroments may require different softwre configurations, For example, when using map tiles on the Internet, a default tile provider can be used, but on a private network, a caching tile provider may be preferred.

By placing configuration options in a separate package, blocks can be used in different environments without having to make environment-specific changes to block code. Instead, changes can be confined to an environment-specific copy of sier2-blocks-config.

Configurations are looked up using the Python entry points specification (see https://packaging.python.org/en/latest/specifications/entry-points/#entry-points). This is the same mechanism that sier2 uses to find blocks. The entry point name is sier2.config. Packages that provide the entry point implement a function that returns a config dictionary, and specify the following section in pyproject.toml.

[project.entry-points."sier2.config"]
export = "sier2_blocks_config:config"

A convenience function called get_block_config() is provided by sier2. This function looks up the entry point, calls the config function, and returns the dictionary.

The returned dictionary can contain arbitrary keys and values. One top-level string key must be present: ‘config’ provides the name of the environment that this package is intended for. This copy of the package provides the name ‘public’; other copies may provide names such as ‘corporate’ or ‘private’. In this way, it easier to quickly determine which copy of the package is installed, and make it easier to track a possible cause of broken functionality.

If no config package is found, or more than one config package is found, get_block_config() will produce a warning (using warnings.warn()), and a default config will be returned, with the ‘config’ key having the value None.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sier2_blocks_config-0.1-py2.py3-none-any.whl (3.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sier2_blocks_config-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sier2_blocks_config-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 086abdd1d80dc2d15a281105411d3302b37bd5d871cf61bff684e4254f7eaa75
MD5 466658b748d446a0ac1ce40b2e372384
BLAKE2b-256 c81fae335e586970f02e5fb5bcd6cd53ed565e02df7c9adf2b85983b9eb04954

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page