mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
pre-commit: run black without string normalization
This commit is contained in:
@@ -16,16 +16,22 @@ def prefix():
|
||||
# see https://github.com/conda-forge/miniforge/releases
|
||||
mambaforge_version = '4.10.3-7'
|
||||
if os.uname().machine == 'aarch64':
|
||||
installer_sha256 = "ac95f137b287b3408e4f67f07a284357b1119ee157373b788b34e770ef2392b2"
|
||||
installer_sha256 = (
|
||||
"ac95f137b287b3408e4f67f07a284357b1119ee157373b788b34e770ef2392b2"
|
||||
)
|
||||
elif os.uname().machine == 'x86_64':
|
||||
installer_sha256 = "fc872522ec427fcab10167a93e802efaf251024b58cc27b084b915a9a73c4474"
|
||||
installer_url = "https://github.com/conda-forge/miniforge/releases/download/{v}/Mambaforge-{v}-Linux-{arch}.sh".format(v=mambaforge_version, arch=os.uname().machine)
|
||||
installer_sha256 = (
|
||||
"fc872522ec427fcab10167a93e802efaf251024b58cc27b084b915a9a73c4474"
|
||||
)
|
||||
installer_url = "https://github.com/conda-forge/miniforge/releases/download/{v}/Mambaforge-{v}-Linux-{arch}.sh".format(
|
||||
v=mambaforge_version, arch=os.uname().machine
|
||||
)
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
with conda.download_miniconda_installer(installer_url, installer_sha256) as installer_path:
|
||||
with conda.download_miniconda_installer(
|
||||
installer_url, installer_sha256
|
||||
) as installer_path:
|
||||
conda.install_miniconda(installer_path, tmpdir)
|
||||
conda.ensure_conda_packages(tmpdir, [
|
||||
'conda==4.10.3'
|
||||
])
|
||||
conda.ensure_conda_packages(tmpdir, ['conda==4.10.3'])
|
||||
yield tmpdir
|
||||
|
||||
|
||||
@@ -35,11 +41,7 @@ def test_ensure_packages(prefix):
|
||||
"""
|
||||
conda.ensure_conda_packages(prefix, ['numpy'])
|
||||
# Throws an error if this fails
|
||||
subprocess.check_call([
|
||||
os.path.join(prefix, 'bin', 'python'),
|
||||
'-c',
|
||||
'import numpy'
|
||||
])
|
||||
subprocess.check_call([os.path.join(prefix, 'bin', 'python'), '-c', 'import numpy'])
|
||||
|
||||
|
||||
def test_ensure_pip_packages(prefix):
|
||||
@@ -49,11 +51,7 @@ def test_ensure_pip_packages(prefix):
|
||||
conda.ensure_conda_packages(prefix, ['pip'])
|
||||
conda.ensure_pip_packages(prefix, ['numpy'])
|
||||
# Throws an error if this fails
|
||||
subprocess.check_call([
|
||||
os.path.join(prefix, 'bin', 'python'),
|
||||
'-c',
|
||||
'import numpy'
|
||||
])
|
||||
subprocess.check_call([os.path.join(prefix, 'bin', 'python'), '-c', 'import numpy'])
|
||||
|
||||
|
||||
def test_ensure_pip_requirements(prefix):
|
||||
@@ -66,8 +64,4 @@ def test_ensure_pip_requirements(prefix):
|
||||
f.write(b'there')
|
||||
f.flush()
|
||||
conda.ensure_pip_requirements(prefix, f.name)
|
||||
subprocess.check_call([
|
||||
os.path.join(prefix, 'bin', 'python'),
|
||||
'-c',
|
||||
'import there'
|
||||
])
|
||||
subprocess.check_call([os.path.join(prefix, 'bin', 'python'), '-c', 'import there'])
|
||||
|
||||
Reference in New Issue
Block a user