From d519d8d4dfde4193e210dd88f4e61a8c01c806e0 Mon Sep 17 00:00:00 2001 From: BSd3v <82055130+BSd3v@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:03:00 -0400 Subject: [PATCH 1/3] removing unused code and replacing package if it exists in the requirements.txt --- tmp_deploy.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tmp_deploy.py b/tmp_deploy.py index 6ecc845..f954c2a 100644 --- a/tmp_deploy.py +++ b/tmp_deploy.py @@ -29,20 +29,11 @@ 'content': file.read() } -# Find the last modified tar.gz file in the 'dist' directory -dist_path = 'dist' -latest_tar_gz = None -latest_time = 0 - -for f in os.listdir(dist_path): - if f.endswith('.tar.gz'): - file_path = os.path.join(dist_path, f) - modified_time = os.path.getmtime(file_path) - if modified_time > latest_time: - latest_time = modified_time - latest_tar_gz = file_path - -reqs['content'] += f'\n{os.getenv("PACKAGE_NAME")} @ https://py.cafe/gh/artifact/{os.getenv("GITHUB_OWNER")}/{os.getenv("GITHUB_REPOSITORY")}/{os.getenv("ARTIFACT_ID")}/{os.getenv("FILE_FULLNAME")}' +new_package = f'{os.getenv("PACKAGE_NAME")} @ https://py.cafe/gh/artifact/{os.getenv("GITHUB_OWNER")}/{os.getenv("GITHUB_REPOSITORY")}/{os.getenv("ARTIFACT_ID")}/{os.getenv("FILE_FULLNAME")}' +if os.getenv("PACKAGE_NAME") in reqs['content']: + reqs['content'] = reqs['content'].replace(os.getenv("PACKAGE_NAME"), new_package) +else: + reqs['content'] += f'\n{new_package}' def generate_link(files, code): json_object = { From 13aedc0d757891b87db5f9ed088c1ab7f53cf778 Mon Sep 17 00:00:00 2001 From: BSd3v <82055130+BSd3v@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:06:22 -0400 Subject: [PATCH 2/3] better testing example app --- PRs/app.py | 9 ++++++++- PRs/requirements.txt | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/PRs/app.py b/PRs/app.py index bbce21b..52f88b5 100644 --- a/PRs/app.py +++ b/PRs/app.py @@ -1,7 +1,14 @@ from dash import * +import dash_mantine_components as dmc +from dash import _dash_renderer + +_dash_renderer._set_react_version("18.2.0") app = Dash(__name__) -app.layout = html.Div('Hi PyCafe') +app.layout = dmc.MantineProvider([ + html.Div('Hi PyCafe'), + dmc.MultiSelect(data=['Test1', 'Test2']) + ]) app.run() \ No newline at end of file diff --git a/PRs/requirements.txt b/PRs/requirements.txt index 7e03e4f..9a22b9a 100644 --- a/PRs/requirements.txt +++ b/PRs/requirements.txt @@ -1 +1,2 @@ -dash \ No newline at end of file +dash +dash_mantine_components \ No newline at end of file From f47565155e3cb255b3f29c29ff8013968e2be52d Mon Sep 17 00:00:00 2001 From: BSd3v <82055130+BSd3v@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:11:21 -0400 Subject: [PATCH 3/3] updating repo name --- tmp_deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmp_deploy.py b/tmp_deploy.py index f954c2a..c450990 100644 --- a/tmp_deploy.py +++ b/tmp_deploy.py @@ -29,7 +29,7 @@ 'content': file.read() } -new_package = f'{os.getenv("PACKAGE_NAME")} @ https://py.cafe/gh/artifact/{os.getenv("GITHUB_OWNER")}/{os.getenv("GITHUB_REPOSITORY")}/{os.getenv("ARTIFACT_ID")}/{os.getenv("FILE_FULLNAME")}' +new_package = f'{os.getenv("PACKAGE_NAME")} @ https://py.cafe/gh/artifact/{os.getenv("GITHUB_REPOSITORY")}/{os.getenv("ARTIFACT_ID")}/{os.getenv("FILE_FULLNAME")}' if os.getenv("PACKAGE_NAME") in reqs['content']: reqs['content'] = reqs['content'].replace(os.getenv("PACKAGE_NAME"), new_package) else: