Collective zc.buildout recipes

collective.recipe.omelette should use pure python implementation on Windows Vista/7 using ctypes

Reported by Roman Lacko on 2012-04-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
collective.buildout
Undecided
Unassigned

Bug Description

Here is reference implementation of junction and hardlink functions in pure python using ctypes https://github.com/sid0/ntfs.
Also I think the pure python implementation should be significantly faster than using junction.exe.

Best regards
Roman

David Glick (davisagli) wrote :

If someone makes a pull request that integrates this into omelette I will consider it, but I'm not going to spend time on supporting Windows myself.

Hi,
I will gladly spend my if You send me the omelette repository adress.
Thanks
Roman

2012/4/18 David Glick <email address hidden>:
> If someone makes a pull request that integrates this into omelette I
> will consider it, but I'm not going to spend time on supporting Windows
> myself.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/984971
>
> Title:
>  collective.recipe.omelette should use pure python  implementation on
>  Windows Vista/7 using ctypes
>
> Status in Collective zc.buildout recipes:
>  New
>
> Bug description:
>  Here is reference implementation of junction and hardlink functions in pure python using ctypes https://github.com/sid0/ntfs.
>  Also I think the pure python implementation should be significantly faster than using junction.exe.
>
>  Best regards
>  Roman
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/collective.buildout/+bug/984971/+subscriptions

Roman Lacko (rlacko) wrote :

Hi,
I will gladly spend my if You send me the omelette repository adress.
Thanks
Roman

Hanno Schlichting (hannosch) wrote :

Note that with Python 3.3, Python has a native implementation for symlinks on Windows, so os.symlink works on all platforms. Maybe you could backport this implementation to older Python versions instead. The code is in posixmodule.c at http://hg.python.org/cpython/file/0f837071fd97/Modules/posixmodule.c#l6494

I'd suggest you create a small package with just the Windows symlink code in it, and let c.r.omelette use that via a dependency. That way you can also make the dependency conditional on the target platform in omelette's setup.py, like:

import sys

additional_install_requires = []

if sys.platform[:3].lower() == "win":
    additional_install_requires += ['windows_symlink_project_name']

setup(name='collective.recipe.omelette',
    ...
    install_requires=[
        ...,
    ] + additional_install_requires,
)

Roman Lacko (rlacko) wrote :

Agree that this is "cleaner" solution, but my time resources are limited for now. If it is no problem i will go for ctypes version fro now.
Later i can create the backport package.

Regards
Roman

Roman Lacko (rlacko) wrote :

I created the pull request. I tested the changes with latest plone.coredev buildout and the difference is uncomparable, now the omelette is usable on windows too :)

Roman Lacko (rlacko) wrote :

I have updated pull request to meet Your requirements - now windows symlinks management is included as separate package!

Regards
Roman

Roman Lacko (rlacko) wrote :

Hi David,
I know You have other thinks to do, but would it be possible to merge my windows patch and release new omelette version before plone 4.2 release ? I just want to be sure that new omelette is part of stable plone 4.2 buildout.
Thank You
Roman

David Glick (davisagli) wrote :

Hi Roman, thanks for working on this. I'll try to review and merge it soon. Omelette is not part of Plone core, so that deadline shouldn't make any difference in your ability to use it with Plone 4.2.

David Glick (davisagli) on 2012-05-01
Changed in collective.buildout:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers