Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
n3hrox committed Nov 4, 2019
1 parent 82b69a5 commit 952fee5
Show file tree
Hide file tree
Showing 49 changed files with 360 additions and 322 deletions.
24 changes: 17 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
* [ ] Have you followed the guidelines in our
[Contributing document](https://dvc.org/doc/user-guide/contributing/core)?
* [ ] ❗ Have you followed the guidelines in the
[Contributing to DVC](https://dvc.org/doc/user-guide/contributing/core)
list?

* [ ] Does your PR affect documented changes or does it add new functionality
that should be documented? If yes, have you created a PR for
[dvc.org](https://github.com/iterative/dvc.org) documenting it or at
least opened an issue for it? If so, please add a link to it.
* [ ] 📖 Check this box if this PR **does not** require
[documentation](https://dvc.org/doc) updates, or if it does **and** you
have created a separate PR in
[dvc.org](https://github.com/iterative/dvc.org)
with such updates (or at least opened an issue about it in that repo).
Please link below to your PR (or issue) in the
[dvc.org](https://github.com/iterative/dvc.org) repo.

* [ ] ❌ Have you checked DeepSource, CodeClimate, and other sanity checks
below? We consider their findings recommendatory and don't expect
everything to be addresses. Please review them carefully and fix those
that actually improve code or fix bugs.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

-----
5 changes: 5 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Config for https://github.com/apps/release-drafter
branches:
- master
template: |
$CHANGES
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ neatlynx/__pycache__
cache
*.pyc
.env/
.env2.7/

cache
.dvc.conf.lock
Expand Down
11 changes: 11 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
restylers:
- name: black
image: restyled/restyler-black:v19.3b0
command:
- black
arguments: []
include:
- "**/*.py"
interpreters:
- python
2 changes: 1 addition & 1 deletion dvc/command/destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def run(self):
if not self.args.force and not prompt.confirm(statement):
raise DvcException(
"cannot destroy without a confirmation from the user."
" Use '-f' to force."
" Use `-f` to force."
)

self.repo.destroy()
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def add_parser(subparsers, parent_parser):
"--all-commits",
action="store_true",
default=False,
help="Keep data files for all commits.",
help=argparse.SUPPRESS,
)
gc_parser.add_argument(
"-c",
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/imp_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def run(self):
except DvcException:
logger.exception(
"failed to import {}. You could also try downloading "
"it manually and adding it with `dvc add` command.".format(
"it manually, and adding it with `dvc add`.".format(
self.args.url
)
)
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def add_parser(subparsers, parent_parser):
action="store_true",
default=False,
help=(
"Overwrite existing '.dvc' directory. "
"Overwrite existing '.dvc/' directory. "
"This operation removes local cache."
),
)
Expand Down
2 changes: 1 addition & 1 deletion dvc/command/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _is_outs_only(self, target):

raise DvcException(
"Cannot purge without a confirmation from the user."
" Use '-f' to force."
" Use `-f` to force."
)

def run(self):
Expand Down
6 changes: 3 additions & 3 deletions dvc/command/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def run(self):
]
): # pragma: no cover
logger.error(
"too few arguments. Specify at least one: '-d', '-o', '-O',"
" '-m', '-M', '--outs-persist', '--outs-persist-no-cache',"
" 'command'."
"too few arguments. Specify at least one: `-d`, `-o`, `-O`, "
"`-m`, `-M`, `--outs-persist`, `--outs-persist-no-cache`, "
"`command`."
)
return 1

Expand Down
6 changes: 4 additions & 2 deletions dvc/command/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from dvc.version import __version__
from dvc.exceptions import DvcException, NotDvcRepoError
from dvc.system import System

from dvc.utils.pkg import get_package_manager

logger = logging.getLogger(__name__)

Expand All @@ -31,17 +31,19 @@ def run(self):
python_version = platform.python_version()
platform_type = platform.platform()
binary = is_binary()

package_manager = get_package_manager()
info = (
"DVC version: {dvc_version}\n"
"Python version: {python_version}\n"
"Platform: {platform_type}\n"
"Binary: {binary}\n"
"Package manager: {package_manager}\n"
).format(
dvc_version=dvc_version,
python_version=python_version,
platform_type=platform_type,
binary=binary,
package_manager=package_manager,
)

try:
Expand Down
6 changes: 3 additions & 3 deletions dvc/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class ConfirmRemoveError(DvcException):
def __init__(self, path):
super(ConfirmRemoveError, self).__init__(
"unable to remove '{}' without a confirmation from the user. Use "
"'-f' to force.".format(path)
"`-f` to force.".format(path)
)


Expand Down Expand Up @@ -209,7 +209,7 @@ class NoMetricsError(DvcException):
def __init__(self):
super(NoMetricsError, self).__init__(
"no metric files in this repository. "
"Use 'dvc metrics add' to add a metric file to track."
"Use `dvc metrics add` to add a metric file to track."
)


Expand Down Expand Up @@ -247,7 +247,7 @@ def __init__(self, out_1, out_2):
class CheckoutErrorSuggestGit(DvcException):
def __init__(self, target, cause):
super(CheckoutErrorSuggestGit, self).__init__(
"Did you mean 'git checkout {}'?".format(target), cause=cause
"Did you mean `git checkout {}`?".format(target), cause=cause
)


Expand Down
11 changes: 11 additions & 0 deletions dvc/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ def _set_claimfile(self, pid=None):
self._tmp_dir, filename + ".lock"
)

# Fix for __del__ bug in flufl.lock [1] which is causing errors on
# Python shutdown [2].
# [1] https://gitlab.com/warsaw/flufl.lock/issues/7
# [2] https://github.com/iterative/dvc/issues/2573
def __del__(self):
try:
if self._owned:
self.finalize()
except ImportError:
pass


else:
import zc.lockfile
Expand Down
27 changes: 12 additions & 15 deletions dvc/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
import colorama


FOOTER = (
"\n{yellow}Having any troubles?{nc}"
" Hit us up at {blue}https://dvc.org/support{nc},"
" we are always happy to help!"
).format(
blue=colorama.Fore.BLUE,
nc=colorama.Fore.RESET,
yellow=colorama.Fore.YELLOW,
)


class LoggingException(Exception):
def __init__(self, record):
msg = "failed to log {}".format(str(record))
Expand Down Expand Up @@ -48,16 +59,6 @@ class ColorFormatter(logging.Formatter):
"CRITICAL": colorama.Fore.RED,
}

footer = (
"{yellow}Having any troubles?{nc}"
" Hit us up at {blue}https://dvc.org/support{nc},"
" we are always happy to help!"
).format(
blue=colorama.Fore.BLUE,
nc=colorama.Fore.RESET,
yellow=colorama.Fore.YELLOW,
)

def format(self, record):
if record.levelname == "INFO":
return record.msg
Expand All @@ -66,18 +67,14 @@ def format(self, record):
exception, stack_trace = self._parse_exc(record.exc_info)

return (
"{color}{levelname}{nc}: {description}"
"{stack_trace}\n"
"\n"
"{footer}"
"{color}{levelname}{nc}: {description}" "{stack_trace}\n"
).format(
color=self.color_code.get(record.levelname, ""),
nc=colorama.Fore.RESET,
levelname=record.levelname,
description=self._description(record.msg, exception),
msg=record.msg,
stack_trace=stack_trace,
footer=self.footer,
)

return "{color}{levelname}{nc}: {msg}".format(
Expand Down
4 changes: 4 additions & 0 deletions dvc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from dvc.cli import parse_args
from dvc.lock import LockError
from dvc.logger import FOOTER
from dvc.config import ConfigError
from dvc.analytics import Analytics
from dvc.exceptions import NotDvcRepoError, DvcParserError
Expand Down Expand Up @@ -75,6 +76,9 @@ def main(argv=None):
# so won't be reused by any other subsequent run anyway.
clean_repos()

if ret != 0:
logger.info(FOOTER)

Analytics().send_cmd(cmd, args, ret)

return ret
2 changes: 1 addition & 1 deletion dvc/output/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def unprotect(self):
self.remote.unprotect(self.path_info)

def _collect_used_dir_cache(self, remote=None, force=False, jobs=None):
"""Get a list of `info`s retaled to the given directory.
"""Get a list of `info`s related to the given directory.
- Pull the directory entry from the remote cache if it was changed.
Expand Down
2 changes: 1 addition & 1 deletion dvc/output/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _parse_path(self, remote, path):
# so we should expect both posix and windows style paths.
# PathInfo accepts both, i.e. / works everywhere, \ only on win.
#
# FIXME: if we have Windows path containig / or posix one with \
# FIXME: if we have Windows path containing / or posix one with \
# then we have #2059 bug and can't really handle that.
p = self.REMOTE.path_cls(path)
if not p.is_absolute():
Expand Down
Loading

0 comments on commit 952fee5

Please sign in to comment.