File tree 3 files changed +21
-8
lines changed
3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def run(self):
39
39
40
40
41
41
setup (
42
- name = " torchplot" ,
42
+ name = torchplot . __name__ ,
43
43
version = torchplot .__version__ ,
44
44
description = torchplot .__docs__ ,
45
45
long_description = long_description ,
@@ -65,6 +65,7 @@ def run(self):
65
65
"Operating System :: OS Independent" ,
66
66
# Specify the Python versions you support here. In particular, ensure
67
67
# that you indicate whether you support Python 2, Python 3 or both.
68
- "Programming Language :: Python :: 3"
68
+ "Programming Language :: Python :: 3" ,
69
69
],
70
+ cmdclass = {"clean" : CleanCommand },
70
71
)
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def test_cpu(test_case):
58
58
def test_gpu (test_case ):
59
59
""" test that it works on gpu """
60
60
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
+ "." ,
64
64
)
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
- """Root package info."""
3
2
import os
4
3
import time
5
4
5
+ __name__ = "torchplot"
6
6
_this_year = time .strftime ("%Y" )
7
7
__version__ = "0.1.5"
8
8
__author__ = "Nicki Skafte Detlefsen et al."
9
9
__author_email__ = "[email protected] "
10
10
__license__ = "Apache-2.0"
11
11
__copyright__ = f"Copyright (c) 2018-{ _this_year } , { __author__ } ."
12
12
__homepage__ = "https://github.com/CenterBioML/torchplot"
13
-
14
13
__docs__ = "Plotting pytorch tensors made easy"
15
14
16
15
PACKAGE_ROOT = os .path .dirname (__file__ )
17
16
PROJECT_ROOT = os .path .dirname (PACKAGE_ROOT )
18
17
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