From 5365a2ccf864865170463a5e4a3c6bd96a95dfcc Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 19 Sep 2022 19:09:58 +0800 Subject: [PATCH] small fixes --- CMakeLists.txt | 2 +- scripts/conda-cpu/sherpa/meta.yaml | 2 +- setup.py | 48 ++++++++++++++++-------------- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b61099e8f..7eb55b017 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(sherpa) # Remember to change # scripts/conda-cpu/sherpa/meta.yaml -set(SHERPA_VERSION "0.9") +set(SHERPA_VERSION "0.9.1") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") diff --git a/scripts/conda-cpu/sherpa/meta.yaml b/scripts/conda-cpu/sherpa/meta.yaml index 9904103b2..3705eacf8 100644 --- a/scripts/conda-cpu/sherpa/meta.yaml +++ b/scripts/conda-cpu/sherpa/meta.yaml @@ -1,6 +1,6 @@ package: name: sherpa - version: "0.9" + version: "0.9.1" source: path: "{{ environ.get('SHERPA_ROOT_DIR') }}" diff --git a/setup.py b/setup.py index 3e463a737..5f2b1359e 100644 --- a/setup.py +++ b/setup.py @@ -14,29 +14,31 @@ is_windows, ) -if "K2_INSTALL_PREFIX" not in os.environ: - try: - import k2 # noqa - except ImportError: - sys.exit( - """Please install k2 first. See -https://k2-fsa.github.io/sherpa/python/installation/index.html -for details.""" - ) - - del k2 - -if "KALDIFEAT_INSTALL_PREFIX" not in os.environ: - try: - import kaldifeat # noqa - except ImportError: - sys.exit( - """Please install kaldifeat first. See -https://k2-fsa.github.io/sherpa/python/installation/index.html -for details.""" - ) - - del kaldifeat + +if sys.argv[1] != "sdist": + if "K2_INSTALL_PREFIX" not in os.environ: + try: + import k2 # noqa + except ImportError: + sys.exit( + """Please install k2 first. See + https://k2-fsa.github.io/sherpa/python/installation/index.html + for details.""" + ) + + del k2 + + if "KALDIFEAT_INSTALL_PREFIX" not in os.environ: + try: + import kaldifeat # noqa + except ImportError: + sys.exit( + """Please install kaldifeat first. See + https://k2-fsa.github.io/sherpa/python/installation/index.html + for details.""" + ) + + del kaldifeat if sys.version_info < (3,):