zopefoundation / Zope

Zope is an open-source web application server.
https://zope.readthedocs.io
Other
352 stars 99 forks source link

Update Zope Developer’s Guide to Zope 4 #252

Open icemac opened 6 years ago

icemac commented 6 years ago

The Zope Developer’s Guide at https://zope.readthedocs.io/en/latest/zdgbook/index.html has many references to Zope 2 and should be updated to work with Zope 4 on Python 3.

jugmac00 commented 5 years ago

Well, during the Saltlabs sprint at least the following chapters got updated:

icemac commented 5 years ago

@jugmac00 Thank you very much. I added a checklist to the issue description.

ghiodor commented 5 years ago

Hello, I'm trying to convert Products.FSDump to Zope 4 and I was following the developers guide and examples in github. However, chapter 3 is not specific to Products and chapter 5 is not up to date. Currently I'm stuck with error "Products.FSDump setup command: Distribution contains no modules or packages for namespace package 'Products'", which I don't understand. More important, how can I develop a zope product and test it in Zope using buildout develop?

tseaver commented 5 years ago

@ghiodor I'm not sure what your starting point is for doing this migration. The release tarball has the correct package structure for a namespace package.

jugmac00 commented 5 years ago

@ghiodor Updating the documentation is a mammoth project - I am working on this like for 9+ months - both in my spare time and without having contributed to the underlying source code, so I am learning by documenting :-) And currently my spare time is almost non existing :-(

Can't help you with the error message - maybe create a new ticket as here it could be easily overlooked?

Or ask in the new discussion board over at the Plone forum: https://community.plone.org/c/zope

d-maurer commented 5 years ago

Distribution contains no modules or packages for namespace package 'Products'", which I don't understand.

@ghiodor Zope no longer needs special things for "products": any subpackage of the namespace package Products can be a product (but likely, it still has a top level initialize function). The error you are seeing therefore is not a Zope message but one of setuptools. Apparently, setuptools cannot find the actual package. To get the packaging right, you no longer need Zope specific knowledge; Python packaging knowledge is sufficient.

ghiodor commented 5 years ago

@tseaver, I forked your repository and then git clone. I don't understand how to bring this package to zope 4 for development purposes (in the old times I would simply untar it in Products and change there). So, I was following chpt 2 (zdg) which has three folders (./poll, ./poll/pool.build, ./poll.main). I was trying to install fsdump in develop mode using buildout.cfg (which is not in your tarball although other Products have it in the root folder). @jugmac00, yes already registered to plone, forum seems deserted. Happy to help with testing, proofreading, etc. @d-maurer, ok, will read it but it's a one time need and I was trying to rely on the zope docs. I already spent quite some time to learn buildout.

ghiodor commented 5 years ago

So, I restarted following the zdg.2 to develop FSDump, added "src" and adapted its setup.py to include directory "src" (for what purpose? convention?). Anyway, with or without "src", I get the setuptools error:

File "~/fsdump/zope4/eggs/Zope-4.1-py3.8.egg/OFS/Application.py", line 389, in import_product
product = __import__("Products.%s" % product_name,
File "~/fsdump/Products.FSDump/src/Products/FSDump/__init__.py", line 5, in <module>
from Products.FSDumper.Dumper import Dumper, addDumperForm, addDumper
ModuleNotFoundError: No module named 'Products.FSDumper'

My fork for FSDump is up to date, if one of you wants to have a look. I put there also buildout.cfg. I guess next is to read about python packaging .

icemac commented 5 years ago

Could this discussion please be moved to a ticket in Products.FSDump. The Zope 4 documentation currently does not seem to be the problem. Please see zopefoundation/Products.FSDump#2

jugmac00 commented 5 years ago

@jugmac00, yes already registered to plone, forum seems deserted.

The forum just has been created as the merge of Plone and Zope foundation was announced only last month. The posts in the Zope subforum also gets shown on the start page, so I guess they will be read.