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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sier2_blocks_config-0.1-py2.py3-none-any.whl.
File metadata
- Download URL: sier2_blocks_config-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.7 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
086abdd1d80dc2d15a281105411d3302b37bd5d871cf61bff684e4254f7eaa75
|
|
| MD5 |
466658b748d446a0ac1ce40b2e372384
|
|
| BLAKE2b-256 |
c81fae335e586970f02e5fb5bcd6cd53ed565e02df7c9adf2b85983b9eb04954
|