Skip to content

Commit

Permalink
setup.py: Detect if libuv submodule has not been checked out
Browse files Browse the repository at this point in the history
  • Loading branch information
1st1 committed Jun 25, 2018
1 parent ba25d8b commit dd8060d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,17 @@ def _libuv_build_env():


def _libuv_autogen(env):
if not os.path.exists(os.path.join(LIBUV_DIR, 'configure')):
subprocess.run(
['/bin/sh', 'autogen.sh'], cwd=LIBUV_DIR, env=env, check=True)
if os.path.exists(os.path.join(LIBUV_DIR, 'configure')):
# No need to use autogen, the configure script is there.
return

if not os.path.exists(os.path.join(LIBUV_DIR, 'autogen.sh')):
raise RuntimeError(
'the libuv submodule has not been checked out; '
'try running "git submodule init; git submodule update"')

subprocess.run(
['/bin/sh', 'autogen.sh'], cwd=LIBUV_DIR, env=env, check=True)


class uvloop_sdist(sdist):
Expand Down

0 comments on commit dd8060d

Please sign in to comment.