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_RELEASES_URL = 'https://api.github.com/repos/joinmarket-ng/joinmarket-ng/releases/latest'
module-attribute
VERSION = __version__
module-attribute
__version__ = '0.32.0'
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
140 141 142 143 144 145 | |
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 makes an HTTP request to the GitHub API. When socks_proxy is provided, the request is routed through the given SOCKS5 proxy (e.g. Tor).
Privacy note: This contacts GitHub and reveals your IP (or Tor exit node).
Only call this when the user has explicitly opted in via check_for_updates.
Args: socks_proxy: Optional SOCKS5 proxy URL (e.g. "socks5h://127.0.0.1:9050"). 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
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 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 | |
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
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
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
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
get_version() -> str
Return the current version string.
Source code in jmcore/src/jmcore/version.py
28 29 30 | |
get_version_info() -> dict[str, str | int]
Return version information as a dictionary.
Source code in jmcore/src/jmcore/version.py
116 117 118 119 120 121 122 123 124 | |
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
110 111 112 113 | |