Skip to content

Commit

Permalink
Special case setup.py for sdist
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictus committed Mar 9, 2023
1 parent 59fe4f6 commit 886a511
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import os.path
import pathlib
import sys

import numpy
import pkgconfig
Expand All @@ -9,14 +10,16 @@
from setuptools import Extension, setup

ARCH = os.uname().machine
deps = pkgconfig.parse("zlib openssl libpng")

deps = {}
if "sdist" not in sys.argv:
deps = pkgconfig.parse("zlib openssl libpng")

if not pathlib.Path("src", ARCH, "libkent.a").exists():
raise RuntimeError(
f"src/{ARCH}/libkent.a not found. "
"Please run `make build-ucsc`."
)
if not pathlib.Path("src", ARCH, "libkent.a").exists():
raise RuntimeError(
f"src/{ARCH}/libkent.a not found. "
"Please run `make build-ucsc`."
)


def get_extension_modules():
Expand All @@ -37,7 +40,10 @@ def get_extension_modules():
**deps,
),
]
return cythonize(ext_modules)
if "sdist" in sys.argv:
return ext_modules
else:
return cythonize(ext_modules)


setup(
Expand Down

0 comments on commit 886a511

Please sign in to comment.