datalad / datalad-ukbiobank

Resources for working with UKBiobank as a DataLad dataset
MIT License
6 stars 12 forks source link

Fix update --drop extracted crash (missing archives SR) #70

Closed mih closed 3 years ago

mih commented 3 years ago

We now check whether there is a datalad-archives special remote, before attempting to drop from it. We could have used an approach that check if there is candidate content for this SR, but that would likely duplicate logic and be more fragile wrt future changes.

Here we test for the error/crash condition directly.

Debugged with @loj

Closes #69

mih commented 3 years ago

The Linux CI at the install stage with:

  WARNING: Built wheel for datalad-ukbiobank is invalid: Metadata 1.2 mandates PEP 440 version, but 'refs-pull-70-merge' is not
  Building wheel for datalad (PEP 517) ... - \ | / - done
  Created wheel for datalad: filename=datalad-0.14.4-py3-none-any.whl size=1609958 sha256=c1ae035a4fedd7541e893f73c65a1167abeac46dd40850cb17963b33ada2ac34
  Stored in directory: /home/appveyor/.cache/pip/wheels/34/c1/81/3bb458a421d4285e47451d1e18d29134133d1a64a24c38e78f
Successfully built datalad
Failed to build datalad-ukbiobank
ERROR: Could not build wheels for datalad-ukbiobank which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 21.0.1; however, version 21.1.1 is available.

All other platforms pass. The prominent difference seems to be pip being version 20.x when it passes and 21.x for the failure.

mih commented 3 years ago

Maybe this would fix it: https://github.com/pypa/pip/pull/9575

Part of 21.1 (2021-04-24)

mih commented 3 years ago

No, this only outlines a large set of implications of future pip releases:

pip install "."
Processing /home/appveyor/projects/datalad-ukbiobank
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
yarikoptic commented 3 years ago

debugging interactively in #72 with shallow clone I guess you get

    git_refnames = " (refs/pull/72/merge)"
    git_full = "f8713183377bffe7417f1b38c036ca03ef7f3c54"
    git_date = "2021-05-18 17:49:20 +0000"
    keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}

in _version.py, and overall version "minted" by appveyor becomes quite odd:

(venv3.8.9) appveyor@appveyor-vm:~/projects/datalad-ukbiobank$ grep git.*names datalad_ukbiobank/_version.py
    git_refnames = " (refs/pull/72/merge)"
    keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
            if line.strip().startswith("git_refnames ="):
(venv3.8.9) appveyor@appveyor-vm:~/projects/datalad-ukbiobank$ python -c 'import datalad_ukbiobank'
(venv3.8.9) appveyor@appveyor-vm:~/projects/datalad-ukbiobank$ python -c 'import datalad_ukbiobank;print(datalad_ukbiobank.__version__)'
refs/pull/72/merge

which trips pip upon installation via pip install .

codecov[bot] commented 3 years ago

Codecov Report

Merging #70 (f879bcc) into master (ea4ef21) will increase coverage by 0.02%. The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #70      +/-   ##
==========================================
+ Coverage   97.05%   97.07%   +0.02%     
==========================================
  Files           9        9              
  Lines         339      342       +3     
==========================================
+ Hits          329      332       +3     
  Misses         10       10              
Impacted Files Coverage Δ
datalad_ukbiobank/update.py 94.89% <83.33%> (+0.16%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ea4ef21...f879bcc. Read the comment docs.

mih commented 3 years ago

Thx to @yarikoptic for determining the CI failure cause!