Skip to content

Commit

Permalink
Merge pull request #1385 from andruum/master
Browse files Browse the repository at this point in the history
moved uname into func to fix Windows import error
  • Loading branch information
jph00 authored Feb 26, 2024
2 parents 96deb7a + 940d55d commit bb40051
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nbdev/quarto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# %% ../nbs/api/14_quarto.ipynb 3
from __future__ import annotations
import subprocess,sys,shutil,ast,warnings,traceback
from os import system, uname
from os import system
from contextlib import contextmanager

from .config import *
Expand All @@ -30,6 +30,7 @@ def _sprun(cmd):
BASE_QUARTO_URL='https://www.quarto.org/download/latest/'

def _install_linux():
from os import uname
machine = 'arm' if uname().machine in ('arm64', 'aarch64', 'armv8', 'armv8l') else 'amd'
system(f'curl -LO {BASE_QUARTO_URL}quarto-linux-{machine}64.deb')
system(f'sudo dpkg -i quarto-linux-{machine}64.deb && rm quarto-linux-{machine}64.deb')
Expand Down
17 changes: 15 additions & 2 deletions nbs/api/14_quarto.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"#|export\n",
"from __future__ import annotations\n",
"import subprocess,sys,shutil,ast,warnings,traceback\n",
"from os import system, uname\n",
"from os import system\n",
"from contextlib import contextmanager\n",
"\n",
"from nbdev.config import *\n",
Expand Down Expand Up @@ -97,6 +97,7 @@
"BASE_QUARTO_URL='https://www.quarto.org/download/latest/'\n",
"\n",
"def _install_linux():\n",
" from os import uname\n",
" machine = 'arm' if uname().machine in ('arm64', 'aarch64', 'armv8', 'armv8l') else 'amd'\n",
" system(f'curl -LO {BASE_QUARTO_URL}quarto-linux-{machine}64.deb')\n",
" system(f'sudo dpkg -i quarto-linux-{machine}64.deb && rm quarto-linux-{machine}64.deb')\n",
Expand Down Expand Up @@ -646,7 +647,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "3d8031ce",
"metadata": {},
"outputs": [],
Expand All @@ -669,6 +670,18 @@
"display_name": "python3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit bb40051

Please sign in to comment.