Skip to content

Commit 89a3fe7

Browse files
committed
Bump version to 0.4.1
Add __version__ to main module's __init__
1 parent 1301703 commit 89a3fe7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

onnx2pytorch/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
from .convert import ConvertModel
2+
3+
__version__ = "0.4.1"

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
import os
23
from setuptools import setup, find_packages
34

45
try:
@@ -7,12 +8,19 @@
78
except IOError:
89
long_description = ""
910

11+
# Extract version. Cannot import directly because of import error.
12+
root_dir = os.path.dirname(__file__)
13+
with open(os.path.join(root_dir, "onnx2pytorch/__init__.py"), "r") as f:
14+
for line in f.readlines():
15+
if line.startswith("__version__"):
16+
version = line.split("=")[-1].strip().strip('"')
17+
break
1018

1119
PACKAGES = find_packages(exclude=("tests.*", "tests"))
1220

1321
setup(
1422
name="onnx2pytorch",
15-
version="0.4.0",
23+
version=version,
1624
description="Library to transform onnx model to pytorch.",
1725
license="apache-2.0",
1826
author="Talmaj Marinc",

0 commit comments

Comments
 (0)