-
Notifications
You must be signed in to change notification settings - Fork 111
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
RF: more of common logistics into setup_support #3600
Conversation
Should we drop our own version handling and use versioneer? |
probably. I have no experience with it yet to make an informed decision and probably could be done as independent subsequent PR since this one is primarily moving code around, but FWIW nibabel is going that way too: nipy/nibabel#786 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we agree that this is the way to go
This is fine by me.
setup_support.py
Outdated
import formatters as fmt | ||
|
||
|
||
def _path_rel2file(p): | ||
return opj(dirname(__file__), p) | ||
|
||
|
||
def get_version(): | ||
def get_version(name): | ||
"""Load version of datalad from version.py without entailing any imports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring should be updated to drop hard-coded "datalad".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjusted and pushed
Codecov Report
@@ Coverage Diff @@
## 0.11.x #3600 +/- ##
==========================================
- Coverage 76.6% 29.6% -47.01%
==========================================
Files 252 252
Lines 33700 33689 -11
==========================================
- Hits 25817 9972 -15845
- Misses 7883 23717 +15834
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## 0.11.x #3600 +/- ##
==========================================
+ Coverage 77.04% 77.07% +0.02%
==========================================
Files 252 252
Lines 33728 33728
==========================================
+ Hits 25985 25995 +10
+ Misses 7743 7733 -10
Continue to review full report at Codecov.
|
ok, introduced some breakage:
will look into it later |
The problem comes from a bit above:
So the Line 111 in 40dac18
|
…_version() BuildManPage ATM hardcodes for "datalad" being the module/app we care about. And it should be just fine even if used in extensions since we do not expect them to provide new independent commands (I guess)
d'oh -- thanks! pushed the workaround in 652cd4d |
so, with the background failures now for both appveyor and travis (3.x) not easy to say if there is no side effects but it might be that we caught all the gotchas, thanks @kyleam for the review. |
…extension versions and man pages
…amed "command_suite"
setup_support.py
Outdated
README = opj(dirname(__file__), 'README.md') | ||
|
||
ret = {} | ||
if LooseVersion(setuptools.__version__) > '38.6.0': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops. Sorry about the sloppy suggestion.
if LooseVersion(setuptools.__version__) > '38.6.0': | |
if LooseVersion(setuptools.__version__) >= '38.6.0': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks -- I just amended the last commit, will force push later
af143e0
to
5ec34f2
Compare
ok -- I moved both setup_support (as setup.py) and formatters under |
Nice. This move would also make using |
oh, |
cons of having a submodule
|
BTW, I don't think versioneer can leave under |
pushed the fix (e0bd962) for version being gone -- was double quoted(git)hopa:~datalad/datalad[rf-more_setup_support]git
$> rm -rf build/man && python setup.py build_manpage && for f in ./build/man/*.*; do man $f | tail -n 2; done
running build_manpage
datalad 0.11.6 2019-08-15 datalad(1)
datalad add 0.11.6 2019-08-15 datalad add(1)
datalad add-archive-content 0.11.6 2019-08-15 datalad add-archive-content(1)
datalad add-readme 0.11.6 2019-08-15 datalad add-readme(1)
datalad addurls 0.11.6 2019-08-15 datalad addurls(1)
troff: <standard input>:35: warning: macro 'datalad.metadata.nativetype'' not defined (possibly missing space after 'da')
troff: <standard input>:49: warning: macro 'datalad_core',' not defined (possibly missing space after 'da')
datalad aggregate-metadata 0.11.6 2019-08-15 datalad aggregate-metadata(1)
datalad annotate-paths 0.11.6 2019-08-15 datalad annotate-paths(1)
datalad check-dates 0.11.6 2019-08-15 datalad check-dates(1)
datalad clean 0.11.6 2019-08-15 datalad clean(1)
datalad clone 0.11.6 2019-08-15 datalad clone(1)
datalad create 0.11.6 2019-08-15 datalad create(1)
|
I strongly prefer -subtree here.
You'd split the datalad_build_support/ into a separate repo that would have tags/releases/etc. datalad core and extensions would pull that repo into a subtree. When we are interested in updating the subtree from the upstream repo we can do so, but otherwise we can work with the tree as we would any other subdirectory in the extension repo.
Yes, that's a big one. For a directory as light as datalad_build_support/, I don't see any issue with the git-subtree approach of duplicating the tree objects in datalad core as well as extension repos.
Also not an issue with subtrees :] |
Before Python 3.3, an __init__.py file is required for the package to be found.
datalad_setup() filters the output of find_packages(), keeping anything that starts with "datalad", and we don't want datalad_build_support/ to be distributed with datalad.
Ok, subtree it is then |
Let's merge and proceed from there. (edit for posterity: https://gist.github.com/effigies/c9f4194034ee218bab1668bfd7851cfc) |
0.11.7 (Sep 02, 2019) -- python2-we-still-love-you-but-... Primarily bugfixes with some optimizations and refactorings. Fixes - [addurls][] - now provides better handling when the URL file isn't in the expected format. ([#3579][]) - always considered a relative file for the URL file argument as relative to the current working directory, which goes against the convention used by other commands of taking relative paths as relative to the dataset argument. ([#3582][]) - [run-procedure][] - hard coded "python" when formatting the command for non-executable procedures ending with ".py". `sys.executable` is now used. ([#3624][]) - failed if arguments needed more complicated quoting than simply surrounding the value with double quotes. This has been resolved for systems that support `shlex.quote`, but note that on Windows values are left unquoted. ([#3626][]) - [siblings][] now displays an informative error message if a local path is given to `--url` but `--name` isn't specified. ([#3555][]) - [sshrun][], the command DataLad uses for `GIT_SSH_COMMAND`, didn't support all the parameters that Git expects it to. ([#3616][]) - Fixed a number of Unicode py2-compatibility issues. ([#3597][]) Enhancements and new features - The [annotate-paths][] helper now caches subdatasets it has seen to avoid unnecessary calls. ([#3570][]) - A repeated configuration query has been dropped from the handling of `--proc-pre` and `--proc-post`. ([#3576][]) - Calls to `git annex find` now use `--in=.` instead of the alias `--in=here` to take advantage of an optimization that git-annex (as of the current release, 7.20190730) applies only to the former. ([#3574][]) - [addurls][] now suggests close matches when the URL or file format contains an unknown field. ([#3594][]) - Shared logic used in the setup.py files of Datalad and its extensions has been moved to modules in the _datalad_build_support/ directory. ([#3600][]) - Get ready for upcoming git-annex dropping support for direct mode ([#3631][]) * tag '0.11.7': (87 commits) DOC: Added an entry to changelogn on merged 3631 ENH: finalizing changelog for 0.11.7 TST: Update tests for a git-annex without direct mode TST: utils: Add decorator that skips when direct mode is unsupported ENH: annexrepo: Refuse to initialize in direct mode if unsupported ENH: annexrepo: Add check_direct_mode_support method BF+TST: Avoid leaking patched git-annex version TST+RF: test_annexrepo: Split up a test CHANGELOG.md: Second batch for 0.11.7 TST: run_procedure: Mark test_spaces() as known Windows failure TST: run_procedure: Mark test_quoting as known windows failure TST: run_procedure: Test more arguments that need quoting BF(py2): run_procedure: Avoid encoding error in log message TST: add run_procedure test with spaces in file name TST/RF: non-hardcoded Python executable RF: newline at end of file RF: helper instead of conditional RF: remove superfluous imports BF/TST: remove quoting ENH: replace conditionals with helper function ...
0.11.7 (Sep 02, 2019) -- python2-we-still-love-you-but-... Primarily bugfixes with some optimizations and refactorings. Fixes - [addurls][] - now provides better handling when the URL file isn't in the expected format. ([#3579][]) - always considered a relative file for the URL file argument as relative to the current working directory, which goes against the convention used by other commands of taking relative paths as relative to the dataset argument. ([#3582][]) - [run-procedure][] - hard coded "python" when formatting the command for non-executable procedures ending with ".py". `sys.executable` is now used. ([#3624][]) - failed if arguments needed more complicated quoting than simply surrounding the value with double quotes. This has been resolved for systems that support `shlex.quote`, but note that on Windows values are left unquoted. ([#3626][]) - [siblings][] now displays an informative error message if a local path is given to `--url` but `--name` isn't specified. ([#3555][]) - [sshrun][], the command DataLad uses for `GIT_SSH_COMMAND`, didn't support all the parameters that Git expects it to. ([#3616][]) - Fixed a number of Unicode py2-compatibility issues. ([#3597][]) - [download-url][] now will create leading directories of the output path if they do not exist ([#3646][]) Enhancements and new features - The [annotate-paths][] helper now caches subdatasets it has seen to avoid unnecessary calls. ([#3570][]) - A repeated configuration query has been dropped from the handling of `--proc-pre` and `--proc-post`. ([#3576][]) - Calls to `git annex find` now use `--in=.` instead of the alias `--in=here` to take advantage of an optimization that git-annex (as of the current release, 7.20190730) applies only to the former. ([#3574][]) - [addurls][] now suggests close matches when the URL or file format contains an unknown field. ([#3594][]) - Shared logic used in the setup.py files of Datalad and its extensions has been moved to modules in the _datalad_build_support/ directory. ([#3600][]) - Get ready for upcoming git-annex dropping support for direct mode ([#3631][]) * tag '0.11.7': Changelog entry for download-url paths handling ENH: downloaders: Ensure directories for target exist
I thought to provide some face lifting to our template (datalad/datalad-extension-template#4) before starting to use it, but noted that real-life cases (extensions) diverge from the template quite a bit and have lots of duplication in setup.py. I would advocate for us to absorb all common functionality within setup_support.py which we already copy around the extensions, and provide it within the template.
Well, ideally we should probably package/release it as
datalad-setup-support
or alike, but I am not sure if I am ready for yet another tiny packaging endeavor, so will be ok with plain copying it around the extensions for now.If we agree that this is the way to go, then I will