Skip to content

Commit 4e4bcc4

Browse files
authored
bump version to 0.5.1
fix dynamic version retrieval from `pyproject.toml`
2 parents d7a778a + fe41ad9 commit 4e4bcc4

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tool.poetry]
22
name = "ScreenPro2"
33
description = "Flexible analysis of high-content CRISPR screening"
4+
version = "0.5.1"
45
authors = [
56
"Abe Arab <abea@arcinstitute.org>"
67
]

screenpro/__init__.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,20 @@
3030
from .assays import PooledScreens, GImaps
3131
from .dashboard import DrugScreenDashboard
3232

33-
__version__ = "0.5.1"
33+
34+
def _get_version():
35+
36+
import os
37+
38+
pyproject_path = os.path.join(os.path.dirname(__file__), "..", "pyproject.toml")
39+
40+
with open(pyproject_path, "r") as pyproject_file:
41+
for line in pyproject_file.readlines():
42+
if "version" in line:
43+
return line.split("=")[1].strip().strip('"')
44+
45+
46+
try:
47+
__version__ = _get_version()
48+
except Exception:
49+
__version__ = "Unknown"

0 commit comments

Comments
 (0)