Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor depend blocking #23

Closed
wants to merge 114 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
e20b392
Create ci.yml
Majikjack620 Jun 14, 2023
1b59497
Merge pull request #1 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 14, 2023
89d73de
Update ci.yml
Majikjack620 Jun 14, 2023
9fdd58b
Update requirements.txt
Majikjack620 Jun 14, 2023
8d4c968
Update ci.yml
Majikjack620 Jun 14, 2023
51b74e3
Update ci.yml
Majikjack620 Jun 14, 2023
8296a41
Merge pull request #4 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 14, 2023
aaee8d8
Update ci.yml
Majikjack620 Jun 14, 2023
e136764
Merge pull request #5 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 14, 2023
0c5f6e8
Create read_file.py
Majikjack620 Jun 14, 2023
43ad62e
Update ci.yml
Majikjack620 Jun 14, 2023
e788921
Update read_file.py
Majikjack620 Jun 14, 2023
480294b
Update ci.yml
Majikjack620 Jun 14, 2023
574a154
Update read_file.py
Majikjack620 Jun 14, 2023
82a3a51
Update read_file.py
Majikjack620 Jun 14, 2023
547dc38
Update ci.yml
Majikjack620 Jun 14, 2023
98bc618
Merge pull request #6 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 14, 2023
4cde6d7
Update ci.yml
Majikjack620 Jun 14, 2023
775cc18
Update ci.yml
Majikjack620 Jun 14, 2023
1767a73
Merge pull request #7 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 14, 2023
2779130
Delete binder-badge.yml
Majikjack620 Jun 14, 2023
6f7ffec
Update requirements.txt
Majikjack620 Jun 14, 2023
3f24dd1
Update ci.yml
Majikjack620 Jun 14, 2023
648493b
Update ci.yml
Majikjack620 Jun 14, 2023
a23c31f
Update ci.yml
Majikjack620 Jun 14, 2023
246f178
Update ci.yml
Majikjack620 Jun 14, 2023
91b0c2a
Update ci.yml
Majikjack620 Jun 14, 2023
4acbd3e
Update ci.yml
Majikjack620 Jun 14, 2023
86ad82c
Update ci.yml
Majikjack620 Jun 14, 2023
7e0d468
Merge pull request #10 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 14, 2023
fa9d577
Update ci.yml
Majikjack620 Jun 14, 2023
a78fede
Update ci.yml
Majikjack620 Jun 15, 2023
6de7e20
Merge pull request #21 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
d90cf6b
Update ci.yml
Majikjack620 Jun 15, 2023
a8516db
Merge pull request #22 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
dbc68e2
Update ci.yml
Majikjack620 Jun 15, 2023
9523619
Merge pull request #24 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
cffbb24
Update ci.yml
Majikjack620 Jun 15, 2023
cc3c2c6
Merge pull request #29 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
3709e32
Update ci.yml
Majikjack620 Jun 15, 2023
2d60032
Update ci.yml
Majikjack620 Jun 15, 2023
de46e55
Update read_file.py
Majikjack620 Jun 15, 2023
feb7770
Update ci.yml
Majikjack620 Jun 15, 2023
b1e24c8
Update ci.yml
Majikjack620 Jun 15, 2023
da1fbe3
Update read_file.py
Majikjack620 Jun 15, 2023
a401296
Merge pull request #31 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
bb57865
Update read_file.py
Majikjack620 Jun 15, 2023
8049e99
Update ci.yml
Majikjack620 Jun 15, 2023
9a8a6f3
Merge pull request #32 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
c25ce09
Update read_file.py
Majikjack620 Jun 15, 2023
6e5850e
Merge pull request #33 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
8193236
Update ci.yml
Majikjack620 Jun 15, 2023
09e2392
Update ci.yml
Majikjack620 Jun 15, 2023
9ffda45
Update read_file.py
Majikjack620 Jun 15, 2023
e442ed1
Merge pull request #34 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
e74e199
Update read_file.py
Majikjack620 Jun 15, 2023
1ea0bec
Merge pull request #36 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
10b18d0
Update read_file.py
Majikjack620 Jun 15, 2023
2639a0b
Merge pull request #37 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
2eec751
Update read_file.py
Majikjack620 Jun 15, 2023
2996e05
Merge pull request #38 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
ee34b3b
Update read_file.py
Majikjack620 Jun 15, 2023
c52b07d
Merge pull request #39 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
70eeb89
Update read_file.py
Majikjack620 Jun 15, 2023
6314cff
Merge pull request #41 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
cdc9602
Update ci.yml
Majikjack620 Jun 15, 2023
44ba9ce
Merge pull request #42 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
fba009e
Update ci.yml
Majikjack620 Jun 15, 2023
c9d0ee7
Merge pull request #43 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
5e8f42f
Update ci.yml
Majikjack620 Jun 15, 2023
376ceb6
Update requirements.txt
Majikjack620 Jun 15, 2023
64ad2bd
Update ci.yml
Majikjack620 Jun 15, 2023
4c1cfff
Update read_file.py
Majikjack620 Jun 15, 2023
8b33770
Merge pull request #47 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
8e3243e
Update ci.yml
Majikjack620 Jun 15, 2023
0df46ba
Update requirements.txt
Majikjack620 Jun 15, 2023
7a0aa2d
Merge pull request #48 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
b6d8cfa
Update read_file.py
Majikjack620 Jun 15, 2023
9046c53
Update requirements.txt
Majikjack620 Jun 15, 2023
6162a23
Merge pull request #49 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
581d0bd
Update requirements.txt
Majikjack620 Jun 15, 2023
d542c20
Update ci.yml
Majikjack620 Jun 15, 2023
27dbf77
Merge pull request #50 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
9349414
Update requirements.txt
Majikjack620 Jun 15, 2023
013bf0d
Update ci.yml
Majikjack620 Jun 15, 2023
01878d7
Merge pull request #51 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 15, 2023
782c52f
Update ci.yml
Majikjack620 Jun 16, 2023
5bf642a
Update ci.yml
Majikjack620 Jun 16, 2023
310eabb
Merge pull request #52 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 16, 2023
fb90ea9
Update read_file.py
Majikjack620 Jun 16, 2023
7d1cad2
Update requirements.txt
Majikjack620 Jun 16, 2023
84b8107
Update ci.yml
Majikjack620 Jun 16, 2023
b7d7643
Update ci.yml
Majikjack620 Jun 16, 2023
c551c4a
Merge pull request #54 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 16, 2023
044f853
Update ci.yml
Majikjack620 Jun 16, 2023
e1f1958
Update read_file.py
Majikjack620 Jun 16, 2023
22bab94
Update read_file.py
Majikjack620 Jun 16, 2023
64ac3c4
Create check_pass_fail.py
Majikjack620 Jun 16, 2023
429ba47
Delete read_file.py
Majikjack620 Jun 16, 2023
172db91
Create read_file.py
Majikjack620 Jun 16, 2023
bf2c6f1
Update ci.yml
Majikjack620 Jun 16, 2023
0e39b74
Merge pull request #55 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 16, 2023
578aa3f
Update ci.yml
Majikjack620 Jun 16, 2023
041348f
Merge pull request #56 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 16, 2023
057d47a
Update read_file.py
Majikjack620 Jun 16, 2023
72ce057
Merge pull request #57 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 16, 2023
1b397c8
Update ci.yml
Majikjack620 Jun 16, 2023
dc412a4
Update check_pass_fail.py
Majikjack620 Jun 16, 2023
984ccbf
Update read_file.py
Majikjack620 Jun 16, 2023
b8983d7
Merge pull request #58 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 16, 2023
54f4679
Update ci.yml
Majikjack620 Jun 16, 2023
b8108ad
Merge pull request #59 from Majikjack620/Majikjack620-patch-1
Majikjack620 Jun 16, 2023
4bee204
Update read_file.py
Majikjack620 Jun 16, 2023
819ccc2
Update requirements.txt
Majikjack620 Jun 16, 2023
File filter

