JSONDecodeError is only available in never python 3 versions and still
inherits from ValueError, so we could just use it.
Signed-off-by: Ruslan Kuprieiev <[email protected]>
* 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
* pipeline: add option to display locked DVC stages.
The '--locked' option xplicitly displays only locked DVC stages.
Fixes#1864
* pipeline: support short option '-l' for displaying locked stages
* pipeline: minor cosmetic tweak
* pipeline: reformat code with black
* pipeline: test printing of locked stages
* pipeline: use caplog to ensure command outputs everything as expected
* pipeline: cleanup test
* pipeline: more strict comparison of test output
* s3: fixed wrong etag when copying multipart objects
The etag of multipart objects depends of the number of parts, when copying to the cache we should do so in the same number of parts that the original object was moved/uploaded in.
Fixes part of #1410
* s3: added check on copy for equal etag
* s3: added specific exception for ETag mismatch
* s3: use multipart copy to preserve etags
Signed-off-by: Ruslan Kuprieiev <[email protected]>
* test: add tests for etag preservation on s3
Signed-off-by: Ruslan Kuprieiev <[email protected]>
* test: requirements: use dev version moto
Specifically because of this https://github.com/spulec/moto/issues/1941
Signed-off-by: Ruslan Kuprieiev <[email protected]>
* test: requirements: install dev moto without -e
Signed-off-by: Ruslan Kuprieiev <[email protected]>
* test: stop using moto
Turned out to be quite buggy.
Signed-off-by: Ruslan Kuprieiev <[email protected]>
The problem was happening because `logger.error` doesn't include any
`exc_info`, and the `parse_exc` logic was previously to rely on the log
record's `exc_info` instead of the global stack trace.
There's still use cases when you want to just `log` an error without
printing the stack trace, those are left untouched.
You can search for them with: `grep -R 'logger.error' dvc/`
---
Fix#1869