Skip to content

Commit

Permalink
Split versions into prod and dev versions.
Browse files Browse the repository at this point in the history
Automatically create a pip requirements file based on the prod versions.
  • Loading branch information
hannosch committed Jul 21, 2016
1 parent 4034752 commit c496173
Show file tree
Hide file tree
Showing 5 changed files with 249 additions and 99 deletions.
9 changes: 9 additions & 0 deletions buildout.cfg
Expand Up @@ -16,6 +16,7 @@ parts =
sphinx
checkversions
wsgi
requirements
sources-dir = develop
auto-checkout =
AccessControl
Expand Down Expand Up @@ -151,3 +152,11 @@ eggs =
Paste
PasteDeploy
PasteScript


[requirements]
recipe = plone.recipe.command
command =
${zopepy:bin-directory}/${zopepy:interpreter} util.py
update-command = ${:command}
stop-on-error = yes
94 changes: 94 additions & 0 deletions requirements.txt
@@ -0,0 +1,94 @@
-e git+https://github.com/zopefoundation/Zope.git@master#egg=Zope2
AccessControl==3.0.12
Acquisition==4.2.2
BTrees==4.3.1
DateTime==4.1.1
DocumentTemplate==2.13.2
ExtensionClass==4.1.2
Missing==3.1
MultiMapping==3.0
Paste==2.0.3
PasteDeploy==1.5.2
PasteScript==2.0.2
Persistence==3.0a1
Products.BTreeFolder2==3.0
Products.ExternalMethod==3.0
Products.MailHost==3.0
Products.OFSP==3.0
Products.PythonScripts==3.0
Products.SiteErrorLog==3.0
Products.StandardCacheManagers==3.0
Products.ZCTextIndex==3.0
Products.ZCatalog==3.2
Record==3.1
RestrictedPython==3.6.0
WebOb==1.6.1
WebTest==2.0.21
ZConfig==3.1.0
ZEO==4.1.0
ZODB==4.3.1
ZopeUndo==4.1
docutils==0.12
five.globalrequest==1.0
initgroups==3.0
mechanize==0.2.5
persistent==4.2.1
python-gettext==3.0
pytz==2016.6.1
repoze.retry==1.4
repoze.tm2==2.1
repoze.who==2.3
six==1.10.0
tempstorage==3.0
transaction==1.6.1
unittest2==1.1.0
zExceptions==3.0
zLOG==3.0
zc.lockfile==1.2.1
zdaemon==4.1.0
zodbpickle==0.6.0
zope.annotation==4.4.1
zope.browser==2.1.0
zope.browsermenu==4.1.1
zope.browserpage==4.1.0
zope.browserresource==4.1.0
zope.cachedescriptors==4.1.0
zope.component==4.2.2
zope.componentvocabulary==2.0.0
zope.configuration==4.0.3
zope.container==4.1.0
zope.contentprovider==4.0.0
zope.contenttype==4.1.0
zope.deferredimport==4.1.0
zope.deprecation==4.1.2
zope.dottedname==4.1.0
zope.event==4.2.0
zope.exceptions==4.0.8
zope.filerepresentation==4.1.0
zope.formlib==4.3.0
zope.globalrequest==1.2
zope.i18n==4.1.0
zope.i18nmessageid==4.0.3
zope.interface==4.2.0
zope.lifecycleevent==4.1.0
zope.location==4.0.3
zope.pagetemplate==4.2.1
zope.processlifetime==2.1.0
zope.proxy==4.2.0
zope.ptresource==4.0.0
zope.publisher==4.3.0
zope.ramcache==2.1.0
zope.schema==4.4.2
zope.security==4.0.3
zope.sendmail==4.0.1
zope.sequencesort==4.0.1
zope.site==4.0.0
zope.size==4.1.0
zope.structuredtext==4.1.0
zope.tal==4.2.0
zope.tales==4.1.1
zope.testbrowser==4.0.4
zope.testing==4.5.0
zope.testrunner==4.5.1
zope.traversing==4.0.0
zope.viewlet==4.0.0
45 changes: 45 additions & 0 deletions util.py
@@ -0,0 +1,45 @@
from ConfigParser import RawConfigParser
import os

HERE = os.path.abspath(os.path.dirname(__file__))