Filter by extension

Filter by extension


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

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,80 @@
name: CI

on: # Specifies when workflow is triggered
push:
branches: main
pull_request:
branches: [main, master]
types: [opened, reopened, synchronize]
workflow_dispatch: # Enables a button inside of the Actions tab to run workflow manually

permissions: # Permissions of the workflow
pull-requests: write
contents: read
issues: read

jobs: # Jobs the workflow runs
Sonar-Analysis: # Job for SonarCloud code scanning
runs-on: ubuntu-latest
steps:
- name: Checkout Repo Data
uses: actions/checkout@v3

- name: SonarCloud Analysis
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
with:
args:

# Project and organization keys from SonarCloud
-Dsonar.projectKey=Majikjack620_requirements
-Dsonar.organization=majikjack620

Dependabot-PR-Assigner: # Job for auto assigning a Dependabot PR
runs-on: ubuntu-latest
if: ${{github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- name: Assign PR to Reviewer
uses: pozil/auto-assign-issue@v1
with:
repo-token: ${{secrets.TOKENIZED}}
assignees: Majikjack620
numOfAssignee: 1
allowSelfAssign: true

Dependency-Validator: # Job for checking if dependencies are out of date
runs-on: ubuntu-latest
steps:
- name: Checkout Repo Data
uses: actions/checkout@v3

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Upgrade pip and install dependencies
run: |
pip install --upgrade pip
pip install pip-check
pip install -r requirements.txt

- name: Check for outdated dependencies
run: |
pip list --outdated
pip list --outdated >> dependent.txt
pip-check >> check_major_minor.txt
python scripts/read_file.py >> $GITHUB_STEP_SUMMARY

- if: ${{github.event_name == 'pull_request'}}
name: Summarizing outdated dependency list
run: |
gh pr comment "$PR_URL" --body-file $GITHUB_STEP_SUMMARY
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Pass/Fail Check
run: python scripts/check_pass_fail.py
18 changes: 5 additions & 13 deletions requirements.txt
Expand Up @@ -8,22 +8,14 @@ contourpy==1.0.6
# via matplotlib
cycler==0.11.0
# via matplotlib
fonttools==4.38.0
fonttools==4.34.0
# via matplotlib
kiwisolver==1.4.4
kiwisolver==1.3.1
# via matplotlib
matplotlib==3.6.2
matplotlib==3.4.2
# via
# -r requirements.in
# seaborn
numpy==1.23.5
# via
# -r requirements.in
# contourpy
# matplotlib
# pandas
# scipy
# seaborn
packaging==21.3
# via matplotlib
pandas==1.5.1
Expand All @@ -40,9 +32,9 @@ python-dateutil==2.8.2
# via
# matplotlib
# pandas
pytz==2022.6
pytz==2021.1
# via pandas
scipy==1.9.3
scipy==1.9.1
# via seaborn
seaborn==0.10.1
# via -r requirements.in
Expand Down
5 changes: 5 additions & 0 deletions scripts/check_pass_fail.py
@@ -0,0 +1,5 @@
with open('check_major_minor.txt', 'r') as checker:
content = checker.read()

if 'Minor' in content:
exit("Cannot merge: Minor dependency update(s) available")
60 changes: 60 additions & 0 deletions scripts/read_file.py
@@ -0,0 +1,60 @@
# Open file with outdated dependencies
with open('dependent.txt', 'r') as depend:

# If the file is empty, this means all dependencies are up to date
if depend == '':
print("## :heavy_check_mark: All dependencies up to date :heavy_check_mark:")

# If the file is not empty, we make a table out of it's content
else:

# Header
print("## :small_red_triangle_down: Outdated Dependencies List :small_red_triangle_down:")

# Read file line-by-line
for line in depend:
listings = list(line.split())
length = len(listings)

# Read line word-by-word
for i in range(length):

# If it is the last word in the line, advance to next line after printing
if i == length-1:
print(listings[i], end=" | \n")

# All other words will be printed as is with a '|' to make a table
else:
print(listings[i], end=" | ")

# Instructions outlining how to update outdated dependencies
print("##")
print("### Updating **SPECIFIC** Dependencies:")
print("""- Ensure that, at least, the dependency that is being updated in the ***requirements.txt*** file is connected to it's version with
'***>=***' and not '***==***' (i.e. ***pandas>=1.5.1***)""")
print("- Go inside the folder with the ***requirements.txt*** file from your CLI")
print("- Run the following command in your CLI to update the dependency:")
print(" - ***pip install {DEPENDENCY_NAME} -U --force-reinstall***")

print("### Updating **ALL** Dependencies **(not recommended, will update dependencies with major updates)**:")
print("""- Ensure that ALL dependencies in the ***requirements.txt*** file are connected to their version with
'***>=***' and not '***==***' (i.e. ***pandas>=1.5.1***)""")
print("- Go inside the folder with the ***requirements.txt*** file from your CLI")
print("- Run the following command in your CLI to update all dependencies:")
print(" - ***pip install -r requirements.txt -U --force-reinstall***")
depend.close()

# Open file that indicates major/minor upates
with open('check_major_minor.txt', 'r') as checker:
content = checker.read()

# Print a line
print("##")

# Check for major updates
if 'Major' in content:
print("#### :warning: MAJOR DEPENDENCY UPDATE(S): Make sure to check the dependency docs before updating :warning:")

# Check for minor updates
if 'Minor' in content:
print("#### :x: MINOR DEPENDENCY UPDATE(S): Update these dependencies, otherwise the check will keep failing :x:")