Skip to content

Commit 835cbc5

Browse files
authored
Merge pull request #182 from Geode-solutions/feat/githubFolder
Feat/GitHub folder
2 parents 34e7500 + 4335ff2 commit 835cbc5

File tree

15 files changed

+90
-131
lines changed

15 files changed

+90
-131
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ jobs:
1010
test:
1111
uses: Geode-solutions/actions/.github/workflows/py-test.yml@master
1212
with:
13+
repos: ${{ vars.REPOS }}
1314
npm: true
1415
secrets: inherit

.github/workflows/test_pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ jobs:
88
test:
99
uses: Geode-solutions/actions/.github/workflows/py-test-pr.yml@master
1010
with:
11+
repos: ${{ vars.REPOS }}
1112
npm: true
1213
secrets: inherit

app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from src.opengeodeweb_back.routes.models import blueprint_models
1111
from src.opengeodeweb_back.utils_functions import handle_exception
1212
from src.opengeodeweb_back import app_config
13-
from src.opengeodeweb_back.database import initialize_database
13+
from opengeodeweb_microservice.database.connection import init_database
1414

1515

1616
""" Global config """
@@ -58,6 +58,6 @@ def return_error():
5858

5959
# ''' Main '''
6060
if __name__ == "__main__":
61-
initialize_database(app)
61+
init_database(app)
6262
print(f"Python is running in {FLASK_DEBUG} mode")
6363
app.run(debug=FLASK_DEBUG, host=DEFAULT_HOST, port=PORT, ssl_context=SSL)

pyproject.toml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,27 @@ build-backend = "setuptools.build_meta"
77
name = "OpenGeodeWeb-Back"
88
version = "0.0.0"
99
dynamic = ["dependencies"]
10-
authors = [
11-
{ name="Geode-solutions", email="[email protected]" },
12-
]
10+
authors = [{ name = "Geode-solutions", email = "[email protected]" }]
1311
description = "OpenGeodeWeb-Back is an open source framework that proposes handy python functions and wrappers for the OpenGeode ecosystem"
1412
readme = "README.md"
1513
requires-python = ">=3.9, <3.13"
1614
classifiers = [
17-
"Programming Language :: Python :: 3",
18-
"License :: OSI Approved :: MIT License",
19-
"Operating System :: OS Independent",
15+
"Programming Language :: Python :: 3",
16+
"License :: OSI Approved :: MIT License",
17+
"Operating System :: OS Independent",
2018
]
2119

2220
[project.urls]
2321
"Homepage" = "https://github.com/Geode-solutions/OpenGeodeWeb-Back"
2422
"Bug Tracker" = "https://github.com/Geode-solutions/OpenGeodeWeb-Back/issues"
2523

2624
[tool.setuptools.dynamic]
27-
dependencies = {file = ["requirements.txt"]}
25+
dependencies = { file = ["requirements.txt"] }
2826

2927
[tool.setuptools.packages.find]
3028
where = ["src"]
3129

3230
[tool.setuptools.package-data]
3331
"opengeodeweb_back.routes.schemas" = ["*.json"]
3432
"opengeodeweb_back.routes.models.schemas" = ["*.json"]
33+
opengeodeweb_microservice = ["py.typed"]

requirements.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ fastjsonschema==2.16.2
88
Flask[async]==3.0.3
99
Flask-Cors==6.0.1
1010
werkzeug==3.0.3
11-
Flask-SQLAlchemy==3.1.1
11+
Flask-SQLAlchemy==3.1.1
12+
# OpenGeodeWeb-Microservice

src/opengeodeweb_back/app_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
# Third party imports
66
# Local application imports
7-
from .database import DATABASE_FILENAME
7+
from opengeodeweb_microservice.database.connection import get_database
8+
9+
DATABASE_FILENAME = "project.db"
810

911

1012
class Config(object):

src/opengeodeweb_back/data.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/opengeodeweb_back/database.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/opengeodeweb_back/geode_functions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# Local application imports
1212
from .geode_objects import geode_objects_dict
1313
from . import utils_functions
14-
from .data import Data
15-
from .database import database
14+
from opengeodeweb_microservice.database.data import Data
15+
from opengeodeweb_microservice.database.connection import get_session
1616

1717

1818
def geode_object_value(geode_object: str):
@@ -61,12 +61,12 @@ def load_data(data_id: str) -> Any:
6161
flask.abort(404, f"Data with id {data_id} not found")
6262

6363
file_absolute_path = data_file_path(data_id, data_entry.native_file_name)
64+
print("Loading file: ", file_absolute_path)
65+
print("File exists: ", os.path.exists(file_absolute_path))
6466
return load(data_entry.geode_object, file_absolute_path)
6567

6668

6769
def get_data_info(data_id: str) -> Data:
68-
from .data import Data
69-
7070
data_entry = Data.get(data_id)
7171
if not data_entry:
7272
flask.abort(404, f"Data with id {data_id} not found")

src/opengeodeweb_back/py.typed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
partial

0 commit comments

Comments
 (0)