This project is archived and is in readonly mode.

#29 ✓invalid
Psycopg website

eggify ZPsycopgDA

Reported by Psycopg website | December 22nd, 2010 @ 10:19 PM

Submitted by: Pumukel

Hello,

might it be possible to release a seperate egg of ZPsycopgDA on pypi, with dependency for the accurat psycopg2 egg?

For Zope and Plone users that would be a huge advantage, so it could be used directly in buildout.

Thanking you in anticipation

Comments and changes to this ticket

  • Daniele Varrazzo

    Daniele Varrazzo December 22nd, 2010 @ 10:38 PM

    • State changed from “new” to “open”
    • Tag set to plone, pypi, zope

    Definitely possible, but not from me: I'm no Zope user. Fog might... but he doesn't seem a pypi fan :)

    Bottom line: the quickest way to do this is for you to submit a patch.

    Also notice that I'm working to set up a buildbot to check integration regressions: it's not online yet but there's plenty of code for building/testing: check https://github.com/dvarrazzo/psycobuild. In my opinion the zope area is not tested enough: contributions to test ZPsycopgDA is welcome.

  • Pumukel

    Pumukel February 24th, 2011 @ 09:27 PM

    That ticket ist still open, and maybe a more git familar person might try to solve it be recipe:

    Today, for most Zope/Plone users zc.buildout is the common way to install
    Zope/Plone. zc.buildout works perfect with eggs, so a ZPsycopgDA that
    would be converted into a python egg would be great.

    I could do this and have already done this and send it to Daniele, but as
    I'm not familiar with git it was not the way Daniele wish it.

    So maybe for someone of you, how is willing to help and much more familiar
    with git could do this after a description:

    A short introduction for those of you how are not familiar with Zope/Plone
    development a short introduction to the CASE-Tools:
    Working with Zope/Plone is a bit different to other Python work, because
    Zope tries to isolate it's installation from the system python with
    buildout.
    Zope normaly uses zc.buildout for installation, configuration and
    dependency mapping.
    http://pypi.python.org/pypi/zc.buildout/

    For developing new packages/eggs for zope some tools are used:
    1: PasteScript(http://pypi.python.org/pypi/PasteScript) a tool to generate package skeletons from templates
    2. ZopeSkel (http://pypi.python.org/pypi/ZopeSkel) this is a PasteScript Plugin that add's several skeleton templates to paster
    3. Release Tools as: collective.releaser (http://pypi.python.org/pypi/collective.releaser) or jarn.mkrelease (http://pypi.python.org/pypi/jarn.mkrelease) that release an egg in several formats to pypi or other Package indexes

    So and the recipe to build a zope egg with these tools that is a
    conversion of ZPsycopgDA to a zope egg called Products.ZPsycopgDA:

    1. Preperation: you need to install the CASE-Tools:
      "pip install ZopeSkel" or "easy_install ZopeSkel" (That will install you ZopeSkel and as a dependency PasteScript)
    2. generate Skeleton:
      "paster create -t basic_zope Products.ZPsycopgDA" That is a command-line tool where you have to answer several questions: Answer first question with "all" and answer all following questions either with the default or specialized things like mailing-list or so
      on.
      It will create you the Package as a new Folder in the Folder you currently are -> Products.ZPsycopgDA.
      additional templates could be displayed with: "paster create --list-templates"
    3. modify created Package and Import ZPsycopgDA from psycopg2
      1. in the create Folder Package.ZPsycopgDA modify the setup.py and add psycopg2 as dependency in the install_requires array
      2. in the Folder Package.ZPsycopgDA/Products/ZPsycopgDA/ remove all files except configure.zcml and import all Files from the ZPsycopgDA
        Folder from psycopg2
      3. modify the configure.zcml so that it the initialize method from _init.py is used instead of the method from the deleted zope2.py
    4. check in repository, make a test build and release it

    For importing it into the repository the Products.ZPsycopgDA.egg-info
    Folder is not necessary it will be always regenerated from the setup.py

    Thanks Pumukel

  • Daniele Varrazzo

    Daniele Varrazzo February 25th, 2011 @ 11:24 PM

    Great description, Pumukel, thanks.

    I would love to integrate your work into the library. But I simply don't understand the entire life cycle of a Product, so I may need too many explanations to be any useful.

    An observation: in the projects there are already directories 'psycopg2da' and 'ZPsycopgDA'. Your would be a third: does it replace any of the previous? Is there really a reason for which there are currently two?

    I have tested your script and it works flawlessly indeed. But eventually I don't know what to do with the result: is there a way to run tests on it? Loading the product in Zope, run the existing test suite (or the tests in psycopg2da if they are still relevant?), upload it on PyPI? The optimum would be to have a separate Makefile (or new rules in the current one) to allow to run tests and perform packaging and deploy as make targets (for instance now we have "make tests", "make sdist" ecc. With them I can see if anything is broken).

    So I really think you should either give Git a try, clone my repos on github (https://github.com/dvarrazzo/psycopg/) and make the modifications you want to the project: we will be happy to merge them if they improve the current status (this involves cutting the dead trees, generally taking care of the zope area of the library). And possibly (for strong values of possibly) including documentation and tests.

    I think the current quality of the library is really high, the zope area instead is almost abandoned. It would take somebody taking care of it to bring it actual again, with knowledge of what is current in zope. If you want to be helpful there is space for your skill. As I don't know a single byte of the zope area I am not confident to apply any patch to the current tree: I wouldn't even notice I've broken something.

    Thank you very much again.

  • Pumukel

    Pumukel February 26th, 2011 @ 02:30 PM

    Hi Daniele,

    Ok, lets try to clear all questions:
    psycopg2da is something I don't know and haven't used before. ZPsycopgDA is a very good integration of psycopg2 to Zope, but in a way old-style because it is impossible to use with buildout. So my intention is to bring ZPsycopgDA back on the current Zope-deployment level. The name of an eggified version dosn't care me, but Products.ZPsycopgDA would be a common namespace for an old Zope-Product redistributed as Python egg. It would be a 100% replacement for the old ZPsycopgDA, because it could be used with all current used versions of Zope (Zope 2.7 - 2.13.x (most current)) and Plone (2.5 - 4.1.x) that sets on buildout, for all previous versions it would work too, but that would be non upgraded installations that are older than 5 years.

    The second question, what to do with the results is almost the same like for psycopg2, run the test as you already do with "make tests" and "make sdist" and release it to pypi. The setup.py on base-level of the generated Products.ZPsycopgDA is such an seperated makefile and would do this for you -> "python setup.py sdist", tests is something I don't see in ZPsycopgDA, but would be no problem and work the same. There you should add the coresponding compatible psycopg2 versions and Zope-Users could start with their buildouts quite easy.

    I will give git a try, but it will take some time, so if it could be done allready that would be nice.

  • Daniele Varrazzo

    Daniele Varrazzo December 3rd, 2012 @ 12:28 AM

    • State changed from “open” to “invalid”

    An egg package is available on PyPI maintained by somebody else.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins

Tags

Pages