jmcore.version
jmcore.version
Centralized version management for JoinMarket NG.
This is the single source of truth for the project version. All components inherit their version from here.
Attributes
GITHUB_LATEST_STABLE_URL = 'https://github.com/joinmarket-ng/joinmarket-ng/releases/latest'
module-attribute
GITHUB_RELEASE_TAG_PATH = '/joinmarket-ng/joinmarket-ng/releases/tag/'
module-attribute
VERSION = __version__
module-attribute
__version__ = '0.42.1'
module-attribute
logger = logging.getLogger(__name__)
module-attribute
Classes
UpdateCheckResult
dataclass
Result of a GitHub update check.
Source code in jmcore/src/jmcore/version.py
182 183 184 185 186 187 | |
Attributes
is_newer: bool
instance-attribute
latest_version: str
instance-attribute
Functions:
check_for_updates_from_github(socks_proxy: str | None = None, timeout: float = 30.0) -> UpdateCheckResult | None
async
Check GitHub for the latest release and compare with the local version.
This function requests GitHub's latest-release permalink through the provided Tor SOCKS5 proxy. It skips the check when no proxy is provided or the proxy transport cannot be configured. A clearnet request is never attempted.
Privacy note: This contacts GitHub, which sees the Tor exit node IP. Only
call this when the user has explicitly opted in via check_for_updates.
Args: socks_proxy: Tor SOCKS5 proxy URL (e.g. "socks5h://127.0.0.1:9050"). When omitted, the update check is skipped. timeout: HTTP request timeout in seconds.
Returns: UpdateCheckResult with the latest version and whether it is newer, or None if the check failed for any reason.
Source code in jmcore/src/jmcore/version.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
exit_if_version_requested(args: Sequence[str]) -> None
Handle an eager version request without loading CLI configuration.
Stop at the option separator so positional values are not interpreted as flags. Other arguments retain their existing entry-point behavior.
Source code in jmcore/src/jmcore/version.py
36 37 38 39 40 41 42 43 44 45 46 47 | |
get_build_ref() -> str | None
Return the branch or tag the package was built from, if known.
Populated by setup.py from the JOINMARKET_BUILD_REF environment
variable (set by install.sh) or, as a fallback, the local git
branch/tag when building from a working tree. Non-editable installs
that lack both leave this as None; callers should treat that as
"unknown" rather than "stable".
Source code in jmcore/src/jmcore/version.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
get_commit_hash() -> str | None
Return the short git commit hash, or None if unavailable.
Resolution order:
jmcore._build_info.COMMIT-- written at wheel build time bysetup.py. This is the only source that survives non-editable installs (pip install git+..., Docker, release wheels) where the package directory has no.git.- Live
git rev-parse --short HEADfrom the package directory. Works for editable installs (pip install -e) where the source tree retains its working.git. Nonewhen neither source produced a hash.
Source code in jmcore/src/jmcore/version.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
get_version() -> str
Return the current version string.
Source code in jmcore/src/jmcore/version.py
31 32 33 | |
get_version_info() -> dict[str, str | int]
Return version information as a dictionary.
Source code in jmcore/src/jmcore/version.py
133 134 135 136 137 138 139 140 141 | |
get_version_tuple() -> tuple[int, int, int]
Return the version as a tuple of (major, minor, patch).
Source code in jmcore/src/jmcore/version.py
127 128 129 130 | |