Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Black version to 20.8b1 and use --target-version=py36 #955

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: 19.10b0
rev: 20.8b1
hooks:
- id: black
args: [--target-version=py35]
args: [--target-version=py36]
6 changes: 2 additions & 4 deletions repo2docker/buildpacks/conda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ def get_preassemble_script_files(self):
return assemble_files

def get_env_scripts(self):
"""Return series of build-steps specific to this source repository.
"""
"""Return series of build-steps specific to this source repository."""
scripts = []
environment_yml = self.binder_path("environment.yml")
env_prefix = "${KERNEL_PYTHON_PREFIX}" if self.py2 else "${NB_PYTHON_PREFIX}"
Expand Down Expand Up @@ -340,6 +339,5 @@ def get_assemble_scripts(self):
return scripts

def detect(self):
"""Check if current repo should be built with the Conda BuildPack.
"""
"""Check if current repo should be built with the Conda BuildPack."""
return os.path.exists(self.binder_path("environment.yml")) and super().detect()
6 changes: 3 additions & 3 deletions repo2docker/buildpacks/julia/julia_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def get_env(self):
def get_path(self):
"""Adds path to Julia binaries to user's PATH.

Returns:
an ordered list of path strings. The path to the Julia
executable is added to the list.
Returns:
an ordered list of path strings. The path to the Julia
executable is added to the list.

"""
return super().get_path() + ["${JULIA_PATH}/bin"]
Expand Down
6 changes: 3 additions & 3 deletions repo2docker/buildpacks/julia/julia_require.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ def get_build_env(self):
def get_path(self):
"""Adds path to Julia binaries to user's PATH.

Returns:
an ordered list of path strings. The path to the Julia
executable is added to the list.
Returns:
an ordered list of path strings. The path to the Julia
executable is added to the list.

"""
return super().get_path() + ["${JULIA_HOME}"]
Expand Down
9 changes: 3 additions & 6 deletions repo2docker/buildpacks/nix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class NixBuildPack(BaseImage):
"""A nix Package Manager BuildPack"""

def get_path(self):
"""Return paths to be added to PATH environemnt variable
"""
"""Return paths to be added to PATH environemnt variable"""
return super().get_path() + ["/home/${NB_USER}/.nix-profile/bin"]

def get_env(self):
Expand Down Expand Up @@ -47,16 +46,14 @@ def get_build_scripts(self):
]

def get_build_script_files(self):
"""Dict of files to be copied to the container image for use in building
"""
"""Dict of files to be copied to the container image for use in building"""
return {
"nix/install-nix.bash": "/home/${NB_USER}/.local/bin/install-nix.bash",
"nix/nix-shell-wrapper": "/usr/local/bin/nix-shell-wrapper",
}

def get_assemble_scripts(self):
"""Return series of build-steps specific to this source repository.
"""
"""Return series of build-steps specific to this source repository."""
return super().get_assemble_scripts() + [
(
"${NB_USER}",
Expand Down
6 changes: 2 additions & 4 deletions repo2docker/buildpacks/pipfile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ def get_preassemble_scripts(self):
return scripts

def get_assemble_scripts(self):
"""Return series of build-steps specific to this repository.
"""
"""Return series of build-steps specific to this repository."""
# If we have either Pipfile.lock, Pipfile, or runtime.txt declare the
# use of Python 2, Python 2.7 will be made available in the *kernel*
# environment. The notebook servers environment on the other hand
Expand Down Expand Up @@ -168,8 +167,7 @@ def get_assemble_scripts(self):
return assemble_scripts

def detect(self):
"""Check if current repo should be built with the Pipfile buildpack.
"""
"""Check if current repo should be built with the Pipfile buildpack."""
# first make sure python is not explicitly unwanted
runtime_txt = self.binder_path("runtime.txt")
if os.path.exists(runtime_txt):
Expand Down
3 changes: 1 addition & 2 deletions repo2docker/buildpacks/python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ def get_assemble_scripts(self):
return assemble_scripts

def detect(self):
"""Check if current repo should be built with the Python buildpack.
"""
"""Check if current repo should be built with the Python buildpack."""
requirements_txt = self.binder_path("requirements.txt")
runtime_txt = self.binder_path("runtime.txt")
setup_py = "setup.py"
Expand Down
2 changes: 1 addition & 1 deletion repo2docker/contentproviders/dataverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Dataverse(DoiProvider):
"""
Provide contents of a Dataverse dataset.

This class loads a a list of existing Dataverse installations from the internal
file dataverse.json. This file is manually updated with the following command:

Expand Down
2 changes: 1 addition & 1 deletion repo2docker/contentproviders/figshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class Figshare(DoiProvider):
"""Provide contents of a Figshare article.

See https://docs.figshare.com/#public_article for API docs.

Examples:
Expand Down