Skip to content

BF: fix bug for Windows bat-file install #339

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

Merged
merged 1 commit into from
Aug 11, 2015

Conversation

matthew-brett
Copy link
Member

Windows .bat file shadow of Python script fails for paths with spaces.

Thanks to P. Renner for the fix - see
matthew-brett/myscripter#2

Windows .bat file shadow of Python script fails for paths with spaces.

Thanks to P. Renner for the fix - see
matthew-brett/myscripter#2
@larsoner
Copy link
Contributor

LGTM

@matthew-brett
Copy link
Member Author

Thanks - merging.

matthew-brett added a commit that referenced this pull request Aug 11, 2015
MRG: fix bug for Windows bat-file install

Bug fix for Windows paths with spaces.
@matthew-brett matthew-brett merged commit 76ac4ac into nipy:master Aug 11, 2015
@yarikoptic
Copy link
Member

btw why bother with the custom solution if setuptools have entry points mechanism to generate all the necessary executables? see e.g. datalad or duecredit for an example

@matthew-brett
Copy link
Member Author

First - I was old school in preferring a solution that doesn't have a run-time dependency on setuptools. Second, I find the entry-points mechanism ugly and confusing. Discussion at https://matthew-brett.github.io/pydagogue/installing_scripts.html

@yarikoptic
Copy link
Member

On Tue, 11 Aug 2015, Matthew Brett wrote:

First - I was old school in preferring a solution that doesn't have a
run-time dependency on setuptools. Second, I find the entry-points
mechanism ugly and confusing. Discussion at
https://matthew-brett.github.io/pydagogue/installing_scripts.html

;) the only critique I see there is
"... it means we have an install time and a run time dependency on setuptools"
which is imho is ok in this state of the Python ecosystem ;)

"Personally, I find the console_script mechanism more obscure than having script files."

to my liking I found it not that obscure and actually pleasantly
surprised that it works nicely across platforms with me doing
nothing for that to happen ;)

Another positive side-effect is that it requires moving script's
functionality under the library namespace, thus making it easier to
provide unit-tests for that functionality (instead of keeping scripts
outside of the library and having no tests for them, or diving into
another level of sophistication of testing scripts at the "integration"
level, not as unit-tests). E.g. with mocking it becomes really easy to
test basic assumptions of what those scripts should do (what they should
call, see e.g.
https://github.com/duecredit/duecredit/blob/master/duecredit/tests/test_dueswitch.py#L18
although not for cmdline scripts)

Just my 1c

@matthew-brett
Copy link
Member Author

Sure. Of course you can move as much of the scripting into the library as you want with the distutils approach, it's just setuptools forces you to do that. E.g : https://github.com/matthew-brett/wheels2dmg/blob/master/scripts/wheels2dmg

I also find setuptools unpleasantly magical - like an incantation - and that always makes me feel uncomfortable.

@yarikoptic
Copy link
Member

On Tue, 11 Aug 2015, Matthew Brett wrote:

Sure. Of course you can move as much of the scripting into the library as
you want with the distutils approach, it's just setuptools forces you to
do that. E.g :
https://github.com/matthew-brett/wheels2dmg/blob/master/scripts/wheels2dmg

yeap... the point though stands that there is then no need for such
custom scripts at all with entry points.

I also find setuptools unpleasantly magical - like an incantation - and
that always makes me feel uncomfortable.

Entire Python is like magic to me -- I just learned how to use it ;)
Seems to work (most of the time ;) )

But I am actually with you on "setuptools magic" -- that is why I was
trying to avoid using it whenever I could, but then seeing many projects
using it (thus polishing up its bugginess) and this entry_points
support made me start using it.

@matthew-brett
Copy link
Member Author

I also heard someone involved in the Python packaging system saying they were planning to make wheels installable without setuptools, implying that they (like me) want to avoid setuptools where possible. That might make it more common in the future to have Python installations without setuptools installed.

@effigies effigies mentioned this pull request Nov 6, 2015
grlee77 pushed a commit to grlee77/nibabel that referenced this pull request Mar 15, 2016
MRG: fix bug for Windows bat-file install

Bug fix for Windows paths with spaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants