Skip to content

Commit

Permalink
updated test workflow actions
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Jan 23, 2024
1 parent aedc200 commit 6d67a11
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 75 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
Expand Down
87 changes: 15 additions & 72 deletions issue__112_fix_image_urls.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 23,
"execution_count": null,
"id": "eda7419e",
"metadata": {},
"outputs": [],
Expand All @@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": null,
"id": "f03b29bb",
"metadata": {},
"outputs": [],
Expand All @@ -24,85 +24,28 @@
},
{
"cell_type": "code",
"execution_count": 25,
"id": "8ec94f95",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e730f9bf96b4439e86ded04fdaa525f4",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"0it [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for x in tqdm(items, total=len(items)):\n",
" img_name = x.img_url.split('/')[-1].split('&')[0]\n",
" new_url = URL_STUB.format(quote(img_name))\n",
" x.img_url = new_url\n",
" x.save()"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "a8048e89",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'https://commons.wikimedia.org/w/index.php?title=Special:Redirect/file/{}'"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"URL_STUB"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "054659cb",
"execution_count": null,
"id": "e8e31fb5",
"metadata": {},
"outputs": [],
"source": [
"hansi = None"
"items.count()"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "4b1ad510",
"execution_count": null,
"id": "8ec94f95",
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "argument of type 'NoneType' is not iterable",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[28], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[43mURL_STUB\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mhansi\u001b[49m:\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124masd\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"\u001b[0;31mTypeError\u001b[0m: argument of type 'NoneType' is not iterable"
]
}
],
"outputs": [],
"source": [
"if URL_STUB in hansi:\n",
" print(\"asd\")"
"for x in tqdm(items, total=len(items)):\n",
" img_name = x.img_url.split('/')[-1].split('&')[0]\n",
" new_url = URL_STUB.format(quote(img_name))\n",
" if len(new_url) > 300:\n",
" new_url = None\n",
" x.img_url = new_url\n",
" x.save()"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion set_env_variables.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export $(grep -v '^#' .env | xargs)
export $(grep -v '^#' .secret | xargs)

0 comments on commit 6d67a11

Please sign in to comment.