
On 11 April 2012 12:55, Simon Sapin <simon.sapin@kozea.fr> wrote:
I started something here but it is very much in progress:
Many thanks for doing this Simon! I always think it's helpful to have multiple maintainers for a package where possible. Would it make sense to move the repository into the lxml organisation on github and add Stefan as an owner on PyPI as it will presumably become a dependency of lxml in due course. Laurence

Le 15/04/2012 23:26, Laurence Rowe a écrit :
On 11 April 2012 12:55, Simon Sapin<simon.sapin@kozea.fr> wrote:
I started something here but it is very much in progress:
https://github.com/SimonSapin/cssselect Many thanks for doing this Simon!
I always think it's helpful to have multiple maintainers for a package where possible. Would it make sense to move the repository into the lxml organisation on github and add Stefan as an owner on PyPI as it will presumably become a dependency of lxml in due course.
As I said earlier, I’d be happy to share Github and PyPI access. As to the lxml organisation: Stephan, what do you think? I think I got to a point where this external cssselect is in shape to be used in lxml. In particular, the separated XPath Translator class is there. Any feedback/review is appreciated. Immediate plans are: * Update the documentation * Tag/release a 0.2 version * Make a patch for lxml to use the external cssselect. lxml.cssselect will still exist and have (at least) the CSSSelector class as well as a Translator subclass with support for :contains(). Open questions: * What to do with the test suite? Duplicating it completely is not useful, but we should at least keep *some* tests in lxml. * Should the dependency be optional (have some ImportError handling) or not? (have the requirement in in lxml/setup.py) Regards, -- Simon Sapin

Le 16/04/2012 08:11, Simon Sapin a écrit :
* Make a patch for lxml to use the external cssselect.
lxml.cssselect will still exist and have (at least) the CSSSelector class as well as a Translator subclass with support for :contains().
Open questions:
* What to do with the test suite? Duplicating it completely is not useful, but we should at least keep*some* tests in lxml. * Should the dependency be optional (have some ImportError handling) or not? (have the requirement in in lxml/setup.py)
I pushed for review a branch of lxml that passes all its tests with the current release (v0.2) of cssselect: https://github.com/SimonSapin/lxml/tree/external-cssselect But I am not satisfied with it. First, having "import cssselect" in lxml.cssselect does a relative import: the module imports itself. "from __future__ import absolute_import" is made just for this, but is not available in Python 2.4. The best work-around I could find is ugly: it involves __import__ and sys.modules. Anyone has a better idea? Secondly, the Translator extension for :contains() uses more of cssselect’s internal API than I would like. I will refactor a few things. Anyway. This is not ready for merging into lxml (stuff *will* break as I hack the internals), but please make any suggestion. Regards, -- Simon Sapin

Le 16/04/2012 14:50, Simon Sapin a écrit :
I pushed for review a branch of lxml that passes all its tests with the current release (v0.2) of cssselect:
I just tagged cssselect v0.3 and updated the lxml branch. It is overall in a much better shape! Please review. Regards, -- Simon Sapin

Le 16/04/2012 14:50, Simon Sapin a écrit :
I pushed for review a branch of lxml that passes all its tests with the current release (v0.2) of cssselect
I think the branch is ready to be merged now. All the details are in the pull request message: https://github.com/lxml/lxml/pull/46 Regards, -- Simon Sapin
participants (2)
-
Laurence Rowe
-
Simon Sapin