File tree Expand file tree Collapse file tree 3 files changed +21
-8
lines changed
Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def run(self):
3939
4040
4141setup (
42- name = " torchplot" ,
42+ name = torchplot . __name__ ,
4343 version = torchplot .__version__ ,
4444 description = torchplot .__docs__ ,
4545 long_description = long_description ,
@@ -65,6 +65,7 @@ def run(self):
6565 "Operating System :: OS Independent" ,
6666 # Specify the Python versions you support here. In particular, ensure
6767 # that you indicate whether you support Python 2, Python 3 or both.
68- "Programming Language :: Python :: 3"
68+ "Programming Language :: Python :: 3" ,
6969 ],
70+ cmdclass = {"clean" : CleanCommand },
7071)
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def test_cpu(test_case):
5858def test_gpu (test_case ):
5959 """ test that it works on gpu """
6060 assert tp .plot (
61- test_case .x .cuda () if isinstance (test_case .x , torch .Tensor ) else test_case .x ,
62- test_case .y .cuda () if isinstance (test_case .y , torch .Tensor ) else test_case .y ,
63- "."
61+ test_case .x .cuda () if isinstance (test_case .x , torch .Tensor ) else test_case .x ,
62+ test_case .y .cuda () if isinstance (test_case .y , torch .Tensor ) else test_case .y ,
63+ "." ,
6464 )
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2- """Root package info."""
32import os
43import time
54
5+ __name__ = "torchplot"
66_this_year = time .strftime ("%Y" )
77__version__ = "0.1.5"
88__author__ = "Nicki Skafte Detlefsen et al."
99__author_email__ = "[email protected] " 1010__license__ = "Apache-2.0"
1111__copyright__ = f"Copyright (c) 2018-{ _this_year } , { __author__ } ."
1212__homepage__ = "https://github.com/CenterBioML/torchplot"
13-
1413__docs__ = "Plotting pytorch tensors made easy"
1514
1615PACKAGE_ROOT = os .path .dirname (__file__ )
1716PROJECT_ROOT = os .path .dirname (PACKAGE_ROOT )
1817
19- from .core import *
18+ try :
19+ # This variable is injected in the __builtins__ by the build process
20+ _ = None if __TORCHPLOT_SETUP__ else None
21+ except NameError :
22+ __TORCHPLOT_SETUP__ : bool = False
23+
24+
25+ if __TORCHPLOT_SETUP__ :
26+ import sys # pragma: no-cover
27+
28+ sys .stdout .write (f"Partial import of `{ __name__ } ` during the build process.\n " ) # pragma: no-cover
29+ # We are not importing the rest of the package during the build process, as it may not be compiled yet
30+ else :
31+ from .core import *
You can’t perform that action at this time.
0 commit comments