Skip to content

Commit 75f4130

Browse files
committed
drops mac support for now
1 parent e264be1 commit 75f4130

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

setup.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def get_extensions():
9494
third_party_search_directories = []
9595

9696
runtime_library_dirs = None
97-
if sys.platform.startswith('linux') or sys.platform.startswith('darwin'):
97+
if sys.platform.startswith('linux'):
9898
sources = sources + source_image_cpu
9999
libraries.append('png')
100100
third_party_search_directories.append(os.path.join(cwd, "third_party/libpng"))
@@ -222,7 +222,7 @@ def throw_of_failure(command):
222222

223223
def build_deps():
224224
this_dir = os.path.dirname(os.path.abspath(__file__))
225-
if sys.platform.startswith('linux') or sys.platform.startswith('darwin'):
225+
if sys.platform.startswith('linux'):
226226
cpu_count = multiprocessing.cpu_count()
227227
os.chdir("third_party/zlib/")
228228
throw_of_failure('cmake .')
@@ -232,8 +232,6 @@ def build_deps():
232232
zlib_path = os.path.join(this_dir, "third_party/zlib")
233233
if sys.platform.startswith("linux"):
234234
libpng_cmake_options = "-DPNG_BUILD_ZLIB=ON -DPNG_STATIC=OFF -DZLIB_INCLUDE_DIR:PATH={zlib_path} -DZLIB_LIBRARY:FILEPATH={zlib_path}/libz.so".format(zlib_path=zlib_path)
235-
if sys.platform.startswith("darwin"):
236-
libpng_cmake_options = "-DPNG_BUILD_ZLIB=ON -DPNG_STATIC=OFF -DZLIB_INCLUDE_DIR:PATH={zlib_path} -DZLIB_LIBRARY:FILEPATH={zlib_path}/libz.dylib".format(zlib_path=zlib_path)
237235
os.chdir("third_party/libpng/")
238236
os.system('cmake {} .'.format(libpng_cmake_options))
239237
throw_of_failure("cmake --build . -- -j {}".format(cpu_count))
@@ -253,14 +251,6 @@ def build_ext_with_dependencies(self):
253251
'third_party/libpng/libpng.so'])
254252
]
255253

256-
if sys.platform.startswith('darwin'):
257-
data_files = [
258-
('torchvision/lib', [
259-
'third_party/zlib/libz.dylib',
260-
'third_party/libpng/libpng.dylib'])
261-
]
262-
263-
264254
setup(
265255
# Metadata
266256
name=package_name,

test/test_image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import torch
66
from PIL import Image
7-
if sys.platform.startswith('linux') or sys.platform.startswith("darwin"):
7+
if sys.platform.startswith('linux'):
88
from torchvision.io.image import read_png, decode_png
99
import numpy as np
1010

@@ -21,14 +21,14 @@ def get_images(directory, img_ext):
2121

2222

2323
class ImageTester(unittest.TestCase):
24-
@unittest.skipUnless(sys.platform.startswith("linux") or sys.platform.startswith("darwin"), "Support only available on linux for now.")
24+
@unittest.skipUnless(sys.platform.startswith("linux"), "Support only available on linux for now.")
2525
def test_read_png(self):
2626
for img_path in get_images(IMAGE_DIR, ".png"):
2727
img_pil = torch.from_numpy(np.array(Image.open(img_path)))
2828
img_lpng = read_png(img_path)
2929
self.assertTrue(torch.equal(img_lpng, img_pil))
3030

31-
@unittest.skipUnless(sys.platform.startswith("linux") or sys.platform.startswith("darwin"), "Support only available on linux for now.")
31+
@unittest.skipUnless(sys.platform.startswith("linux"), "Support only available on linux for now.")
3232
def test_decode_png(self):
3333
for img_path in get_images(IMAGE_DIR, ".png"):
3434
img_pil = torch.from_numpy(np.array(Image.open(img_path)))

0 commit comments

Comments
 (0)