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

19 GitHub action for pylint is broken #21

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
20 changes: 10 additions & 10 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Conda environment with Python ${{ matrix.python-version }}
uses: s-weigand/setup-conda@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
conda-channels: 'conda-forge'
- name: Install dependencies
run: |
conda env update --file environment.yml
- name: Activate conda environment
run: |
conda init bash
source /home/runner/.bashrc
conda activate waldo-dev-env
python -m pip install --upgrade pip
pip install opencv-python
pip install pylint
pip install pytube
pip install pandas
pip install requests
pip install validators
- name: Analyze the code with pylint
run: |
pylint $(git ls-files '*.py')
20 changes: 13 additions & 7 deletions utils/link_retrieval.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
'''
Retrieves gameplay URLs from Waldo Vision API and stores them locally in a CSV.
'''

import argparse
import os
from pathlib import Path
import pandas as pd
import requests
import validators
from common import ensure_dir_exists
from pathlib import Path

# Set up command line arguments
parser = argparse.ArgumentParser(description="Get URL's from API and store them locally")
Expand Down Expand Up @@ -43,8 +47,8 @@ def parse_data(data):
return print("Invalid URL: " + row['url'])

return response_dataframe
except Exception as e:
print(f"Error while parsing data: {e}")
except Exception as error:
print(f"Error while parsing data: {error}")
return pd.DataFrame(columns=['id', 'url', 'game'])

def main():
Expand Down Expand Up @@ -85,14 +89,16 @@ def main():

# Save the downloaded links to a file
valid_urls_df = pd.DataFrame(valid_urls)
valid_urls_df.to_csv(os.path.join(Path(download_dir), "links.csv"), index=True, columns=["id", "url", "game"])
valid_urls_df.to_csv(os.path.join(Path(download_dir), "links.csv"),
index=True, columns=["id", "url", "game"])
except requests.exceptions.Timeout as timeout_error:
print(f"Request timed out: {timeout_error}")
except requests.exceptions.TooManyRedirects as redirect_error:
print(f"Too many redirects: {redirect_error}")
except requests.exceptions.RequestException as request_error:
print(f"Request failed: {request_error}")
except Exception as e:
print(f"An error occurred: {e}")
except Exception as other_error:
print(f"An error occurred: {other_error}")

if __name__ == "__main__":
main()
main()
6 changes: 5 additions & 1 deletion utils/segmentation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
'''
Code for testing OCR for clip segmentation
'''

import argparse
import os
from pathlib import Path
Expand Down Expand Up @@ -37,4 +41,4 @@
for line in result:
for word in line:
if word[1][1] >= 0.85:
print(word[1])
print(word[1])