Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions tb_plugin/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@
import setuptools
import subprocess

def get_version():
with open("version.txt", encoding="utf-8") as f:
version = f.read().strip()

def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, rel_path)) as fp:
return fp.read()


def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
version = line.split(delim)[1]

if os.getenv('TORCH_TB_PROFILER_BUILD_VERSION'):
version = os.getenv('TORCH_TB_PROFILER_BUILD_VERSION')
return version


INSTALL_REQUIRED = [
"pandas >= 1.0.0",
"tensorboard >= 1.15, !=2.1.0"
Expand All @@ -30,6 +40,7 @@ def get_version():
"gs": ["google-cloud-storage"]
}


class build_fe(setuptools.Command):
"""Build the frontend"""
description = "run yarn build on frontend directory"
Expand All @@ -50,9 +61,10 @@ def run(self):
# restore the working directory
os.chdir(cwd)


setuptools.setup(
name="torch_tb_profiler",
version=get_version(),
version=get_version(os.path.join('torch_tb_profiler', '__init__.py')),
description="PyTorch Profiler TensorBoard Plugin",
long_description="PyTorch Profiler TensorBoard Plugin : \
https://github.com/pytorch/kineto/tree/master/tb_plugin",
Expand Down
2 changes: 2 additions & 0 deletions tb_plugin/torch_tb_profiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
# --------------------------------------------------------------------------

# Entry point for Pytorch TensorBoard plugin package.

__version__ = "0.1.0"
1 change: 0 additions & 1 deletion tb_plugin/version.txt

This file was deleted.