Skip to content

Commit 83481f5

Browse files
authored
fix stubs version check (Netflix#1748)
1 parent 46e3ce8 commit 83481f5

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ main.js.map
2929
# Pycharm
3030
.idea
3131

32+
stubs/version.py

stubs/MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include metaflow-stubs/**/*.pyi
22
include metaflow-stubs/py.typed
33
include metaflow-stubs/generated_for.txt
4+
include version.py

stubs/setup.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import os
2+
import shutil
13
from setuptools import setup
24

3-
with open("../metaflow/version.py", mode="r") as f:
5+
source_file = "../metaflow/version.py"
6+
destination_file = "./version.py"
7+
8+
if not os.path.exists(destination_file):
9+
shutil.copy(source_file, destination_file)
10+
11+
with open(destination_file, mode="r") as f:
412
version = f.read().splitlines()[0].split("=")[1].strip(" \"'")
513

614
setup(

0 commit comments

Comments
 (0)