Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/workflows/Branch-protection.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .github/workflows/CICD.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Deploy

on:
workflow_dispatch:

jobs:
deploy:
uses: Geode-solutions/actions/.github/workflows/py-deploy.yml@master
with:
npm: true
secrets: inherit

11 changes: 11 additions & 0 deletions .github/workflows/pr_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Pull request

on:
pull_request:
types: [opened, reopened]
branches:
- master

jobs:
update-branch:
uses: Geode-solutions/actions/.github/workflows/update-branch.yml@master
9 changes: 9 additions & 0 deletions .github/workflows/prepare_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Prepare deploy

on:
workflow_dispatch:

jobs:
prepare:
uses: Geode-solutions/actions/.github/workflows/py-prepare-deploy.yml@master
secrets: inherit
11 changes: 0 additions & 11 deletions .github/workflows/prepare_pr.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test

on:
push:
branches-ignore:
- master
- next

jobs:
test:
uses: Geode-solutions/actions/.github/workflows/py-test.yml@master
with:
repos: ${{ vars.REPOS }}
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Test PR

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
test:
uses: Geode-solutions/actions/.github/workflows/py-test-pr.yml@master
with:
repos: ${{ vars.REPOS }}
secrets: inherit
25 changes: 10 additions & 15 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
OpenGeode-core
OpenGeode-IO
OpenGeode-Inspector
OpenGeode-Geosciences
OpenGeode-GeosciencesIO
Geode-Viewables
geode-numerics
geode-simplex
geode-explicit
geode-implicit
geode-common
fastjsonschema
Flask[async]
Flask-Cors
werkzeug
OpenGeode-core==15.24.1
OpenGeode-IO==7.3.1
OpenGeode-Inspector==6.7.0
OpenGeode-Geosciences==9.2.1
OpenGeode-GeosciencesIO==5.7.1
Geode-Viewables==3.2.0
fastjsonschema==2.16.2
Flask[async]==3.0.3
Flask-Cors==6.0.1
werkzeug==3.0.3
62 changes: 8 additions & 54 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,25 @@
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements.in
# pip-compile --pre requirements.in
#
asgiref==3.9.1
# via flask
blinker==1.9.0
# via flask
click==8.2.1
# via flask
fastjsonschema==2.21.1
fastjsonschema==2.16.2
# via -r requirements.in
flask[async]==3.1.1
flask[async]==3.0.3
# via
# -r requirements.in
# flask
# flask-cors
flask-cors==6.0.1
# via -r requirements.in
geode-background==9.4.0
# via
# geode-explicit
# geode-implicit
# geode-simplex
geode-common==33.9.0
# via
# -r requirements.in
# geode-background
# geode-conversion
# geode-explicit
# geode-implicit
# geode-numerics
# geode-simplex
# geode-viewables
geode-conversion==6.4.0
# via
# geode-explicit
# geode-implicit
geode-explicit==6.3.0
# via
# -r requirements.in
# geode-implicit
geode-implicit==4.1.1
# via -r requirements.in
geode-numerics==6.3.0
# via
# -r requirements.in
# geode-implicit
# geode-simplex
geode-simplex==9.6.0
# via
# -r requirements.in
# geode-implicit
# via geode-viewables
geode-viewables==3.2.0
# via -r requirements.in
itsdangerous==2.2.0
Expand All @@ -60,19 +29,12 @@ jinja2==3.1.6
# via flask
markupsafe==3.0.2
# via
# flask
# jinja2
# werkzeug
opengeode-core==15.24.1
# via
# -r requirements.in
# geode-background
# geode-common
# geode-conversion
# geode-explicit
# geode-implicit
# geode-numerics
# geode-simplex
# geode-viewables
# opengeode-geosciences
# opengeode-geosciencesio
Expand All @@ -81,26 +43,18 @@ opengeode-core==15.24.1
opengeode-geosciences==9.2.1
# via
# -r requirements.in
# geode-implicit
# geode-viewables
# opengeode-geosciencesio
opengeode-geosciencesio==5.7.1
# via
# -r requirements.in
# geode-implicit
# via -r requirements.in
opengeode-inspector==6.7.0
# via
# -r requirements.in
# geode-explicit
# geode-implicit
# geode-simplex
# via -r requirements.in
opengeode-io==7.3.1
# via
# -r requirements.in
# geode-implicit
# geode-viewables
# opengeode-geosciencesio
werkzeug==3.1.3
werkzeug==3.0.3
# via
# -r requirements.in
# flask
Expand Down
30 changes: 14 additions & 16 deletions src/opengeodeweb_back/utils_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,8 @@ def create_unique_data_folder() -> tuple[str, str]:


def save_all_viewables_and_return_info(
geode_object,
data, generated_id,
data_path,
additional_files=None
):
geode_object, data, generated_id, data_path, additional_files=None
):
saved_native_file_path = geode_functions.save(
geode_object,
data,
Expand All @@ -185,30 +182,31 @@ def save_all_viewables_and_return_info(
"input_files": additional_files or [],
}

def generate_native_viewable_and_light_viewable_from_object(
geode_object,
data
):

def generate_native_viewable_and_light_viewable_from_object(geode_object, data):
generated_id, data_path = create_unique_data_folder()
return save_all_viewables_and_return_info(geode_object, data, generated_id, data_path)
return save_all_viewables_and_return_info(
geode_object, data, generated_id, data_path
)


def generate_native_viewable_and_light_viewable_from_file(
geode_object,
input_filename
):
def generate_native_viewable_and_light_viewable_from_file(geode_object, input_filename):
generated_id, data_path = create_unique_data_folder()

full_input_filename = geode_functions.upload_file_path(input_filename)
copied_full_path = os.path.join(data_path, werkzeug.utils.secure_filename(input_filename))
copied_full_path = os.path.join(
data_path, werkzeug.utils.secure_filename(input_filename)
)
shutil.copy2(full_input_filename, copied_full_path)

additional_files_copied = []
additional = geode_functions.additional_files(geode_object, full_input_filename)
for additional_file in additional.mandatory_files + additional.optional_files:
if additional_file.is_missing:
continue
source_path = os.path.join(os.path.dirname(full_input_filename), additional_file.filename)
source_path = os.path.join(
os.path.dirname(full_input_filename), additional_file.filename
)
if not os.path.exists(source_path):
continue
dest_path = os.path.join(data_path, additional_file.filename)
Expand Down
1 change: 0 additions & 1 deletion tests/test_utils_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def test_create_unique_data_folder(client):
assert not os.path.exists(data_path)



def test_save_all_viewables_and_return_info(client):
app = client.application
with app.app_context():
Expand Down
Loading