From d4b3061d5fb833c84f74545e08fd3217f17d3a22 Mon Sep 17 00:00:00 2001 From: Cody Piersall Date: Sun, 13 Sep 2020 13:35:36 -0500 Subject: [PATCH] Fix source release: include mbedTLS source... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And do not automatically `rm -rf` the `nng` and `mbedtls` directories if they are present. This will make developing pynng more error-prone--it will be easier to accidentally build against a stale library--but it is the Right Thing™ and allows source distributions to build. --- MANIFEST.in | 1 + pynng/_version.py | 2 +- setup.py | 22 ++++++++++------------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index df58cf3..bf15100 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,6 +2,7 @@ include *.sh *.py *.bat 8.txt *.md include *.h include LICENSE.txt recursive-include nng * +recursive-include mbedtls * recursive-include test *.py recursive-include pynng *.py prune nng/build diff --git a/pynng/_version.py b/pynng/_version.py index eb6ad29..42065f4 100644 --- a/pynng/_version.py +++ b/pynng/_version.py @@ -1,3 +1,3 @@ # This file is imported from __init__.py and exec'd from setup.py -__version__ = "0.6.1" +__version__ = "0.6.2" diff --git a/setup.py b/setup.py index edbdba4..46c3a11 100644 --- a/setup.py +++ b/setup.py @@ -34,12 +34,11 @@ def build_mbedtls(cmake_args): """ do = check_call - if os.path.exists('mbedtls'): - _rmdir('mbedtls') - do('git clone --recursive {}'.format(MBEDTLS_REPO), shell=True) - # for local hacking, just copy a directory (network connection is slow) - # do('cp -r ../mbedtls mbedtls', shell=True) - do('git checkout {}'.format(MBEDTLS_REV), shell=True, cwd='mbedtls') + if not os.path.exists('mbedtls'): + do('git clone --recursive {}'.format(MBEDTLS_REPO), shell=True) + # for local hacking, just copy a directory (network connection is slow) + # do('cp -r ../mbedtls mbedtls', shell=True) + do('git checkout {}'.format(MBEDTLS_REV), shell=True, cwd='mbedtls') cwd = 'mbedtls/build' os.mkdir(cwd) cmake_cmd = ['cmake'] + cmake_args @@ -64,12 +63,11 @@ def build_nng(cmake_args): """ do = check_call - if os.path.exists('nng'): - _rmdir('nng') - do('git clone {}'.format(NNG_REPO), shell=True) - # for local hacking, just copy a directory (network connection is slow) - # do('cp -r ../nng-clean nng', shell=True) - do('git checkout {}'.format(NNG_REV), shell=True, cwd='nng') + if not os.path.exists('nng'): + do('git clone {}'.format(NNG_REPO), shell=True) + # for local hacking, just copy a directory (network connection is slow) + # do('cp -r ../nng-clean nng', shell=True) + do('git checkout {}'.format(NNG_REV), shell=True, cwd='nng') os.mkdir('nng/build') cmake_cmd = ['cmake'] + cmake_args cmake_cmd += [