Commit Graph
7519 Commits
Author SHA1 Message Date
Saugat Pachhai (सौगात) 120eb09c4d fs: move GitFileSystem out of dvc.objects.fs
This is more of a DVC thing than objects.
2022-05-17 16:50:33 +05:45
Saugat Pachhai (सौगात) bf7892012d objects.fs: copy executors to dvc.objects 2022-05-17 16:50:21 +05:45
Saugat Pachhai (सौगात) 36605eea4c objects.hash: rename HashedStreamReader to HashStreamFile 2022-05-17 13:25:38 +03:00
Saugat Pachhai (सौगात) 01e5f9eadd objects.hash: use fobj.read instead of read1 2022-05-17 13:25:38 +03:00
Saugat Pachhai (सौगात) 752e10a834 dvc.objects: move HashedStreamReader to objects, use it for calculating fobj_md5
Now HashedStreamReader will be used to calculate md5 in fobj_md5/hash_file.

Also:
* adds in `bytes_md5` that may be useful for testing.
* adds a hasher-registry with hashlib
* adds a `text=` kwarg to be able to specify to use dos2unix or not
  (useful for testing)
* makes `localfs` the default filesystem when `fs` arg is not passed
  (makes it easier to test in the REPL)
2022-05-17 13:25:38 +03:00
Saugat Pachhai (सौगात) 092eda183c objects.fs: use getpass for prompts
Note that this will change the behaviour of DVC to always show
prompt even in --quiet mode, which is what we need.
Previously it'd prompt without any message.
2022-05-17 16:06:27 +05:45
Saugat Pachhai (सौगात) d82e094b13 fs: move filesystems to dvc.objects.fs.implementations 2022-05-16 17:54:57 +03:00
Saugat Pachhai (सौगात) 570e3a5359 dvc.fs: move fs to dvc.objects.fs
Some of the APIs/FileSystems are reimported inside dvc.fs module.
2022-05-16 13:15:19 +03:00
Saugat Pachhai (सौगात) b8e770747f fs.utils: copy dvc.utils.fs to dvc.fs.utils 2022-05-16 11:51:48 +05:45
dependabot[bot] 1999ecf0d3 build(deps-dev): Bump pylint from 2.13.8 to 2.13.9
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.8 to 2.13.9.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.13.8...v2.13.9)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-05-16 08:54:42 +05:45
dependabot[bot] 1ff5f30839 build(deps-dev): Bump filelock from 3.6.0 to 3.7.0
Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/py-filelock/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/py-filelock/compare/3.6.0...3.7.0)

---
updated-dependencies:
- dependency-name: filelock
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-05-15 19:57:31 -07:00
Saugat Pachhai (सौगात) c6ae91c907 dvc.fs: fix iscopy 2022-05-16 08:25:23 +05:45
Saugat Pachhai (सौगात) dc1d3e880a dvc.objects.cache: set type in a more compatible way
It turns out that diskcache.Disk saves passed arguments to the database
and uses that all the time. So this means that we are not forward
compatible as it breaks moving from newer version of DVC to an older
one. We don't promise this, but this breaks our benchmarks which
are probably not isolated enough.

Regarding the use of cache, it is a bit iffy to extend it this way.
We only need this type for error messages. We could consider removing
this, but since the error message is documented and it's not too hard
to extend this :), I decided to preserve the message.
2022-05-13 11:00:31 +05:45
Saugat Pachhai (सौगात) 3f5757a0a5 dvc.objects: move hashing functions to dvc.objects
This commit moves `HashedStreamReader`/`get_hash_file`/`file_md5`
into `dvc.objects.hash`.

The `get_hash_file` has been renamed to `hash_file`.
This also copies `relpath` and `is_exec` to the `dvc.fs.utils`.
2022-05-12 20:33:18 +03:00
Daniele Trifirò 7a795f79db dvc.data: save and try loading raw dir objects
When staging a directory, always save a "raw dir object" to the odb.
If the corresponding ".dir" object has not been added to the odb,
`stage()` calls can load the tree from the raw dir object instead of
rebuilding it by walking the directory.

This can lead to significant speed improvements when calling
`dvc status` for modified directories.

Fixes #7390
2022-05-12 19:27:36 +03:00
skshetry b3fb0dfdad dvc.objects: extend diskcache to handle pickle errors (#7734)
dvc.objects: extend diskcache to handle pickle errors
2022-05-12 21:12:33 +05:45
Saugat Pachhai (सौगात) ee29888e18 dvc.objects: move get_mtime_and_size to dvc.objects.utils 2022-05-12 18:02:42 +03:00
Saugat Pachhai (सौगात) 11eaa87849 add typings to istextfile and system
Also moves umask to dvc.fs.system
2022-05-12 18:02:42 +03:00
Saugat Pachhai (सौगात) b4faa5616f system: change System class to a dvc.fs.system module 2022-05-12 18:02:42 +03:00
Saugat Pachhai (सौगात) 4d6df989f2 dvc.objects: change imports to relative 2022-05-12 18:02:42 +03:00
Saugat Pachhai (सौगात) e585c52187 istextfile: move to dvc.objects 2022-05-12 18:02:42 +03:00
Saugat Pachhai (सौगात) 4add88f627 objects: move System to dvc.fs 2022-05-12 18:02:42 +03:00
Saugat Pachhai (सौगात) aac2fc0ca0 dvc.fs: rename fs.utils to fs.generic
In the spirit of fsspec.generic, it is for cross-filesystem operations.
Trying to avoid `fs.utils` as much as possible, but we have some
functions that are really utilities coming, so I am making a place
for them. :)
2022-05-12 18:02:15 +03:00
Ruslan Kuprieiev 005d56eedf fs: rename RepoFileSystem to DvcFileSystem 2022-05-12 00:39:41 +03:00
Ruslan Kuprieiev b6d25825c8 fs: rename DvcFileSystem to DataFileSystem
Current naming for `DvcFileSystem` and `RepoFileSystem` is confusing, because
dvc is not only about data and it is much more natural to expect something
named `dvcfs` to include complete view for your whole repo (including git
files), which is what `repofs` is doing right now.

