Skip to content

Commit

Permalink
Merge branch 'master' into test-str-format-master
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz authored Sep 15, 2017
2 parents 90de178 + 53a68bb commit 447493e
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 433 deletions.
573 changes: 175 additions & 398 deletions CHANGES.rst

Large diffs are not rendered by default.

11 changes: 3 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,15 @@ Zope is an open-source web application server.
This document provides some general information about Zope and provides
links to other documents.

Installation information can be found in ``docs/INSTALL.rst``. Other
documentation is also in the "docs" directory and in the Zope
documentation section at https://zope.readthedocs.io .
Documentation can be found at https://zope.readthedocs.io.

Installation
============

Follow the instructions in ``docs/INSTALL.rst`` to install Zope.

If you do not have a source checkout with docs, you can find the latest
install docs online at
Installation information can be found at
https://zope.readthedocs.io/en/latest/INSTALL-buildout.html

Note that you *cannot* simply do ``pip install zope2``, because you need
Note that you *cannot* simply do ``pip install Zope2``, because you need
specific versions of all dependencies. Follow the documentation to
ensure you get the correct versions, or else installation is very
likely to fail.
Expand Down
8 changes: 1 addition & 7 deletions docs/maintenance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The following persons have access to the ``Zope2`` package on PyPI
- Hanno Schlichting
- Michael Howitz
- Tres Seaver
- Jens Vagelpohl

Steps for creating a new Zope release
+++++++++++++++++++++++++++++++++++++
Expand All @@ -41,13 +42,6 @@ Steps for creating a new Zope release

bin/tox

- Run all tests for all dependencies::

bin/alltests-py27
bin/alltests-py34
...
bin/alltests-pypy3

- Tag the release.

- Upload the tagged release to PyPI::
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _read_file(filename):
README = _read_file('README.rst')
CHANGES = _read_file('CHANGES.rst')

__version__ = '4.0a7.dev0'
__version__ = '4.0b1.dev0'

setup(
name='Zope2',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 12 additions & 19 deletions src/OFS/tests/testAppInitializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
#
##############################################################################

import io
import os
import shutil
import tempfile
import unittest

from App.config import getConfiguration, setConfiguration
from OFS.Application import Application, AppInitializer
import ZConfig
import Zope2.Startup
from Zope2.Startup.options import ZopeWSGIOptions

TEMPNAME = tempfile.mktemp()
TEMPPRODUCTS = os.path.join(TEMPNAME, "Products")
Expand All @@ -36,20 +35,14 @@
</zodb_db>
"""


def getSchema():
startup = os.path.dirname(os.path.realpath(Zope2.Startup.__file__))
schemafile = os.path.join(startup, 'wsgischema.xml')
return ZConfig.loadSchema(schemafile)
original_config = None


def getApp():
from App.ZApplication import ZApplicationWrapper
DB = getConfiguration().dbtab.getDatabase('/')
return ZApplicationWrapper(DB, 'Application', Application)()

original_config = None


class TestInitialization(unittest.TestCase):
""" Test the application initializer object """
Expand All @@ -58,16 +51,13 @@ def setUp(self):
global original_config
if original_config is None:
original_config = getConfiguration()
self.schema = getSchema()
os.makedirs(TEMPNAME)
os.makedirs(TEMPPRODUCTS)

def tearDown(self):
import App.config
del self.schema
App.config.setConfiguration(original_config)
os.rmdir(TEMPPRODUCTS)
os.rmdir(TEMPNAME)
shutil.rmtree(TEMPNAME)
import Products
Products.__path__ = [d for d in Products.__path__
if os.path.exists(d)]
Expand All @@ -76,11 +66,14 @@ def configure(self, text):
# We have to create a directory of our own since the existence
# of the directory is checked. This handles this in a
# platform-independent way.
schema = self.schema
sio = io.StringIO(text.replace(u"<<INSTANCE_HOME>>", TEMPNAME))
conf, handler = ZConfig.loadConfigFile(schema, sio)
self.assertEqual(conf.instancehome, TEMPNAME)
setConfiguration(conf)
config_path = os.path.join(TEMPNAME, 'zope.conf')
with open(config_path, 'w') as fd:
fd.write(text.replace(u"<<INSTANCE_HOME>>", TEMPNAME))

options = ZopeWSGIOptions(config_path)()
config = options.configroot
self.assertEqual(config.instancehome, TEMPNAME)
setConfiguration(config)

def getOne(self):
app = getApp()
Expand Down
1 change: 1 addition & 0 deletions src/Zope2/Startup/wsgischema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<!-- type definitions -->

<import package="ZODB"/>
<import package="tempstorage" condition="tempstorage"/>

<sectiontype name="environment"
datatype=".environment"
Expand Down

0 comments on commit 447493e

Please sign in to comment.