Merge pull request #1333 from jupyterhub/pre-commit-ci-update-config

[pre-commit.ci] pre-commit autoupdate
pull/1338/head
Erik Sundell 2024-02-06 08:22:46 +01:00 zatwierdzone przez GitHub
commit a20dd1cf97
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
22 zmienionych plików z 37 dodań i 18 usunięć

Wyświetl plik

@ -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:

Wyświetl plik

@ -7,6 +7,7 @@ Usage:
python -m repo2docker https://github.com/you/your-repo
"""
import getpass
import json
import logging

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -1,5 +1,6 @@
"""Generates a variety of Dockerfiles based on an input matrix
"""
import os
import docker

Wyświetl plik

@ -1,4 +1,5 @@
"""Generates a Dockerfile based on an input matrix for Julia"""
import functools
import os
from functools import lru_cache

Wyświetl plik

@ -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
)

Wyświetl plik

@ -7,6 +7,7 @@ and IPython kernel.
Note: This buildpack has been deprecated.
"""
import logging

Wyświetl plik

@ -1,4 +1,5 @@
"""BuildPack for nixpkgs environments"""
import os
from functools import lru_cache

Wyświetl plik

@ -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"
),
),
)
)

Wyświetl plik

@ -1,4 +1,5 @@
"""Generates Dockerfiles based on an input matrix based on Python."""
import os
from functools import lru_cache

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -1,6 +1,7 @@
"""
Test argument parsing and r2d construction
"""
import os
import pytest

Wyświetl plik

@ -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

Wyświetl plik

@ -1,6 +1,7 @@
"""
Test if the explict hostname is supplied correctly to the container
"""
import time
import requests

Wyświetl plik

@ -1,6 +1,7 @@
"""
Test that environment variables may be defined
"""
import os
import subprocess
import sys

Wyświetl plik

@ -1,4 +1,5 @@
"""Test if assemble scripts from outside of r2d repo are accepted."""
import time
from repo2docker.app import Repo2Docker

Wyświetl plik

@ -1,6 +1,7 @@
"""
Test if labels are supplied correctly to the container
"""
from unittest.mock import Mock
import pytest

Wyświetl plik

@ -1,6 +1,7 @@
"""
Test if the subdirectory is correctly navigated to
"""
import os
import escapism

Wyświetl plik

@ -1,6 +1,7 @@
"""
Test that User name and ID mapping works
"""
import os
import subprocess
import tempfile

Wyświetl plik

@ -1,6 +1,7 @@
"""
Tests for repo2docker/utils.py
"""
import os
import platform
import subprocess