vease-back 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Geode-solutions
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,44 @@
1
+ Metadata-Version: 2.1
2
+ Name: vease_back
3
+ Version: 0.4.2
4
+ Author-email: Geode-solutions <team-web@geode-solutions.com>
5
+ Project-URL: Homepage, https://github.com/Geode-solutions/Vease-back
6
+ Project-URL: Bug Tracker, https://github.com/Geode-solutions/Vease-back/issues
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: asgiref==3.8.1
14
+ Requires-Dist: attrs==24.2.0
15
+ Requires-Dist: blinker==1.8.2
16
+ Requires-Dist: click==8.1.7
17
+ Requires-Dist: colorama==0.4.6
18
+ Requires-Dist: flask[async]==3.0.3
19
+ Requires-Dist: flask-cors==5.0.0
20
+ Requires-Dist: geode-background==8.6.1
21
+ Requires-Dist: geode-common==33.0.4
22
+ Requires-Dist: geode-conversion==6.0.10
23
+ Requires-Dist: geode-explicit==6.1.9
24
+ Requires-Dist: geode-implicit==3.2.4
25
+ Requires-Dist: geode-numerics==5.1.3
26
+ Requires-Dist: geode-simplex==8.2.10
27
+ Requires-Dist: geode-viewables==3.0.5
28
+ Requires-Dist: itsdangerous==2.2.0
29
+ Requires-Dist: jinja2==3.1.4
30
+ Requires-Dist: jsonschema==4.23.0
31
+ Requires-Dist: jsonschema-specifications==2024.10.1
32
+ Requires-Dist: markupsafe==3.0.1
33
+ Requires-Dist: opengeode-core==15.5.0
34
+ Requires-Dist: opengeode-geosciences==8.1.0
35
+ Requires-Dist: opengeode-geosciencesio==5.2.1
36
+ Requires-Dist: opengeode-inspector==6.1.4
37
+ Requires-Dist: opengeode-io==7.0.3
38
+ Requires-Dist: opengeodeweb-back==5.3.1
39
+ Requires-Dist: referencing==0.35.1
40
+ Requires-Dist: rpds-py==0.20.0
41
+ Requires-Dist: typing-extensions==4.12.2
42
+ Requires-Dist: werkzeug==3.0.4
43
+
44
+ # Vease-Back
@@ -0,0 +1 @@
1
+ # Vease-Back
@@ -0,0 +1,48 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+
6
+ [project]
7
+ name = "vease_back"
8
+ version = "0.4.2"
9
+ dynamic = ["dependencies"]
10
+ authors = [
11
+ { name="Geode-solutions", email="team-web@geode-solutions.com" },
12
+ ]
13
+ description = ""
14
+ readme = "README.md"
15
+ requires-python = ">=3.8"
16
+ classifiers = [
17
+ "Programming Language :: Python :: 3",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ ]
21
+
22
+ [project.urls]
23
+ "Homepage" = "https://github.com/Geode-solutions/Vease-back"
24
+ "Bug Tracker" = "https://github.com/Geode-solutions/Vease-back/issues"
25
+
26
+ [project.scripts]
27
+ vease-back = "vease_back.app:run_server"
28
+
29
+ [tool.setuptools.dynamic]
30
+ dependencies = {file = ["requirements.txt"]}
31
+
32
+ [tool.setuptools.packages.find]
33
+ where = ["src"]
34
+
35
+ [tool.semantic_release]
36
+ version_toml = [
37
+ "pyproject.toml:project.version",
38
+ ]
39
+
40
+ [tool.semantic_release.remote.token]
41
+ env = "GH_TOKEN"
42
+
43
+ [tool.semantic_release.branches.master]
44
+ match = "master"
45
+
46
+ [tool.semantic_release.branches.next]
47
+ match = "next"
48
+ prerelease = true
@@ -0,0 +1,143 @@
1
+ #
2
+ # This file is autogenerated by pip-compile with Python 3.11
3
+ # by the following command:
4
+ #
5
+ # pip-compile requirements.in
6
+ #
7
+ asgiref==3.8.1
8
+ # via
9
+ # flask
10
+ # opengeodeweb-back
11
+ attrs==24.2.0
12
+ # via
13
+ # jsonschema
14
+ # opengeodeweb-back
15
+ # referencing
16
+ blinker==1.8.2
17
+ # via
18
+ # flask
19
+ # opengeodeweb-back
20
+ click==8.1.7
21
+ # via
22
+ # flask
23
+ # opengeodeweb-back
24
+ colorama==0.4.6
25
+ # via click
26
+ flask[async]==3.0.3
27
+ # via
28
+ # flask-cors
29
+ # opengeodeweb-back
30
+ flask-cors==5.0.0
31
+ # via opengeodeweb-back
32
+ geode-background==8.6.1
33
+ # via
34
+ # geode-explicit
35
+ # geode-implicit
36
+ # geode-simplex
37
+ # opengeodeweb-back
38
+ geode-common==33.0.4
39
+ # via
40
+ # geode-background
41
+ # geode-conversion
42
+ # geode-explicit
43
+ # geode-implicit
44
+ # geode-numerics
45
+ # geode-simplex
46
+ # geode-viewables
47
+ # opengeodeweb-back
48
+ geode-conversion==6.0.10
49
+ # via
50
+ # geode-explicit
51
+ # geode-implicit
52
+ # opengeodeweb-back
53
+ geode-explicit==6.1.9
54
+ # via
55
+ # geode-implicit
56
+ # opengeodeweb-back
57
+ geode-implicit==3.2.4
58
+ # via opengeodeweb-back
59
+ geode-numerics==5.1.3
60
+ # via
61
+ # geode-implicit
62
+ # geode-simplex
63
+ # opengeodeweb-back
64
+ geode-simplex==8.2.10
65
+ # via
66
+ # geode-implicit
67
+ # opengeodeweb-back
68
+ geode-viewables==3.0.5
69
+ # via opengeodeweb-back
70
+ itsdangerous==2.2.0
71
+ # via
72
+ # flask
73
+ # opengeodeweb-back
74
+ jinja2==3.1.4
75
+ # via
76
+ # flask
77
+ # opengeodeweb-back
78
+ jsonschema==4.23.0
79
+ # via opengeodeweb-back
80
+ jsonschema-specifications==2024.10.1
81
+ # via
82
+ # jsonschema
83
+ # opengeodeweb-back
84
+ markupsafe==3.0.1
85
+ # via
86
+ # jinja2
87
+ # opengeodeweb-back
88
+ # werkzeug
89
+ opengeode-core==15.5.0
90
+ # via
91
+ # geode-background
92
+ # geode-common
93
+ # geode-conversion
94
+ # geode-explicit
95
+ # geode-implicit
96
+ # geode-numerics
97
+ # geode-simplex
98
+ # geode-viewables
99
+ # opengeode-geosciences
100
+ # opengeode-geosciencesio
101
+ # opengeode-inspector
102
+ # opengeode-io
103
+ # opengeodeweb-back
104
+ opengeode-geosciences==8.1.0
105
+ # via
106
+ # geode-implicit
107
+ # geode-viewables
108
+ # opengeode-geosciencesio
109
+ # opengeodeweb-back
110
+ opengeode-geosciencesio==5.2.1
111
+ # via
112
+ # geode-implicit
113
+ # opengeodeweb-back
114
+ opengeode-inspector==6.1.4
115
+ # via
116
+ # geode-explicit
117
+ # geode-implicit
118
+ # geode-simplex
119
+ # opengeodeweb-back
120
+ opengeode-io==7.0.3
121
+ # via
122
+ # geode-implicit
123
+ # geode-viewables
124
+ # opengeode-geosciencesio
125
+ # opengeodeweb-back
126
+ opengeodeweb-back==5.3.1
127
+ # via -r requirements.in
128
+ referencing==0.35.1
129
+ # via
130
+ # jsonschema
131
+ # jsonschema-specifications
132
+ # opengeodeweb-back
133
+ rpds-py==0.20.0
134
+ # via
135
+ # jsonschema
136
+ # opengeodeweb-back
137
+ # referencing
138
+ typing-extensions==4.12.2
139
+ # via opengeodeweb-back
140
+ werkzeug==3.0.4
141
+ # via
142
+ # flask
143
+ # opengeodeweb-back
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,12 @@
1
+ import pytest
2
+ from src.vease_back.app import app
3
+
4
+
5
+ @pytest.fixture
6
+ def client():
7
+ app.config["TESTING"] = True
8
+ app.config["SERVER_NAME"] = "TEST"
9
+ app.config["DATA_FOLDER"] = "./data/"
10
+ client = app.test_client()
11
+ client.headers = {"Content-type": "application/json", "Accept": "application/json"}
12
+ yield client
@@ -0,0 +1,10 @@
1
+ def test_allowed_files(client):
2
+ route = f"/opengeodeweb_back/allowed_files"
3
+ response = client.post(route, json={"supported_feature": None})
4
+ assert response.status_code == 200
5
+
6
+
7
+ def test_root(client):
8
+ route = f"/"
9
+ response = client.post(route)
10
+ assert response.status_code == 200
File without changes
@@ -0,0 +1,72 @@
1
+ # Global packages
2
+ import argparse
3
+ import os
4
+ import time
5
+
6
+ # Third parties
7
+ import flask
8
+ import flask_cors
9
+ from flask_cors import cross_origin
10
+ from opengeodeweb_back import geode_functions, utils_functions, app_config
11
+ from opengeodeweb_back.routes import blueprint_routes
12
+ from werkzeug.exceptions import HTTPException
13
+ from werkzeug.exceptions import HTTPException
14
+
15
+ # Local libraries
16
+
17
+ """ Global config """
18
+ app = flask.Flask(__name__)
19
+
20
+ """ Config variables """
21
+ FLASK_DEBUG = True if os.environ.get("FLASK_DEBUG", default=None) == "True" else False
22
+
23
+ if FLASK_DEBUG == False:
24
+ app.config.from_object(app_config.ProdConfig)
25
+ else:
26
+ app.config.from_object(app_config.DevConfig)
27
+
28
+ DEFAULT_HOST = app.config.get("DEFAULT_HOST")
29
+ DEFAULT_PORT = int(app.config.get("DEFAULT_PORT"))
30
+ DEFAULT_DATA_FOLDER_PATH = app.config.get("DEFAULT_DATA_FOLDER_PATH")
31
+ DESKTOP_APP = app.config.get("DESKTOP_APP")
32
+ ORIGINS = app.config.get("ORIGINS")
33
+ SSL = app.config.get("SSL")
34
+ SECONDS_BETWEEN_SHUTDOWNS = float(app.config.get("SECONDS_BETWEEN_SHUTDOWNS"))
35
+
36
+ app.register_blueprint(
37
+ blueprint_routes.routes,
38
+ url_prefix="/opengeodeweb_back",
39
+ name="opengeodeweb_back",
40
+ )
41
+
42
+ if FLASK_DEBUG == False:
43
+ utils_functions.set_interval(utils_functions.kill_task, SECONDS_BETWEEN_SHUTDOWNS, app)
44
+
45
+ @app.errorhandler(HTTPException)
46
+ def errorhandler(e):
47
+ return utils_functions.handle_exception(e)
48
+
49
+ @app.route("/", methods=["POST"])
50
+ @cross_origin()
51
+ def root():
52
+ return flask.make_response({}, 200)
53
+
54
+ def run_server():
55
+ parser = argparse.ArgumentParser(prog='Vease-Back', description='Backend server for Vease')
56
+ parser.add_argument('--host', type=str, default=DEFAULT_HOST, help='Host to run on')
57
+ parser.add_argument('-p', '--port', type=int, default=DEFAULT_PORT, help='Port to listen on')
58
+ parser.add_argument('-d', '--debug', default=FLASK_DEBUG, help='Whether to run in debug mode', action='store_true')
59
+ parser.add_argument('-dfp', '--data_folder_path', type=str, default=DEFAULT_DATA_FOLDER_PATH, help='Path to the folder where data is stored')
60
+ parser.add_argument('-dktp', '--desktop', default=DESKTOP_APP, help='Whether the app is in desktop mode or not, if not, the server times out after ', action='store_true')
61
+ parser.add_argument('-origin', '--allowed_origin', default=ORIGINS, help='Origins that are allowed to connect to the server')
62
+ args = parser.parse_args()
63
+ app.config.update(DATA_FOLDER_PATH=args.data_folder_path)
64
+ app.config.update(DESKTOP_APP=args.desktop)
65
+ flask_cors.CORS(app, origins=args.allowed_origin)
66
+ print(f"Host: {args.host}, Port: {args.port}, Debug: {args.debug}, Data folder path: {args.data_folder_path}, Desktop mode: {args.desktop}, Origins: {args.allowed_origin}", flush=True)
67
+ app.run(debug=args.debug, host=args.host, port=args.port, ssl_context=SSL)
68
+
69
+
70
+ # ''' Main '''
71
+ if __name__ == "__main__":
72
+ run_server()
@@ -0,0 +1,44 @@
1
+ Metadata-Version: 2.1
2
+ Name: vease_back
3
+ Version: 0.4.2
4
+ Author-email: Geode-solutions <team-web@geode-solutions.com>
5
+ Project-URL: Homepage, https://github.com/Geode-solutions/Vease-back
6
+ Project-URL: Bug Tracker, https://github.com/Geode-solutions/Vease-back/issues
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: asgiref==3.8.1
14
+ Requires-Dist: attrs==24.2.0
15
+ Requires-Dist: blinker==1.8.2
16
+ Requires-Dist: click==8.1.7
17
+ Requires-Dist: colorama==0.4.6
18
+ Requires-Dist: flask[async]==3.0.3
19
+ Requires-Dist: flask-cors==5.0.0
20
+ Requires-Dist: geode-background==8.6.1
21
+ Requires-Dist: geode-common==33.0.4
22
+ Requires-Dist: geode-conversion==6.0.10
23
+ Requires-Dist: geode-explicit==6.1.9
24
+ Requires-Dist: geode-implicit==3.2.4
25
+ Requires-Dist: geode-numerics==5.1.3
26
+ Requires-Dist: geode-simplex==8.2.10
27
+ Requires-Dist: geode-viewables==3.0.5
28
+ Requires-Dist: itsdangerous==2.2.0
29
+ Requires-Dist: jinja2==3.1.4
30
+ Requires-Dist: jsonschema==4.23.0
31
+ Requires-Dist: jsonschema-specifications==2024.10.1
32
+ Requires-Dist: markupsafe==3.0.1
33
+ Requires-Dist: opengeode-core==15.5.0
34
+ Requires-Dist: opengeode-geosciences==8.1.0
35
+ Requires-Dist: opengeode-geosciencesio==5.2.1
36
+ Requires-Dist: opengeode-inspector==6.1.4
37
+ Requires-Dist: opengeode-io==7.0.3
38
+ Requires-Dist: opengeodeweb-back==5.3.1
39
+ Requires-Dist: referencing==0.35.1
40
+ Requires-Dist: rpds-py==0.20.0
41
+ Requires-Dist: typing-extensions==4.12.2
42
+ Requires-Dist: werkzeug==3.0.4
43
+
44
+ # Vease-Back
@@ -0,0 +1,15 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ requirements.txt
5
+ src/tests/__init__.py
6
+ src/tests/conftest.py
7
+ src/tests/test_routes.py
8
+ src/vease_back/__init__.py
9
+ src/vease_back/app.py
10
+ src/vease_back.egg-info/PKG-INFO
11
+ src/vease_back.egg-info/SOURCES.txt
12
+ src/vease_back.egg-info/dependency_links.txt
13
+ src/vease_back.egg-info/entry_points.txt
14
+ src/vease_back.egg-info/requires.txt
15
+ src/vease_back.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ vease-back = vease_back.app:run_server
@@ -0,0 +1,30 @@
1
+ asgiref==3.8.1
2
+ attrs==24.2.0
3
+ blinker==1.8.2
4
+ click==8.1.7
5
+ colorama==0.4.6
6
+ flask[async]==3.0.3
7
+ flask-cors==5.0.0
8
+ geode-background==8.6.1
9
+ geode-common==33.0.4
10
+ geode-conversion==6.0.10
11
+ geode-explicit==6.1.9
12
+ geode-implicit==3.2.4
13
+ geode-numerics==5.1.3
14
+ geode-simplex==8.2.10
15
+ geode-viewables==3.0.5
16
+ itsdangerous==2.2.0
17
+ jinja2==3.1.4
18
+ jsonschema==4.23.0
19
+ jsonschema-specifications==2024.10.1
20
+ markupsafe==3.0.1
21
+ opengeode-core==15.5.0
22
+ opengeode-geosciences==8.1.0
23
+ opengeode-geosciencesio==5.2.1
24
+ opengeode-inspector==6.1.4
25
+ opengeode-io==7.0.3
26
+ opengeodeweb-back==5.3.1
27
+ referencing==0.35.1
28
+ rpds-py==0.20.0
29
+ typing-extensions==4.12.2
30
+ werkzeug==3.0.4
@@ -0,0 +1,2 @@
1
+ tests
2
+ vease_back