Registry / devops / read-version

read-version

JSON →
library0.3.2pypypi✓ verified 86d ago

Extract your project's __version__ variable by parsing Python source code without importing. Version 0.3.2, project is inactive and no longer supported.

pip install read-version
INSTALL
IMPORT
SIG · READ-VERSION
R
read-version
devopspythonv0.3.2
Install
1.8s avg
Import
667ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.722s · 18.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.612s · 19MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

read_version
from read_version import read_version
correct import path

Read __version__ from a Python package without importing it.

from read_version import read_version version = read_version('mypackage') print(version)
Debug
Known issues
deprecatedProject is inactive and no longer supported. Use alternatives like importlib.metadata or pkg_resources.
fix
Switch to importlib.metadata.version('your_package') or from importlib.metadata import version
affects: >=0.3.2
gotchaBefore v0.3.1, importing read_version could trigger a deprecation warning about distutils if setuptools was not imported first.
fix
Upgrade to v0.3.1+ or explicitly import setuptools before read_version: import setuptools; from read_version import read_version
affects: <0.3.1
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'read_version'
Library not installed or misspelled.
fix
Install with: pip install read-version
AttributeError: module 'read_version' has no attribute 'read_version'
Wrong import pattern.
fix
Use 'from read_version import read_version' instead of 'import read_version'
Upgrade
Version history
0.3.2latest on PyPI · released Jul 25, 2021
Audit
Dependencies
setuptoolsrequiredRequired to avoid distutils import warnings
Agent activity
2 hits · last 30 days
node
2
Resources
read-version — pip install read-version · libregistry