Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 5, 2024
1 parent 625b296 commit f2c1cb7
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 17 deletions.
1 change: 1 addition & 0 deletions repo2docker/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
python -m repo2docker https://github.com/you/your-repo
"""

import getpass
import json
import logging
Expand Down
1 change: 1 addition & 0 deletions repo2docker/buildpacks/_r_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Keeping this in r.py would lead to cyclic imports.
"""

from ..semver import parse_version as V


Expand Down
25 changes: 13 additions & 12 deletions repo2docker/buildpacks/conda/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""BuildPack for conda environments"""

import os
import re
import warnings
Expand Down Expand Up @@ -193,15 +194,15 @@ def get_build_script_files(self):
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
Expand All @@ -216,15 +217,15 @@ def get_build_script_files(self):
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
Expand Down
1 change: 1 addition & 0 deletions repo2docker/buildpacks/docker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Generates a variety of Dockerfiles based on an input matrix
"""

import os

import docker
Expand Down
1 change: 1 addition & 0 deletions repo2docker/buildpacks/julia/julia_project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generates a Dockerfile based on an input matrix for Julia"""

import functools
import os
from functools import lru_cache
Expand Down
2 changes: 1 addition & 1 deletion repo2docker/buildpacks/julia/julia_require.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def get_assemble_scripts(self):
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
)
Expand Down
1 change: 1 addition & 0 deletions repo2docker/buildpacks/legacy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Note: This buildpack has been deprecated.
"""

import logging


Expand Down
1 change: 1 addition & 0 deletions repo2docker/buildpacks/nix/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""BuildPack for nixpkgs environments"""

import os
from functools import lru_cache

Expand Down
8 changes: 5 additions & 3 deletions repo2docker/buildpacks/pipfile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ def get_assemble_scripts(self):
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"
),
),
)
)
Expand Down
1 change: 1 addition & 0 deletions repo2docker/buildpacks/python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generates Dockerfiles based on an input matrix based on Python."""

import os
from functools import lru_cache

Expand Down
1 change: 1 addition & 0 deletions repo2docker/contentproviders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ContentProviders accept a `spec` of various kinds, and
provide the contents from the spec to a given output directory.
"""

import logging
import os

Expand Down
1 change: 0 additions & 1 deletion repo2docker/semver.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
constraints.
"""


import re
from functools import lru_cache

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_args.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test argument parsing and r2d construction
"""

import os

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_clone_depth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
and that is the only thing that is tested.
"""

import os
import subprocess
from tempfile import TemporaryDirectory
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_connect_url.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test if the explict hostname is supplied correctly to the container
"""

import time

import requests
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_env.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test that environment variables may be defined
"""

import os
import subprocess
import sys
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_external_scripts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test if assemble scripts from outside of r2d repo are accepted."""

import time

from repo2docker.app import Repo2Docker
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_labels.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test if labels are supplied correctly to the container
"""

from unittest.mock import Mock

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_subdir.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test if the subdirectory is correctly navigated to
"""

import os

import escapism
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_users.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test that User name and ID mapping works
"""

import os
import subprocess
import tempfile
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for repo2docker/utils.py
"""

import os
import platform
import subprocess
Expand Down

0 comments on commit f2c1cb7

Please sign in to comment.