NiPreps Versions
raw JSON → 1.2.0 verified Fri May 01 auth: no python
Version schemes and utilities for NiPreps tools (NiPreps version 1.2.0). Provides standardized versioning logic (pep440, semver, git-based) for neuroimaging preprocessing workflows. Released irregularly as needed.
pip install nipreps-versions Common errors
error ModuleNotFoundError: No module named 'nipreps_versions' ↓
cause Package not installed or installed under different name (e.g., 'nipreps-versions' with hyphen).
fix
Install via pip install nipreps-versions; import uses underscores.
error TypeError: 'VersionInfo' object does not support indexing ↓
cause Trying to access VersionInfo like a tuple (common pre-1.0 behavior).
fix
Use ver.version attribute (a tuple) instead of ver[0].
Warnings
gotcha VersionInfo.from_git() requires the package to be in a git repository. In deployed/installed environments, use VersionInfo.from_installed() or plain constructor. ↓
fix Use VersionInfo version string directly or VersionInfo.from_installed() for installed packages.
gotcha The library uses Python 3.10+ only. Projects on older Python versions will get ImportError. ↓
fix Upgrade to Python >=3.10 or pin nipreps-versions to version <1.0.0 (if available).
breaking In version 1.0.0, the API changed: VersionInfo no longer inherits from tuple. Comparisons may behave differently. ↓
fix Use .version tuple property or explicit comparison methods.
Imports
- nipreps_versions
import nipreps_versions - VersionInfo wrong
from nipreps_versions.version import VersionInfocorrectfrom nipreps_versions import VersionInfo
Quickstart
from nipreps_versions import VersionInfo
# Parse a version string
ver = VersionInfo('1.2.0')
print(ver)
# Get version from a git repository (requires git)
# ver = VersionInfo.from_git()
# Check PEP 440 compliance
print(ver.is_pep440)