class CaseSensitiveParser(RawConfigParser):

def optionxform(self, value):
return value


def generate(in_, out):
in_file = os.path.join(HERE, in_)
out_file = os.path.join(HERE, out)

parser = CaseSensitiveParser()
parser.read(in_file)

requirements = []
versions = parser.items('versions')
zope_requirement = (
'-e git+https://github.com/zopefoundation/Zope.git@master#egg=Zope2\n')
for name, pin in versions:
if name == 'Zope2':
if pin:
zope_requirement = 'Zope2==%s\n' % pin
continue

if not pin:
continue
requirements.append('%s==%s\n' % (name, pin))

with open(out_file, 'wb') as fd:
fd.write(zope_requirement)
for req in sorted(requirements):
fd.write(req)


def main():
generate('versions-prod.cfg', 'requirements.txt')


if __name__ == '__main__':
main()
97 changes: 97 additions & 0 deletions versions-prod.cfg
@@ -0,0 +1,97 @@
# Version pins for required dependencies.

[versions]
Zope2 =
AccessControl = 3.0.12
Acquisition = 4.2.2
BTrees = 4.3.1
DateTime = 4.1.1
DocumentTemplate = 2.13.2
docutils = 0.12
ExtensionClass = 4.1.2
five.globalrequest = 1.0
initgroups = 3.0
mechanize = 0.2.5
Missing = 3.1
MultiMapping = 3.0
Paste = 2.0.3
PasteDeploy = 1.5.2
PasteScript = 2.0.2
Persistence = 3.0a1
persistent = 4.2.1
Products.BTreeFolder2 = 3.0
Products.ExternalMethod = 3.0
Products.MailHost = 3.0
Products.OFSP = 3.0
Products.PythonScripts = 3.0
Products.SiteErrorLog = 3.0
Products.StandardCacheManagers = 3.0
Products.ZCatalog = 3.2
Products.ZCTextIndex = 3.0
python-gettext = 3.0
pytz = 2016.6.1
Record = 3.1
repoze.retry = 1.4
repoze.tm2 = 2.1
repoze.who = 2.3
RestrictedPython = 3.6.0
six = 1.10.0
tempstorage = 3.0
transaction = 1.6.1
unittest2 = 1.1.0
WebOb = 1.6.1
WebTest = 2.0.21
zc.lockfile = 1.2.1
ZConfig = 3.1.0
zdaemon = 4.1.0
ZEO = 4.1.0
zExceptions = 3.0
zLOG = 3.0
ZODB = 4.3.1
zodbpickle = 0.6.0
zope.annotation = 4.4.1
zope.browser = 2.1.0
zope.browsermenu = 4.1.1
zope.browserpage = 4.1.0
zope.browserresource = 4.1.0
zope.cachedescriptors = 4.1.0
zope.component = 4.2.2
zope.componentvocabulary = 2.0.0
zope.configuration = 4.0.3
zope.container = 4.1.0
zope.contentprovider = 4.0.0
zope.contenttype = 4.1.0
zope.deferredimport = 4.1.0
zope.deprecation = 4.1.2
zope.dottedname = 4.1.0
zope.event = 4.2.0
zope.exceptions = 4.0.8
zope.filerepresentation = 4.1.0
zope.formlib = 4.3.0
zope.globalrequest = 1.2
zope.i18n = 4.1.0
zope.i18nmessageid = 4.0.3
zope.interface = 4.2.0
zope.lifecycleevent = 4.1.0
zope.location = 4.0.3
zope.pagetemplate = 4.2.1
zope.processlifetime = 2.1.0
zope.proxy = 4.2.0
zope.ptresource = 4.0.0
zope.publisher = 4.3.0
zope.ramcache = 2.1.0
zope.schema = 4.4.2
zope.security = 4.0.3
zope.sendmail = 4.0.1
zope.sequencesort = 4.0.1
zope.site = 4.0.0
zope.size = 4.1.0
zope.structuredtext = 4.1.0
zope.tal = 4.2.0
zope.tales = 4.1.1
zope.testbrowser = 4.0.4
zope.testing = 4.5.0
zope.testrunner = 4.5.1
zope.traversing = 4.0.0
zope.viewlet = 4.0.0
ZopeUndo = 4.1

0 comments on commit c496173

Please sign in to comment.