Skip to content

Commit

Permalink
fix stubs version check (#1748)
Browse files Browse the repository at this point in the history
  • Loading branch information
madhur-ob authored Feb 20, 2024
1 parent 46e3ce8 commit 83481f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ main.js.map
# Pycharm
.idea

stubs/version.py
1 change: 1 addition & 0 deletions stubs/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include metaflow-stubs/**/*.pyi
include metaflow-stubs/py.typed
include metaflow-stubs/generated_for.txt
include version.py
10 changes: 9 additions & 1 deletion stubs/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import os
import shutil
from setuptools import setup

with open("../metaflow/version.py", mode="r") as f:
source_file = "../metaflow/version.py"
destination_file = "./version.py"

if not os.path.exists(destination_file):
shutil.copy(source_file, destination_file)

with open(destination_file, mode="r") as f:
version = f.read().splitlines()[0].split("=")[1].strip(" \"'")

setup(
Expand Down

0 comments on commit 83481f5

Please sign in to comment.