kopia lustrzana https://github.com/jupyterhub/repo2docker
Merge pull request #1333 from jupyterhub/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdatepull/1338/head
commit
a20dd1cf97
|
@ -23,7 +23,7 @@ repos:
|
|||
|
||||
# Autoformat: Python code
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.12.1
|
||||
rev: 24.1.1
|
||||
hooks:
|
||||
- id: black
|
||||
args:
|
||||
|
|
|
@ -7,6 +7,7 @@ Usage:
|
|||
|
||||
python -m repo2docker https://github.com/you/your-repo
|
||||
"""
|
||||
|
||||
import getpass
|
||||
import json
|
||||
import logging
|
||||
|
|
|
@ -3,6 +3,7 @@ Base information for using R in BuildPacks.
|
|||
|
||||
Keeping this in r.py would lead to cyclic imports.
|
||||
"""
|
||||
|
||||
from ..semver import parse_version as V
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"""BuildPack for conda environments"""
|
||||
|
||||
import os
|
||||
import re
|
||||
import warnings
|
||||
|
@ -193,15 +194,15 @@ class CondaBuildPack(BaseImage):
|
|||
raise ValueError(
|
||||
f"Python version {py_version} on {conda_platform} is not supported!"
|
||||
)
|
||||
files[
|
||||
f"conda/{lockfile_name}"
|
||||
] = self._kernel_environment_file = "/tmp/env/kernel-environment.lock"
|
||||
files[f"conda/{lockfile_name}"] = self._kernel_environment_file = (
|
||||
"/tmp/env/kernel-environment.lock"
|
||||
)
|
||||
|
||||
requirements_file_name = f"requirements.py-{py_version}.pip"
|
||||
if os.path.exists(os.path.join(HERE, requirements_file_name)):
|
||||
files[
|
||||
f"conda/{requirements_file_name}"
|
||||
] = self._kernel_requirements_file = "/tmp/env/kernel-requirements.txt"
|
||||
files[f"conda/{requirements_file_name}"] = (
|
||||
self._kernel_requirements_file
|
||||
) = "/tmp/env/kernel-requirements.txt"
|
||||
else:
|
||||
# server and kernel are the same
|
||||
server_py_version = py_version
|
||||
|
@ -216,15 +217,15 @@ class CondaBuildPack(BaseImage):
|
|||
f"Python version {server_py_version} on {conda_platform} is not supported!"
|
||||
)
|
||||
|
||||
files[
|
||||
"conda/" + conda_frozen_name
|
||||
] = self._nb_environment_file = "/tmp/env/environment.lock"
|
||||
files["conda/" + conda_frozen_name] = self._nb_environment_file = (
|
||||
"/tmp/env/environment.lock"
|
||||
)
|
||||
|
||||
# add requirements.txt, if present
|
||||
if os.path.exists(os.path.join(HERE, pip_frozen_name)):
|
||||
files[
|
||||
"conda/" + pip_frozen_name
|
||||
] = self._nb_requirements_file = "/tmp/env/requirements.txt"
|
||||
files["conda/" + pip_frozen_name] = self._nb_requirements_file = (
|
||||
"/tmp/env/requirements.txt"
|
||||
)
|
||||
|
||||
files.update(super().get_build_script_files())
|
||||
return files
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
"""Generates a variety of Dockerfiles based on an input matrix
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
import docker
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"""Generates a Dockerfile based on an input matrix for Julia"""
|
||||
|
||||
import functools
|
||||
import os
|
||||
from functools import lru_cache
|
||||
|
|
|
@ -175,7 +175,7 @@ class JuliaRequireBuildPack(PythonBuildPack):
|
|||
r"""
|
||||
julia /tmp/install-repo-dependencies.jl "%(require)s"
|
||||
"""
|
||||
% {"require": require}
|
||||
% {"require": require},
|
||||
# TODO: For some reason, `rm`ing the file fails with permission denied.
|
||||
# && rm /tmp/install-repo-dependencies.jl
|
||||
)
|
||||
|
|
|
@ -7,6 +7,7 @@ and IPython kernel.
|
|||
|
||||
Note: This buildpack has been deprecated.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"""BuildPack for nixpkgs environments"""
|
||||
|
||||
import os
|
||||
from functools import lru_cache
|
||||
|
||||
|
|
|
@ -173,9 +173,11 @@ class PipfileBuildPack(CondaBuildPack):
|
|||
pipenv --clear \\
|
||||
)""".format(
|
||||
working_directory=working_directory,
|
||||
install_option="--ignore-pipfile"
|
||||
if os.path.exists(pipfile_lock)
|
||||
else "--skip-lock",
|
||||
install_option=(
|
||||
"--ignore-pipfile"
|
||||
if os.path.exists(pipfile_lock)
|
||||
else "--skip-lock"
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"""Generates Dockerfiles based on an input matrix based on Python."""
|
||||
|
||||
import os
|
||||
from functools import lru_cache
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ Base classes for repo2docker ContentProviders
|
|||
ContentProviders accept a `spec` of various kinds, and
|
||||
provide the contents from the spec to a given output directory.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ matcher functors take a version string and return True if it passes its
|
|||
constraints.
|
||||
"""
|
||||
|
||||
|
||||
import re
|
||||
from functools import lru_cache
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Test argument parsing and r2d construction
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
|
|
@ -6,6 +6,7 @@ container requires a specific repository and commit to be checked out,
|
|||
and that is the only thing that is tested.
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
from tempfile import TemporaryDirectory
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Test if the explict hostname is supplied correctly to the container
|
||||
"""
|
||||
|
||||
import time
|
||||
|
||||
import requests
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Test that environment variables may be defined
|
||||
"""
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"""Test if assemble scripts from outside of r2d repo are accepted."""
|
||||
|
||||
import time
|
||||
|
||||
from repo2docker.app import Repo2Docker
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Test if labels are supplied correctly to the container
|
||||
"""
|
||||
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Test if the subdirectory is correctly navigated to
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
import escapism
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Test that User name and ID mapping works
|
||||
"""
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Tests for repo2docker/utils.py
|
||||
"""
|
||||
|
||||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
|
|
Ładowanie…
Reference in New Issue