From 234f4f31c8bad33b42a51c4462f6cfa1eec0a60e Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Wed, 25 Feb 2026 11:25:31 -0500 Subject: [PATCH 01/14] Create greet workflow --- .github/workflows/greet.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/greet.yml diff --git a/.github/workflows/greet.yml b/.github/workflows/greet.yml new file mode 100644 index 0000000..0be55fa --- /dev/null +++ b/.github/workflows/greet.yml @@ -0,0 +1,34 @@ +# name of the workflow +name: greet + +# when the workflow should run +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +# independent jobs in the workflow +jobs: + # this workflow just has one job called "greet" + greet: + # the operating system to use for this workflow + runs-on: ubuntu-latest + # list of steps in the workflow + steps: + # use an action provided by github to checkout the repo + - uses: actions/checkout@v3 + # a custom step that runs a couple shell commands + - name: List + run: | + echo "listing files in the bioinitio directory" + ls cm_pkj + # a custom step that runs R code + - name: Greet + run: print("Cristina's Hello world!") + # Replace `shell: Rscript {0}` with `shell: python {0}` to run Python code instead! + shell: python {0} From 99ce56f975a11fc7e9929359dd2b62ea563e821f Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Wed, 25 Feb 2026 11:30:23 -0500 Subject: [PATCH 02/14] Fixed greet workflow --- .github/workflows/greet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greet.yml b/.github/workflows/greet.yml index 0be55fa..db317aa 100644 --- a/.github/workflows/greet.yml +++ b/.github/workflows/greet.yml @@ -26,7 +26,7 @@ jobs: - name: List run: | echo "listing files in the bioinitio directory" - ls cm_pkj + ls cm_pkg # a custom step that runs R code - name: Greet run: print("Cristina's Hello world!") From 262275c2f7fd45c74855823078cd64eecff90bb5 Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 10:32:04 -0400 Subject: [PATCH 03/14] Updated greet CI workflow --- .github/workflows/greet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/greet.yml b/.github/workflows/greet.yml index db317aa..fb60302 100644 --- a/.github/workflows/greet.yml +++ b/.github/workflows/greet.yml @@ -29,6 +29,6 @@ jobs: ls cm_pkg # a custom step that runs R code - name: Greet - run: print("Cristina's Hello world!") + run: print("Hello, world!") # Replace `shell: Rscript {0}` with `shell: python {0}` to run Python code instead! - shell: python {0} + shell: Rscript {0} From 6637a029d814d500a0cc913620e741e68f0c5273 Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 10:34:02 -0400 Subject: [PATCH 04/14] Updated greet CI workflow --- .github/workflows/greet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greet.yml b/.github/workflows/greet.yml index fb60302..be7f542 100644 --- a/.github/workflows/greet.yml +++ b/.github/workflows/greet.yml @@ -31,4 +31,4 @@ jobs: - name: Greet run: print("Hello, world!") # Replace `shell: Rscript {0}` with `shell: python {0}` to run Python code instead! - shell: Rscript {0} + shell: python {0} From 3f427787097c1f18bd21c8d7f8616ce74348be15 Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 10:39:12 -0400 Subject: [PATCH 05/14] Added run unit tests CI workflow --- .github/workflows/run_unit_tests.yml | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/run_unit_tests.yml diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml new file mode 100644 index 0000000..313c899 --- /dev/null +++ b/.github/workflows/run_unit_tests.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v3 + with: + python-version: "3.11" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + if [ -f requirements.txt ]; then + pip install -r requirements.txt + fi + - name: Test with pytest + run: | + pytest . From b4f02c445046b819b014c87f13494bcbe7c0ce8b Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 10:46:49 -0400 Subject: [PATCH 06/14] Updated test to add () to the function definition of test_multiplication --- tests/test_add_numbers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_add_numbers.py b/tests/test_add_numbers.py index 4869592..fdaf6c5 100644 --- a/tests/test_add_numbers.py +++ b/tests/test_add_numbers.py @@ -6,7 +6,7 @@ def test_addn_pos(): assert module1.add_numbers(2,5) == 7, "Adding 2 and 5 should result in 7" -def test_multiplication: +def test_multiplication(): assert module1.multiply_numbers(2,5) == 10, "Multiplying 2 and 5 should result in 10" From 33614ba3bd0476d7d53b65e47da62edbc89654c2 Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 10:53:48 -0400 Subject: [PATCH 07/14] Added the CI workflow with the linter --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cc75494 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI + +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +env: # configure environment variables for git commits + actor: "41898282+github-actions[bot]" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v3 + with: + python-version: "3.11" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest black flake8 # also install black & flake8 + if [ -f requirements.txt ]; then + pip install -r requirements.txt + fi + - name: Configure git # use the environment variable we set above + run: | + git config --local user.email "${actor}@users.noreply.github.com" + git config --local user.name "$actor" + - name: Test + run: | + pytest . + - name: Format & lint + run: | + black . # first run black, then run flake8 + flake8 --extend-ignore E203 --max-line-length 88 . + - name: Commit and push changes + run: | + git add . + git commit -m "🎨 Style code" || echo "No changes to commit" + git push From ca6efbe0983fe20b57f5bcbdab95aebd4caee43c Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 10:58:10 -0400 Subject: [PATCH 08/14] Updated the CI workflow with the linter to change to the ci branch --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc75494..763fc4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,9 @@ jobs: run: | git config --local user.email "${actor}@users.noreply.github.com" git config --local user.name "$actor" + - name: Switch branch + run: | + git checkout ci - name: Test run: | pytest . From 1a78ef17f1c5e99aab53b41987bb3945a91505a5 Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 11:00:38 -0400 Subject: [PATCH 09/14] Updated the CI workflow with a correction of changing branches --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 763fc4a..b30174e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,9 +33,7 @@ jobs: run: | git config --local user.email "${actor}@users.noreply.github.com" git config --local user.name "$actor" - - name: Switch branch - run: | - git checkout ci + git checkout ci - name: Test run: | pytest . From 5b2092168c74423fadae7861712fc2c1fdd2c7e6 Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 11:49:19 -0400 Subject: [PATCH 10/14] updated the CI workflow to push to main and added gitignore for pycache folder --- .github/workflows/ci.yml | 3 +-- .gitignore | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b30174e..8de4081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,6 @@ jobs: run: | git config --local user.email "${actor}@users.noreply.github.com" git config --local user.name "$actor" - git checkout ci - name: Test run: | pytest . @@ -45,4 +44,4 @@ jobs: run: | git add . git commit -m "🎨 Style code" || echo "No changes to commit" - git push + git push origin HEAD:main diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..04e9f7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.pyc + From f042d19be2bd7a2d6fd81fcac4611acb6a6ae370 Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 11:56:10 -0400 Subject: [PATCH 11/14] Updated CI with pull push options --- .github/workflows/ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8de4081..a5d5517 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,18 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout code for push +      if: github.event_name == 'push' +      uses: actions/checkout@v3 +      with: +        fetch-depth: 0 +        ref: ${{ github.ref_name }} +    - name: Checkout code for pull request +      if: github.event_name == 'pull_request' +      uses: actions/checkout@v3 +      with: +        fetch-depth: 0 +        ref: ${{ github.head_ref }} - name: Set up Python 3.11 uses: actions/setup-python@v3 with: From 466812b12ccf04b5f23b96d01e81a013971c96ff Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 12:00:58 -0400 Subject: [PATCH 12/14] Updated CI with pull push options and ci branch --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5d5517..44f9e0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,4 +55,4 @@ jobs: run: | git add . git commit -m "🎨 Style code" || echo "No changes to commit" - git push origin HEAD:main + git push From 14628c2dd53dba3d51a5b70316ad4c064381c7d5 Mon Sep 17 00:00:00 2001 From: Cristina Mitrea Date: Mon, 9 Mar 2026 12:21:37 -0400 Subject: [PATCH 13/14] Updated CI workflow to fix bad text --- .github/workflows/ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44f9e0f..51e8321 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,17 +18,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code for push -      if: github.event_name == 'push' -      uses: actions/checkout@v3 -      with: -        fetch-depth: 0 -        ref: ${{ github.ref_name }} -    - name: Checkout code for pull request -      if: github.event_name == 'pull_request' -      uses: actions/checkout@v3 -      with: -        fetch-depth: 0 -        ref: ${{ github.head_ref }} + if: github.event_name == 'push' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.ref_name }} + - name: Checkout code for pull request + if: github.event_name == 'pull_request' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.head_ref }} - name: Set up Python 3.11 uses: actions/setup-python@v3 with: From 813d814cb7ce9107a039ef306556824f250681b6 Mon Sep 17 00:00:00 2001 From: "41898282+github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:22:02 +0000 Subject: [PATCH 14/14] =?UTF-8?q?=F0=9F=8E=A8=20Style=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cm_pkg/__init__.py | 2 +- cm_pkg/module1.py | 32 +++++++++++++++------------ cm_pkg/ui/__init__.py | 2 +- cm_pkg/ui/main_ui.py | 46 ++++++++++++++++----------------------- setup.py | 16 +++++--------- tests/test_add_numbers.py | 12 +++++----- 6 files changed, 52 insertions(+), 58 deletions(-) diff --git a/cm_pkg/__init__.py b/cm_pkg/__init__.py index 377d808..ffffe1e 100644 --- a/cm_pkg/__init__.py +++ b/cm_pkg/__init__.py @@ -1 +1 @@ -__all__ = ["module1"] \ No newline at end of file +__all__ = ["module1"] diff --git a/cm_pkg/module1.py b/cm_pkg/module1.py index 9cebc23..054ce56 100755 --- a/cm_pkg/module1.py +++ b/cm_pkg/module1.py @@ -1,21 +1,25 @@ -def add_numbers(x,y): - return(x+y) - +def add_numbers(x, y): + return x + y + + def say_hello(): - print("Hello there!") + print("Hello there!") + def hello_world(): - print("Hello world!") + print("Hello world!") + def multiply_numbers(x, y): - """ - Funtion to multiply two numbers - Args: - x (numerical: int or float): number to be multiplied - y (numerical: int or float): number to be multiplied - Returns numerical value (int or float) the result of multiplying x and y - """ - return(x*y) + """ + Funtion to multiply two numbers + Args: + x (numerical: int or float): number to be multiplied + y (numerical: int or float): number to be multiplied + Returns numerical value (int or float) the result of multiplying x and y + """ + return x * y + def new_function(): - print("new function code working") + print("new function code working") diff --git a/cm_pkg/ui/__init__.py b/cm_pkg/ui/__init__.py index 98c6741..54df6ca 100644 --- a/cm_pkg/ui/__init__.py +++ b/cm_pkg/ui/__init__.py @@ -1 +1 @@ -__all__ = ["main_ui"] \ No newline at end of file +__all__ = ["main_ui"] diff --git a/cm_pkg/ui/main_ui.py b/cm_pkg/ui/main_ui.py index bbb45f6..19a1638 100644 --- a/cm_pkg/ui/main_ui.py +++ b/cm_pkg/ui/main_ui.py @@ -1,32 +1,24 @@ import tkinter as tk + def main(): - window = tk.Tk() - window.title("Python UI example") - window.geometry("500x200") - - label = tk.Label(text = "Python rocks!", - font = ('Arial 16')) - label.place(relx = 0.15, - rely = 0.1, - anchor = 'nw') - entry = tk.Entry() - entry.place(relx = 0.15, - rely = 0.25, - anchor = 'nw') - - def change_label(): - label.config(text = entry.get(), - font = ('Helvetica 30')) - - button = tk.Button(text = "Change label", - command = change_label) - button.place(relx = 0.15, - rely = 0.50, - anchor = 'nw') - - window.mainloop() + window = tk.Tk() + window.title("Python UI example") + window.geometry("500x200") -if __name__ == "__main__": - main() + label = tk.Label(text="Python rocks!", font=("Arial 16")) + label.place(relx=0.15, rely=0.1, anchor="nw") + entry = tk.Entry() + entry.place(relx=0.15, rely=0.25, anchor="nw") + + def change_label(): + label.config(text=entry.get(), font=("Helvetica 30")) + + button = tk.Button(text="Change label", command=change_label) + button.place(relx=0.15, rely=0.50, anchor="nw") + window.mainloop() + + +if __name__ == "__main__": + main() diff --git a/setup.py b/setup.py index 7b91526..aedd97a 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,8 @@ from setuptools import setup -setup(name='python_prj', - version='0.1.0', - packages=['cm_pkg', "cm_pkg.ui"], - entry_points={ - 'console_scripts': [ - 'greeting = cm_pkg.module1:say_hello' - ] - } - ) - +setup( + name="python_prj", + version="0.1.0", + packages=["cm_pkg", "cm_pkg.ui"], + entry_points={"console_scripts": ["greeting = cm_pkg.module1:say_hello"]}, +) diff --git a/tests/test_add_numbers.py b/tests/test_add_numbers.py index fdaf6c5..9bb6694 100644 --- a/tests/test_add_numbers.py +++ b/tests/test_add_numbers.py @@ -1,17 +1,19 @@ -import sys +import sys import os from cm_pkg import module1 def test_addn_pos(): - assert module1.add_numbers(2,5) == 7, "Adding 2 and 5 should result in 7" + assert module1.add_numbers(2, 5) == 7, "Adding 2 and 5 should result in 7" + def test_multiplication(): - assert module1.multiply_numbers(2,5) == 10, "Multiplying 2 and 5 should result in 10" + assert ( + module1.multiply_numbers(2, 5) == 10 + ), "Multiplying 2 and 5 should result in 10" cd = os.path.dirname(os.getcwd()) ccd = os.path.join(cd, "cm_pkg") print(ccd) -sys.path.insert(0, ccd) - +sys.path.insert(0, ccd)