Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BF(workaround): switch to use os.getcwd if something odd detected with PWD env var #2914

Merged
merged 6 commits into from Nov 1, 2018

Conversation

@yarikoptic
Copy link
Member

@yarikoptic yarikoptic commented Oct 11, 2018

This pull request might help to address #2910 but in an odd ad-hoc ugly fashion. See description in patch/code

If we decide to adopt this at least as a temporary stop-gap measure, then TODOs

  • tests

Testing locally with smth like

$> python -c 'import os; os.chdir("/tmp"); from datalad.utils import getpwd; print(getpwd(), os.getcwd())'
[WARNING] realpath of PWD=/home/yoh/proj/datalad/datalad-master is /home/yoh/proj/datalad/datalad-master whenever os.getcwd()=/tmp. From now on will be returning os.getcwd(). Directory symlinks in the paths will be resolved 
('/tmp', '/tmp')
@codecov
Copy link

@codecov codecov bot commented Oct 29, 2018

Codecov Report

Merging #2914 into master will increase coverage by 0.05%.
The diff coverage is 82.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2914      +/-   ##
==========================================
+ Coverage   90.28%   90.34%   +0.05%     
==========================================
  Files         246      246              
  Lines       31902    32076     +174     
==========================================
+ Hits        28804    28978     +174     
  Misses       3098     3098
Impacted Files Coverage Δ
datalad/tests/utils.py 89.35% <100%> (+0.49%) ⬆️
datalad/__init__.py 90.24% <100%> (+0.07%) ⬆️
datalad/tests/test_tests_utils.py 98.55% <100%> (ø) ⬆️
datalad/utils.py 86.56% <74.19%> (-0.32%) ⬇️
datalad/tests/test_utils.py 96.33% <90.9%> (-0.09%) ⬇️
datalad/plugin/wtf.py 82.32% <0%> (-0.62%) ⬇️
datalad/interface/utils.py 93.9% <0%> (-0.39%) ⬇️
datalad/support/annexrepo.py 88.11% <0%> (-0.13%) ⬇️
datalad/interface/run.py 100% <0%> (ø) ⬆️
datalad/distribution/tests/test_subdataset.py 100% <0%> (ø) ⬆️
... and 12 more

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 d43abf4...2d041ae. Read the comment docs.

@yarikoptic
Copy link
Member Author

@yarikoptic yarikoptic commented Oct 29, 2018

all the failures are known suspects and I see no reason to torture CI by merging master. Any feedback @datalad/developers ?

@bpoldrack
Copy link
Member

@bpoldrack bpoldrack commented Oct 30, 2018

No objections by me.

Except for a poor gut feeling about the entire beast. But this is neither about this PR nor do I have a better idea. ;-)

kyleam
kyleam approved these changes Oct 30, 2018
Copy link
Contributor

@kyleam kyleam left a comment

Also no objections from me.

`os.getcwd()`.
Initial decision to either use PWD env variable or os.getcwd() is done upon
the first call of this function.
Copy link
Contributor

@kyleam kyleam Oct 30, 2018

The workaround is ugly, but this docstring does a nice job of explaining why it exists.

@yarikoptic
Copy link
Member Author

@yarikoptic yarikoptic commented Nov 1, 2018

yeah, it is quite ugly but I also see no other way yet to handle it, and I do know that I ran into this issue (of us simply relying on wrong PWD value) while working in ipython notebook... so better this than nothing imho. merging, thanks!

@yarikoptic yarikoptic merged commit 8efdadb into datalad:master Nov 1, 2018
6 of 10 checks passed
@yarikoptic yarikoptic added this to the Release 0.11.1 milestone Nov 24, 2018
yarikoptic added a commit that referenced this issue Nov 27, 2018
	## 0.11.1 (Nov 25, 2018) -- v7-better-than-v6

	Rushed out bugfix release to stay fully compatible with recent
	[git-annex] which introduced v7 to replace v6.

	### Fixes

	- [install]: be able to install recursively into a dataset ([#2982])
	- [save]: be able to commit/save changes whenever files potentially
	  could have swapped their storage between git and annex
	  ([#1651]) ([#2752]) ([#3009])
	- [aggregate-metadata]:
	  - dataset's itself is now not "aggregated" if specific paths are
		provided for aggregation ([#3002]). That resolves the issue of
		`-r` invocation aggregating all subdatasets of the specified dataset
		as well
	  - also compare/verify the actual content checksum of aggregated metadata
		while considering subdataset metadata for re-aggregation ([#3007])
	- `annex` commands are now chunked assuming 50% "safety margin" on the
	  maximal command line length. Should resolve crashes while operating
	  ot too many files at ones ([#3001])
	- `run` sidecar config processing ([#2991])
	- no double trailing period in docs ([#2984])
	- correct identification of the repository with symlinks in the paths
	  in the tests ([#2972])
	- re-evaluation of dataset properties in case of dataset changes ([#2946])
	- [text2git] procedure to use `ds.repo.set_gitattributes`
	  ([#2974]) ([#2954])
	- Switch to use plain `os.getcwd()` if inconsistency with env var
	  `$PWD` is detected ([#2914])
	- Make sure that credential defined in env var takes precedence
	  ([#2960]) ([#2950])

	### Enhancements and new features

	- [shub://datalad/datalad:git-annex-dev](https://singularity-hub.org/containers/5663/view)
	  provides a Debian buster Singularity image with build environment for
	  [git-annex]. [tools/bisect-git-annex]() provides a helper for running
	  `git bisect` on git-annex using that Singularity container ([#2995])
	- Added [.zenodo.json]() for better integration with Zenodo for citation
	- [run-procedure] now provides names and help messages with a custom
	  renderer for ([#2993])
	- Documentation: point to [datalad-revolution] extension (prototype of
	  the greater DataLad future)
	- [run]
	  - support injecting of a detached command ([#2937])
	- `annex` metadata extractor now extracts `annex.key` metadata record.
	  Should allow now to identify uses of specific files etc ([#2952])
	- Test that we can install from http://datasets.datalad.org
	- Proper rendering of `CommandError` (e.g. in case of "out of space"
	  error) ([#2958])

* tag '0.11.1':
  Adjust the date -- 25th fell through due to __version__ fiasco
  BF+ENH(TST): boost hardcoded version + provide a test to guarantee consistency in the future
  This (expensive) approach is not needed in v6+
  small tuneup to changelog
@yarikoptic yarikoptic deleted the enh-pwd branch Feb 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants