Commit Graph
52 Commits
Author SHA1 Message Date
Paweł Redzyński 451c7aac04 tests: erepo_dir: extract remote setup to separate method (#3748) 2020-05-12 02:05:22 +03:00
Casper da Costa-Luis 2bb7257a06 lint: isort pre-commit & misc improvements (#3749)
* test: clean flake8 config root clutter

* test: pre-commit: add isort

Compatible with black (see https://github.com/timothycrosley/isort/issues/694)

* lint: reorder imports

* lint: more complex imports

* lint: fix deepsource

* config: isort: add first party dvc

* tests: restyled: add isort

* temp commit to revert before merge

* Revert "temp commit to revert before merge"

This reverts commit 11db0fd8e95fe891597cbb9bf804480909b19e24.
2020-05-06 23:56:07 +03:00
Ruslan Kuprieiev 93d7b9173b tests: use --single-stage 2020-05-04 20:23:49 +03:00
Saugat PachhaiandRuslan Kuprieiev 1937527249 dvc: implement multistage dvcfile (#3676)
* dvc: use lockfile as yaml instead of json

* refactor Dvcfile into Pipeline file and Single stage file

* fix tests

* dvc: fix outputs

* add more tests for collection of outputs

* add tests for data cloud/get/import/ls

* tests: test for checkouts

* Allow other checksums other than md5

* tests: use iterdir instead of os.listdir

* cleanup errors reported by cc and ds

* utils: throw DvcException instead of plain Exception

* tests: use yaml.load instead of json.load

* run: split assignments

* Update dvc/stage/exceptions.py

Co-authored-by: Ruslan Kuprieiev <[email protected]>
2020-04-28 13:36:05 +03:00
Mr. Outis 57d02195b5 get/import: retrieve files inside directory outs (#3309)
* get/import: retrieve files inside directory outs

Close #2458

* fs: move, fspath_py35 -> fspath
2020-02-17 03:24:02 +02:00
Alexander Schepanovski 6ccae711fe dvc: refactor config (#3298)
* dvc: refactor config

Advantages:
- read like a dict
- modify as a dict for testing or manipulation purposes
- wrap modifications into context manager to save them:

    with config.edit("local") as conf:
        conf["core"]["remote"] = "new-default"

Design decisions:
- dropped string constants
- remote sections are parsed into a simple subdict upon load
- remote config schema is now defined by url scheme
- relative paths are handled transparently upon load/save
- user config and remote manipulations are moved to commands
- same dev manipulations are done by simply modifying a config dict

* test: do not set cache.type for remotes that doesn't support it

* dvc: fix windows absolute paths validation in config

* test: fix windows separate drive test

* dvc: stylistic fixes in config
2020-02-13 19:35:37 +02:00
Aljoscha SteffensandRuslan Kuprieiev e7b3297c2d check root .gitignore in '_ignored' (#3284)
* made '_ignored' check if the given file is already ignored by the root .gitignore. Added corresponding functional test

* code formatting

* Changed method input, adjusted tests, formatted code

* typo

* tests: use git logger fix in conftest

See https://github.com/iterative/dvc/issues/3167

* scm: git: remove redundant comments

Co-authored-by: Ruslan Kuprieiev <[email protected]>
2020-02-06 19:52:27 +02:00
Jorge Orpinel 69c1aa5bbf dvc: revert capitalization of logger.exception strings
per https://github.com/iterative/dvc/pull/3220#pullrequestreview-347083819
2020-01-23 00:50:24 -06:00
Jorge Orpinel d06bd6abd8 tests: match recent commits and
other misc. language improvements
2020-01-23 00:35:15 -06:00
Alexander Schepanovski 5af7a9d850 test: add git_dir 2020-01-21 20:56:04 +07:00
Alexander Schepanovski 033ef88a4e external: refactor external_repo() and its users
Some things are fixed along the way:
- no cache shared between incompatible funcs
- some incosistent exceptions are now consistent
- import updates for git files now works both for dvc and git repos
- "auto-generated-upstream already exists" fixed
- dvc.api.open()/read() works with git repos now

Fixes #3124, #2976. Closes #3172.
2020-01-19 21:38:06 +07:00
Saugat Pachhai f130e18e2c get: use new exception from public api 2020-01-16 19:28:14 +05:45
Saugat Pachhai eb252e055b get: split command for getting url and getting files from url functions 2020-01-16 19:28:14 +05:45
Saugat Pachhai 4509f82bc3 get: implement --show-url to display only url/path to remote 2020-01-16 19:28:14 +05:45
Paweł Redzyński 36c64c66db test_get_from_non_dvc_master: add comment about git logs 2020-01-16 11:49:03 +01:00
Paweł Redzyński 18446996ab get: tes_get_from_non_dvc_master: capture git logs at INFO 2020-01-16 10:43:48 +01:00
Fábio Santos de303d45ba test removing a file outside a raw git repo 2020-01-10 23:30:18 +00:00
Fábio Santos 0dd5647d3c get: handle non-DVC repositories
Allows us to `dvc get` from non-DVC source repositories.

Fixes #3089
2020-01-10 22:28:24 +00:00
Aman Sharma eca5d2dde4 Move makedirs to fs.py 2020-01-09 04:30:51 +05:30
Alexander Schepanovski b194bfa1ff test: do not bootstrap versions in erepo_dir 2020-01-04 10:47:13 +07:00
Alexander Schepanovski 1e5fb102a2 test: add @TmpDir.chdir() 2020-01-03 16:58:32 +07:00
Mr. Outis 086acf6404 py3: dvc/utils/compat.py -> dvc/compat.py 2019-12-31 23:42:07 -06:00
Mr. Outis 94a0914bba py3: get rid of future imports 2019-12-30 19:35:48 -06:00
Ruslan Kuprieiev fe7fa1424b tests: func: convert test_get.py test_utils.py to new fixtures 2019-12-30 09:38:48 +02:00
Alexander Schepanovski 9607e5f873 get: refactor, clean up and fix dvc get implementation
Things changed:
- both no output and no git file result into PathMissingError now
- fail on missing cache or cache download error loudly
- removed sqlite bypass, since we use nolock now anyway

Refactoring:
- streamlined logic and made it similar to Repo.open() one
- moved exclusive exception classes to dvc.repo.get
2019-12-09 21:02:49 +03:00
Dani Hodovic 29b34bacc2 fixup! fixes 2019-12-06 21:55:54 +01:00
Dani Hodovic d59bceb71a fixes 2019-12-06 20:20:25 +01:00
Dani Hodovic 811855ade2 fixes 2019-12-06 18:56:19 +01:00
Dani Hodovic 7debaca22e fixup! fix error message for git files 2019-12-05 21:05:38 +01:00
Dani Hodovic 9ae4ab88bf fix error message for git files 2019-12-05 21:05:04 +01:00
Dani Hodovic b17d1c5b04 fixup 2019-12-05 21:05:03 +01:00
Dani Hodovic 3c2633e33f Pass all tests 2019-12-05 21:05:03 +01:00
Dani Hodovic 38bed227c6 fixup 2019-12-05 21:05:03 +01:00
Dani Hodovic 9ece4ed8ad ensure absolute paths for dvc files work but not for git 2019-12-05 21:05:02 +01:00
Dani Hodovic ed10497854 Remove unused var 2019-12-05 21:05:02 +01:00
Dani Hodovic cadbf10e64 dont use absolute paths in tests 2019-12-05 21:05:02 +01:00
Dani Hodovic 74f3851117 Disallow absolute paths in dvc get 2019-12-05 21:05:02 +01:00
Dani Hodovic 7e1423d13c fix tests 2019-12-05 21:05:01 +01:00
Dani Hodovic 8c3ffe816d fixup! Make tree.walk() output deterministic 2019-12-05 21:05:01 +01:00
Dani Hodovic 4d14256995 fixup! get: copy regular files 2019-12-05 21:05:01 +01:00
Dani Hodovic af2f216c5e get: copy regular files
Allows `dvc get` to copy regular files or directories.

fixes: #2515
2019-12-05 21:05:00 +01:00
pawel ca852170c1 get: test: from non-dvc master: refactor 2019-12-04 14:34:50 +01:00
Paweł Redzyński f1d59dd64d conftest: empty dir is tmp_path now 2019-12-04 13:10:06 +01:00
pawel 5e5c82652b test: get: inline erepo with non-dvc master 2019-12-04 13:10:06 +01:00
Paweł Redzyński b9d5933f5d external repo: checkout rev before initializing repo 2019-12-04 13:10:06 +01:00
Dani Hodovic 78c505f6cb test: refactor & remove redundant test fixtures
https://github.com/iterative/dvc/pull/2837#discussion_r351318487
2019-11-28 19:04:56 +01:00
Ivan Shcheklein c25715dc72 get: fix override external repo cache type 2019-11-05 16:27:01 -08:00
Ruslan Kuprieiev 95fe1578bb dvc: automatically reorder imports 2019-11-05 02:34:40 +02:00
Ruslan Kuprieiev 0bfb3c0ab2 get/import/url: handle existing output directory (#2610)
* get/import/url: handle existing output directory

Currently if you run

```
dvc get https://github.com/iterative/example-get-started model.pkl --out .
```

it will nuke your cwd. To fix that we need to properly handle existing
directories, same as usual unix cli utilities do that.

* travis: specify python version when installing from chocolatey

Fixes #2609
2019-10-15 22:42:52 +03:00
Mr. Outis b903fe8023 get: show error message when path is a DVC-file (#2470)
* get: show error message when path is a DVC-file

Fix #2468

* exceptions: rename output for data artifact

* get: use method to indetify if file is a DVC-file

* exceptions: change GetDVCFileError message
2019-09-06 21:11:23 +03:00