Skip to content

Commit

Permalink
Add a docstring to BuildKey
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaretnikov committed Nov 28, 2023
1 parent aa4598d commit 36da8f0
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions conda-store-server/conda_store_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@


class BuildKey:
# Avoids a cyclic dependency between the orm module and the module defining
# CondaStore.build_key_version. Because the orm module is loaded early on
# startup, we want to delay initialization of the Build.build_key_version
# field until CondaStore.build_key_version has been read from the config.
"""
Used to configure the build key format, which identifies a particular
environment build
Avoids a cyclic dependency between the `orm` module and the module defining
`CondaStore.build_key_version`. Because the `orm` module is loaded early on
startup, we want to delay initialization of the `Build.build_key_version`
field until `CondaStore.build_key_version` has been read from the config.
Because the build key version needs to be the same for the entire
application, this class implements the singleton pattern. Users are expected
to use class methods instead of creating class instances. All implementation
details are hidden within the class, preventing potential issues caused by
cyclic imports.
"""

# Default version, must be None here. Initialized in CondaStore.build_key_version
_current_version = None
Expand Down

0 comments on commit 36da8f0

Please sign in to comment.