You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by fg...@apache.org on 2019/01/23 17:56:32 UTC

[incubator-sdap-ningesterpy] 09/29: force conda packages to be installed during setup install

This is an automated email from the ASF dual-hosted git repository.

fgreg pushed a commit to branch v1.0.0-rc1
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ningesterpy.git

commit 58662414a942b9b68fe29cb5f1621a1a047253df
Author: Frank Greguska <fr...@jpl.nasa.gov>
AuthorDate: Thu Jan 25 17:08:40 2018 -0800

    force conda packages to be installed during setup install
---
 README.md              |  3 ---
 README.rst             |  5 +++++
 conda-requirements.txt |  3 +++
 requirements.txt       |  3 ---
 setup.py               | 22 ++++++++++++++++++----
 5 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md
deleted file mode 100644
index 6089814..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# ningesterpy
-
-Python modules for processing of NEXUS tiles.
\ No newline at end of file
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..cac6d46
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,5 @@
+================
+ ningesterpy
+================
+
+Python modules for processing of NEXUS tiles.
\ No newline at end of file
diff --git a/conda-requirements.txt b/conda-requirements.txt
new file mode 100644
index 0000000..76b02be
--- /dev/null
+++ b/conda-requirements.txt
@@ -0,0 +1,3 @@
+scipy=0.18.1
+nco=4.7.1
+netcdf4=1.3.1
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
index b96700c..e38f214 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,12 +1,9 @@
 werkzeug=0.12.2
 flask=0.12.2
 flask-accept==0.0.4
-nco==4.7.1
-netCDF4==1.3.1
 nexusproto===1.0.1-SNAPSHOT
 numpy==1.12.1
 protobuf==3.2.0
 pytz==2017.2
 PyYAML==3.12
-scipy==0.18.1
 six==1.10.0
diff --git a/setup.py b/setup.py
index fc16fbb..7943669 100644
--- a/setup.py
+++ b/setup.py
@@ -14,20 +14,34 @@
 # limitations under the License.
 
 from setuptools import setup, find_packages
+from subprocess import check_call, CalledProcessError
 
-__version__ = '0.1'
+try:
+    check_call(['conda', 'info'], stdout=None, stderr=None)
+except CalledProcessError as e:
+    raise EnvironmentError("This module requires conda") from e
+
+try:
+    with open('conda-requirements.txt') as f:
+        conda_requirements = f.readlines()
+    check_call(['conda', 'install', '-y', *conda_requirements])
+except (CalledProcessError, IOError) as e:
+    raise EnvironmentError("Error installing conda packages") from e
+
+__version__ = '1.0.0-SNAPSHOT'
 
 setup(
     name="ningesterpy",
     version=__version__,
     url="https://github.com/apache/incubator-sdap-ningesterpy",
 
-    author="Frank Greguska",
+    author="dev@sdap.apache.org",
+    author_email="dev@sdap.apache.org",
 
     description="Python modules that can be used for NEXUS ingest.",
-    long_description=open('README.md').read(),
+    long_description=open('README.rst').read(),
 
-    packages=find_packages(),
+    packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
     test_suite="tests",
     platforms='any',