- Keep current SSH remote connection test on real system
- Faked and Mocked SSH server which running on both Linux and Windows
- Add corresponding tests
Fixed#1704
* test: remove never used copy of load_stage_file()
* dvc: save comments and custom formatting in stage files
* Add a couple of TODOs
* test: test repro doesn't clear comments and formatting in .dvc
As part of this I started writing pytest-like tests and added commonly
used fixtures.
* test: simplify and prettify dvc formatting retained test
Also test that line comments after md5 fields are retained.
* test: fix tests
* dvc: fix stage and metrics opens not closed
* dvc: always use utf-8 in stage files
It used to encode in system default encoding. Not sure if PyYAML was
handling this silently or we were just lucky all the way.
* test: unit test apply_diff()
* test: remove TODOs and ASK
* dvc: polish dvc-formatting PR
* dvc: move stage load/dump utils to a new stage utils file
* dvc: clean up apply_diff()
* test: test stage md5 ignores comments
* test: remove pytests starting marker
- Use `version.py` to compute a dynamic version stored in `__version__`.
Version information was scattered across the source code
(`VERSION_BASE`, `VERSION`, `__version__`, and `version.py`).
- Read `__version__` from `setup.py` and **pin** it using custom
`build_py` command class.
This way, we can maintain consistancy between the build version
and the runtime one.
Also, this gives us the ability to run `setup.py` without depending on
on `dvc` itself.
Close#1824
When adding a remote file with
```
$ dvc add s3://bucket/path
```
it results in
```
Error: failed to add file - is local is not supported for s3
```
Signed-off-by: Ruslan Kuprieiev <[email protected]>
The `dvc/scm/__init__.py:scm_context` works with `Repo` objects and
is used mostly in `dvc/repo/...`, so it is better to put it in
`dvc/repo/scm_context.py`.
Fix#1769
Abstract access to filesystem and its implementation to access files and
particulary Stage objects in different git branches without `git
checkout` execution.
Sometimes it is handy to manually update the stage MD5 checksum after some non-breaking changes were made (e.g. renaming an output file). Logging the computed md5 hash in verbose mode can help experienced users to fix this problem.
1) split Project's methods into separate files;
2) rename Project into Repo(similar to gitpython's Repo)
Signed-off-by: Ruslan Kuprieiev <[email protected]>
Otherwise we get this on python2:
```
======================================================================
ERROR: test_fetch (tests.unit.updater.TestUpdater)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/efiop/.pyenv/versions/2.7.15/envs/2.7.15-dvc/local/lib/
python2.7/site-packages/mock/mock.py", line 1305, in patched
return func(*args, **keywargs)
File "/home/efiop/git/dvc/tests/unit/updater.py", line 34, in test_fetch
self.dvc.updater.fetch(detach=False)
File "/home/efiop/git/dvc/dvc/updater.py", line 77, in fetch
self._with_lock(self._get_latest_version, "fetching")
File "/home/efiop/git/dvc/dvc/updater.py", line 39, in _with_lock
func()
File "/home/efiop/git/dvc/dvc/updater.py", line 91, in _get_latest_version
json.dump(convert_to_unicode(info), fobj)
File "/usr/lib/python2.7/json/__init__.py", line 190, in dump
fp.write(chunk)
TypeError: write() argument 1 must be unicode, not str
-------------------- >> begin captured logging << --------------------
```
Signed-off-by: Ruslan Kuprieiev <[email protected]>
flake8 provides some additional features like unused vars check, etc, so
it makes total sense to use it as well.
Signed-off-by: Ruslan Kuprieiev <[email protected]>