Skip to content

Commit 0d18141

Browse files
committed
+ conda branch
1 parent 97574ae commit 0d18141

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

setup.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
from os.path import exists
2+
13
from setuptools import setup
24

3-
with open("VERSION") as file: # Created in CI
4-
version = file.readline()
5+
if exists("VERSION"): # GitHub Actions
6+
with open("VERSION") as file:
7+
version = file.readline()
8+
elif exists("PKG-INFO"): # Conda
9+
with open("PKG-INFO") as file:
10+
for line in file:
11+
if line.startswith("Version: "):
12+
version = line[9:]
13+
break
14+
else: raise FileNotFoundError("Can't find the version number")
515

616
setup(
717
name="Isconna",

0 commit comments

Comments
 (0)