You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by sk...@apache.org on 2022/08/22 15:32:58 UTC

[incubator-sdap-nexus] 01/06: Fixed apidocs bug

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

skperez pushed a commit to branch proxy-bugfix-apidocs
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git

commit 32784eb954f738811a70224605f0c00e12c86f52
Author: skorper <st...@gmail.com>
AuthorDate: Tue Aug 9 14:11:00 2022 -0700

    Fixed apidocs bug
---
 analysis/setup.py                                  | 10 +++-
 .../webservice/algorithms/doms/DatasetListQuery.py |  2 +-
 analysis/webservice/apidocs/__init__.py            |  0
 .../nexus_tornado/app_builders/NexusAppBuilder.py  |  3 +-
 analysis/webservice/pyproject.toml                 | 70 ++++++++++++++++++++++
 analysis/webservice/redirect/RedirectHandler.py    |  3 +-
 6 files changed, 82 insertions(+), 6 deletions(-)

diff --git a/analysis/setup.py b/analysis/setup.py
index 663d9bd..0897ca2 100644
--- a/analysis/setup.py
+++ b/analysis/setup.py
@@ -50,8 +50,14 @@ setuptools.setup(
     #    'webservice.nexus_tornado.request.renderers'
     #],
     package_data={
-        'webservice': ['config/web.ini', 'config/algorithms.ini'],
-        'webservice.algorithms.doms': ['domsconfig.ini.default']
+        'webservice': [
+            'config/web.ini',
+            'config/algorithms.ini',
+            'apidocs/index.html',
+            'apidocs/openapi.yml',
+            'apidocs/dataset-populate.js'
+        ],
+        'webservice.algorithms.doms': ['domsconfig.ini.default'],
     },
     data_files=[
         ('static', ['static/index.html'])
diff --git a/analysis/webservice/algorithms/doms/DatasetListQuery.py b/analysis/webservice/algorithms/doms/DatasetListQuery.py
index ed0ca7e..79a89bd 100644
--- a/analysis/webservice/algorithms/doms/DatasetListQuery.py
+++ b/analysis/webservice/algorithms/doms/DatasetListQuery.py
@@ -34,7 +34,7 @@ class DomsDatasetListQueryHandler(BaseDomsHandler.BaseDomsQueryCalcHandler):
     params = {}
     singleton = True
 
-    def __init__(self, tile_service_factory):
+    def __init__(self, tile_service_factory, **kwargs):
         BaseHandler.__init__(self, tile_service_factory=tile_service_factory)
 
     def getFacetsForInsituSource(self, source):
diff --git a/analysis/webservice/apidocs/__init__.py b/analysis/webservice/apidocs/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/analysis/webservice/nexus_tornado/app_builders/NexusAppBuilder.py b/analysis/webservice/nexus_tornado/app_builders/NexusAppBuilder.py
index 80f1c92..7b7f0d3 100644
--- a/analysis/webservice/nexus_tornado/app_builders/NexusAppBuilder.py
+++ b/analysis/webservice/nexus_tornado/app_builders/NexusAppBuilder.py
@@ -1,5 +1,4 @@
 import logging
-from pathlib import Path
 import importlib
 from functools import partial
 import pkg_resources
@@ -24,7 +23,7 @@ class NexusAppBuilder:
         self.handlers.append(
             (r'/apidocs', tornado.web.RedirectHandler, {"url": "/apidocs/"}))
 
-        apidocs_path = Path(__file__).parent.parent.joinpath('apidocs').resolve()
+        apidocs_path = pkg_resources.resource_filename('webservice.apidocs', '')
         self.handlers.append(
             (
                 r'/apidocs/(.*)', tornado.web.StaticFileHandler,
diff --git a/analysis/webservice/pyproject.toml b/analysis/webservice/pyproject.toml
new file mode 100644
index 0000000..0902c98
--- /dev/null
+++ b/analysis/webservice/pyproject.toml
@@ -0,0 +1,70 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+[tool.poetry]
+name = "nexusanalysis"
+version = "1.6.0"
+description = "SDAP Nexus Analysis API"
+authors = ["podaac-tva <po...@jpl.nasa.gov>"]
+license = "Apache-2.0"
+readme = "README.md"
+repository = "https://github.com/podaac/l2ss-py"
+classifiers = [
+    "Topic :: Software Development :: Libraries :: Python Modules"
+]
+exclude = ['contrib', 'docs', 'tests']
+packages = [
+    { include = "podaac" },
+]
+
+[tool.poetry.dependencies]
+python = "^3.8"
+netCDF4 = "^1.5"
+xarray = {version = "*", extras = ["parallel"]}
+geopandas ="^0.10"
+Shapely = "^1.7.1"
+harmony-service-lib = { version = "^1.0.20", optional = true }
+pystac = { version = "^0.5.3", optional = true }
+julian = "^0.14"
+importlib-metadata = "^4.8.1"
+h5py = "^3.6.0"
+cf-xarray = "*"
+
+[tool.poetry.dev-dependencies]
+pytest = "^5.2"
+flake8 = "^3.7"
+pytest-cov = "^2.8"
+pylint = "^2.4"
+sphinx = "^4.4"
+pytest-benchmark = "^3.2.3"
+moto = "1.3.14"
+jsonschema = "^3.2.0"
+m2r2 = "^0.3.1"
+sphinx-rtd-theme = "^0.5.2"
+
+[tool.pytest.ini_options]
+junit_family = "xunit2"
+
+[tool.poetry.extras]
+harmony = ["harmony-service-lib", "pystac"]
+
+[tool.poetry.scripts]
+run_worker = 'podaac.subsetter.subset_worker:main'
+l2ss_harmony = 'podaac.subsetter.subset_harmony:main'
+l2ss-py = 'podaac.subsetter.run_subsetter:main'
+
+[build-system]
+requires = ["poetry-core>=1.0.0"]
+build-backend = "poetry.core.masonry.api"
\ No newline at end of file
diff --git a/analysis/webservice/redirect/RedirectHandler.py b/analysis/webservice/redirect/RedirectHandler.py
index 58b5aff..9773182 100644
--- a/analysis/webservice/redirect/RedirectHandler.py
+++ b/analysis/webservice/redirect/RedirectHandler.py
@@ -1,4 +1,5 @@
-import tornado
+import tornado.web
+import tornado.gen
 import logging
 from webservice.webmodel.RequestParameters import RequestParameters