`DvcFileSystem` can provide a view not only for the repo data, but also for
external data (e.g. local external outputs). So it makes more sense to call
it a `DataFileSystem`, since it really represents the data management side
of dvc.
2022-05-11 21:49:57 +03:00
dberenbaum 799dca8b67 update value prop in readme 2022-05-11 19:52:11 +03:00
Karthikeyan SingaravelanandDavid de la Iglesia Castro 3faf413288 Use sorted output in test since order is not deterministic.
Co-authored-by: David de la Iglesia Castro <[email protected]>
2022-05-11 18:40:21 +03:00
Karthikeyan Singaravelan a3261637de dag: fix dot file rendering order. 2022-05-11 18:40:21 +03:00
Karthikeyan Singaravelan b8d738220d Revert other tests and test only glob exception. 2022-05-11 18:37:09 +03:00
pre-commit-ci[bot] fb36db450f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-05-11 18:37:09 +03:00
Karthikeyan SingaravelanandDavid de la Iglesia Castro 946ceb288d Update tests/func/test_data_cloud.py
Co-authored-by: David de la Iglesia Castro <[email protected]>
2022-05-11 18:37:09 +03:00
Karthikeyan Singaravelan 8d99ce06aa Move test to test_data_cloud. 2022-05-11 18:37:09 +03:00
Karthikeyan Singaravelan 9b3873c4f0 Move exception raising to glob_targets to cover all commands. 2022-05-11 18:37:09 +03:00
Karthikeyan Singaravelan e177f041c8 Fail on sync when there is no match for glob. 2022-05-11 18:37:09 +03:00
Ruslan Kuprieiev a80a85e6bd dvc: detach gitfs from local paths
Our gitfs paths are currently tied to the local path in which the cloned
repository resides in, which results in a lot of hacky assumptions throughout
the code.

This PR detaches gitfs from local paths completely, making dvc work with a
proper fsspec gitfs implementation.

Part of #7543
2022-05-11 18:17:39 +03:00
Saugat Pachhai (सौगात) 14c9348f93 dvc.objects: move hash_info, state and meta into dvc.objects 2022-05-11 17:35:48 +03:00
karajan1001 7a1f133f29 dvc ls: not raise PathMissingError on empty dir.
fix #5841
2022-05-11 16:38:58 +03:00
Gao 45a01c6a30 Revert "dvc ls: not raise PathMissingError on empty dir."
This reverts commit 09afd2a0cd.
2022-05-11 14:54:13 +03:00
karajan1001 09afd2a0cd dvc ls: not raise PathMissingError on empty dir.
fix #5841
2022-05-11 11:24:32 +03:00
Saugat Pachhai (सौगात) d92c6fed67 fs.callbacks: simplify, ensure None does not break them, lazy richcallbacks 2022-05-10 20:37:21 +05:45
Saugat Pachhai (सौगात) f10dbef0cf TqdmCallback: minor fixup, check for None explicitly
Tqdm supports __bool__, so we should really use `is not None` test
rather than boolean check. This is not used anywhere right now, but
I'd prefer being correct.
2022-05-10 14:22:13 +05:45
Saugat Pachhai (सौगात) 8fb2f65d4b TqdmCallback: make it lazy 2022-05-10 13:41:54 +05:45
dberenbaum 477f266dc5 exp init: fixes #7534; simplifies/updates exp init --live 2022-05-09 20:58:27 +05:45
Ruslan Kuprieiev b14a972cd0 repofs: use / as root_marker
This makes dvcfs/repofs much easier to work with and allows it to support
isabs/abspath/etc correctly, as previously any full path (with root_marker "")
would be impossible to distinguish from a relative one.

This also detaches external workspaces from the main repo workspace in
DvcFileSystem, which was necessary to be able to distinguish dvcfs abspaths
from local external output paths. Note that currently we still have limited
support for those (e.g. get/api supports them, but import doesn't) and this
change keeps it that way.
2022-05-08 17:19:53 +03:00
Saugat Pachhai (सौगात) 562e61235b objects: do not inherit from DvcException 2022-05-06 13:24:41 +03:00
David de la Iglesia Castro 9bd9ac4a37 FileSystem: Handle encoding via kwargs.
Drop if None.

Closes #7691
2022-05-06 02:34:38 +03:00
Saugat Pachhai (सौगात) f89f4ac152 fs.put: introduce non-recursive put 2022-05-05 21:22:29 +03:00
Saugat Pachhai (सौगात) 54dd3ae90c fs.get: use async implementation when supported by the filesystem 2022-05-05 14:15:21 +03:00
dberenbaum 35d2963069 repro/run/stage: reorder options 2022-05-05 16:42:29 +08:00
Samuel Knight 1f5f2f5c97 dvcfile: preserve 'remote' on add and commit
Preserves 'remote' output on dvc add and dvc commit.

Fixes #7356
2022-05-05 08:36:37 +05:45