zopefoundation / grokproject

Script that creates a Grok project directory, installs Grok, the Grok Toolkit and the Zope Toolkit and sets up a complete skeleton for a new Grok web application.
Other
2 stars 8 forks source link

grokproject referencing svn.zope.org incorrectly #2

Closed kveroneau closed 7 years ago

kveroneau commented 7 years ago

Hi, I was going to check out Grok, and I am unable to even follow the getting started tutorial as grokproject appears to be broken... Here is my output:

Enter user (Name of an initial administrator user): grok
Enter passwd (Password for the initial administrator user): 
Determining current grok version...
Creating directory ./Sample
Running /zfs/kveroneau/grok-env/bin/python /zfs/kveroneau/Sample/bootstrap.py...
/zfs/kveroneau/grok-env/lib/python2.7/site-packages/pkg_resources/__init__.py:184: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need.
  stacklevel=1,
While:
  Initializing.
Error: Error downloading extends for URL http://svn.zope.org/*checkout*/zopetoolkit/tags/1.1.4/zopeapp.cfg: (404, 'Not Found')
Running /zfs/kveroneau/Sample/bin/buildout...
/bin/sh: 1: /zfs/kveroneau/Sample/bin/buildout: not found

After some research, I figured out that since zopetoolkit has moved over to GitHub, the URL redirects are now invalid and result in a 404. The URL to fetch zopeapp.cfg should be: https://raw.githubusercontent.com/zopefoundation/zopetoolkit/1.1.4/zopeapp.cfg

I find it really weird that this has also gone unnoticed in several years, really shows how many new projects are attempting to use Grok, or people try the tutorial and immediately fail and move on to the next web framework.

prsephton commented 7 years ago

The grok web site still has the http://grok.zope.org/releaseinfo/current referring to 1.5.5 (which happens to be the last time the web site was updated). The pastescript template for grok then downloads the cfg files from http://grok.zope.org/releaseinfo/1.5.5/versions.cfg.
The current grok version from github is 1.15. Quite a few updates since 1.5.5. The issue is that where there has been some change to the github repo, the web site (including releaseinfo) has completely stagnated. I suppose the right approach would be to somehow make a https://raw.githubusercontent.com/zopefoundation/grok/current (containing 1.15), and a https://raw.githubusercontent.com/zopefoundation/grok/1.15/version.cfg which refers to https://raw.githubusercontent.com/zopefoundation/zopetoolkit/1.1.4/zopeapp.cfg and https://raw.githubusercontent.com/zopefoundation/zopetoolkit/1.1.4/ztk.cfg. Then we simply change the pastescript to reference https://raw.githubusercontent.com/zopefoundation/grok/ as the base directory. How do we go about adding https://raw.githubusercontent.com/zopefoundation/grok to github? Can mere mortals do this?

prsephton commented 7 years ago

Hi; I have submitted a pull request which should fix this issue. In the interim, you can clone from:

git clone https://github.com/prsephton/grokproject.git
cd grokproject
python bootstrap.py
bin/buildout
bin/grokproject myprj

cd myprj
python bootstrap.py
bin/buildout
bin/paster serve parts/etc/deploy.ini

I have based the versions.cfg on the last known working grokproject at 1.5.5. So that's what you get.

Hope this helps someone else out there!

PS: Travis barfs horribly, but then again it would probably barf at the existing source for grokproject too. I did not update the tests.txt since this would only have to be changed again after the merge.

prsephton commented 7 years ago

Current status (as of August 24 2017, 8AM GMT):

If I remove setuptools (apt-get remove python-setuptools) then current (patched) distribution works perfectly.

> python ./bootstrap.py 
> bin/buildout
> bin/test -v1
    Ran 1 tests with 0 failures, 0 errors and 0 skipped in 14.304 seconds

Putting setuptools back at that stage (apt-get install python-setuptools) does not prevent tests from continuing to work.

> sudo apt-get install python-setuptools
> bin/test -v1
  Ran 1 tests with 0 failures, 0 errors and 0 skipped in 14.741 seconds.

However, running buildout at this stage breaks things:

> bin/buildout
paul@pdev:~/git/grokproject$ bin/buildout
Develop: '/home/paul/git/grokproject/.'
Updating grokproject.
Generated script '/home/paul/git/grokproject/bin/grokproject'.
Updating test.
> bin/test -v1
Traceback (most recent call last):
  File "bin/test", line 20, in <module>
    import zope.testrunner
ImportError: No module named testrunner

bin/grokproject generated by buildout while setuptools was absent contains:

sys.path[0:0] = [
    '/home/paul/git/grokproject',
    '/home/paul/.buildout/eggs/PasteScript-2.0.2-py2.7.egg',
    '/home/paul/.buildout/eggs/setuptools-0.6c11-py2.7.egg',
    '/home/paul/.buildout/eggs/six-1.10.0-py2.7.egg',
    '/home/paul/.buildout/eggs/PasteDeploy-1.5.2-py2.7.egg',
    '/home/paul/.buildout/eggs/Paste-2.0.3-py2.7.egg',
    ]

while the one generated by buildout with setuptools present contains:

sys.path[0:0] = [
    '/home/paul/git/grokproject',
    '/home/paul/.buildout/eggs/PasteScript-2.0.2-py2.7.egg',
    '/usr/lib/python2.7/dist-packages',
    '/home/paul/.buildout/eggs/six-1.10.0-py2.7.egg',
    '/home/paul/.buildout/eggs/PasteDeploy-1.5.2-py2.7.egg',
    '/home/paul/.buildout/eggs/Paste-2.0.3-py2.7.egg',
    ]

So, basically, having setuptools installed causes the path to not use the downloaded setuptools-0.6c11-py2.7.egg, but to use the systems installed setuptools which is incompatible with buildout.

Thats the problem. I'm still working on a solution.

Regards

clozinski commented 7 years ago

Thank you very much Paul. Most appreciated. I just returned from the Startup Hub Poland Accelerator, and was very keen to test this out. It is a huge help to me. Most appreciated.

The test runs correctly.
Debian 8 Python 2.7.9

The only thing I had to do is change the IP address in the buildout.cfg file.

And it is also good to add the following line to buildout. download-cache = /home/lozinski/dev/dlcache It saves lots of time when rerunning buildout.

Next up, let us see if we can release a Python 3 version of this.

Warm Regards Chris

prsephton commented 7 years ago

Finally. All TravisCI tests now complete. Fixed by a combination of grokproject/versions.cfg, grokproject/buildout.cfg and a change to the tests.txt to hard code the version source. Once merged we will change tests.txt and templates.py to correctly use zopefoundation/grokproject.