Skip to content

Commit

Permalink
add dummy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
procrastinatio committed Dec 18, 2024
1 parent 9983233 commit 85aab6d
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/conda-pyinstaller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Setup Conda and Run PyInstaller

on: [push, pull_request]

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.11 # Specify the Python version you need
activate-environment: myenv
#environment-file: environment.yml # Optional: if you have an environment file
auto-update-conda: true

- name: Install dependencies
run: |
conda install -c conda-forge fiona gdal openpyxl matplotlib click pyqt mamba geopandas pyinstaller
- name: Run PyInstaller
run: |
pyinstaller tk_main.py tk_main.spec
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: pyinstaller-artifacts
path: dist/ # Adjust the path according to where PyInstaller outputs the files
48 changes: 48 additions & 0 deletions tk_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import tkinter as tk
from tkinter import filedialog, messagebox
import pandas as pd
from tkinter import ttk


class App(tk.Tk):
def __init__(self):
super().__init__()
self.title("File Loader")
self.geometry("800x600")

self.btn_load_file = tk.Button(self, text="Load File", command=self.load_file)
self.btn_load_file.pack(pady=20)

self.table_frame = tk.Frame(self)
self.table_frame.pack(fill=tk.BOTH, expand=True)

def load_file(self):
file_path = filedialog.askopenfilename(filetypes=[("CSV Files", "*.csv"), ("All Files", "*.*")])
if file_path:
self.load_data(file_path)

def load_data(self, file_path):
try:
data = pd.read_csv(file_path)
self.display_table(data)
except Exception as e:
messagebox.showerror("Error", f"Failed to load file:\n{e}")

def display_table(self, data):
for widget in self.table_frame.winfo_children():
widget.destroy()

tree = ttk.Treeview(self.table_frame, columns=list(data.columns), show="headings")
tree.pack(fill=tk.BOTH, expand=True)

for col in data.columns:
tree.heading(col, text=col)
tree.column(col, anchor=tk.W)

for index, row in data.iterrows():
tree.insert("", tk.END, values=list(row))


if __name__ == "__main__":
app = App()
app.mainloop()
38 changes: 38 additions & 0 deletions tk_main.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
['tk_main.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='tk_main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)

0 comments on commit 85aab6d

Please sign in to comment.