-
-
Notifications
You must be signed in to change notification settings - Fork 79
/
base.cfg
200 lines (181 loc) · 5.45 KB
/
base.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
[buildout]
index = https://pypi.org/simple/
extensions = mr.developer
parts =
instance
test
test-coverage
test-no-uncommitted-doc-changes
test-no-sphinx-warnings
code-analysis
dependencychecker
dependencies
update-translations
find-untranslated
sphinxbuilder
sphinx-python
deploy-to-heroku
omelette
develop = .
sources-dir = extras
auto-checkout =
# plone.rest
allow-hosts =
*.python.org
*.plone.org
*.zope.org
pypi.org
files.pythonhosted.org
launchpad.net
code.google.com
robotframework.googlecode.com
[versions]
# Do not use a release of plone.restapi:
plone.restapi =
[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
deprecation-warnings = on
debug-exceptions = on
eggs =
Plone
Pillow
plone.app.debugtoolbar
plone.restapi [test]
environment-vars =
zope_i18n_compile_mo_files true
zcml-additional =
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:plone="http://namespaces.plone.org/plone">
<plone:CORSPolicy
allow_origin="http://localhost:4300,http://127.0.0.1:4300,http://localhost:3000,http://127.0.0.1:3000"
allow_methods="DELETE,GET,OPTIONS,PATCH,POST,PUT"
allow_credentials="true"
expose_headers="Content-Length,X-My-Header"
allow_headers="Accept,Authorization,Content-Type,X-Custom-Header,Lock-Token"
max_age="3600"
/>
</configure>
[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
initialization =
os.environ['TZ'] = 'UTC'
# In Python 3.8+, for the TZ environment variable to be used, it's
# necessary to explicitly call time.tzset().
import time
time.tzset()
os.environ['ZSERVER_PORT'] = '55001'
defaults = ['-s', 'plone.restapi', '--auto-color', '--auto-progress']
[test-coverage]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
export TZ=UTC
${buildout:directory}/bin/coverage run bin/test $*
${buildout:directory}/bin/coverage html
${buildout:directory}/bin/coverage report -m --fail-under=90
# Fail (exit status 1) if coverage returns exit status 2 (this happens
# when test coverage is below 100%.
output = ${buildout:directory}/bin/test-coverage
mode = 755
[test-no-uncommitted-doc-changes]
recipe = collective.recipe.template
input = test-no-uncommitted-doc-changes.in
output = bin/test-no-uncommitted-doc-changes
mode = 755
[test-no-sphinx-warnings]
recipe = collective.recipe.template
input = test-no-sphinx-warnings.in
output = bin/test-no-sphinx-warnings
mode = 755
[code-analysis]
recipe = plone.recipe.codeanalysis
directory = ${buildout:directory}/src
flake8-exclude=bootstrap.py,bootstrap-buildout.py,docs,bin,*.egg,setup.py,overrides,omelette
flake8-max-complexity = 25
flake8-ignore = E203, E266, E501, W503, E231
flake8-max-line-length = 200
# flake8-select = B,C,E,F,W,T4,B9
flake8-extensions =
flake8-debugger
flake8-print
# flake8-isort
# additional pep8/flake8 rules, see docs for details
# https://pep8.readthedocs.io/en/1.4.6/intro.html#error-codes
# - E123: closing bracket does not match indentation of opening bracket’s line
# flake8-select = E123
[dependencychecker]
recipe = zc.recipe.egg
eggs =
z3c.dependencychecker
plone.restapi
scripts = dependencychecker
[dependencies]
recipe = zc.recipe.egg
eggs =
zest.releaser[recommended]
zest.pocompile
zestreleaser.towncrier
towncrier
readme
docutils
zpretty
i18ndude
coverage
[update-translations]
recipe = collective.recipe.template
input = inline:
domain=plone.restapi
maindir=src/plone/restapi
locales=$maindir/locales
echo "Update translations for $domain"
if [ ! -f $locales/$domain.pot ]; then
# Create .pot file if it does not exist yet
touch $locales/$domain.pot
fi
if [ ! -f $locales/de/LC_MESSAGES ]; then
# Create de/LC_MESSAGES directory if it does not exist yet
mkdir -p $locales/de/LC_MESSAGES
fi
if [ ! -f $locales/de/LC_MESSAGES/$domain.po ]; then
# Create .po file if it does not exist yet
touch $locales/de/LC_MESSAGES/$domain.po
fi
${buildout:directory}/bin/i18ndude rebuild-pot --pot $locales/$domain.pot --create $domain $maindir
${buildout:directory}/bin/i18ndude sync --pot $locales/$domain.pot $locales/*/LC_MESSAGES/$domain.po
output = ${buildout:directory}/bin/update-translations
mode = 755
[find-untranslated]
recipe = collective.recipe.template
input = inline:
#!/bin/sh
bin/i18ndude find-untranslated `find -L src/plone/restapi -regex ".*\.[cz]?pt"`
output = ${buildout:directory}/bin/find-untranslated
mode = 755
[sphinxbuilder]
recipe = collective.recipe.sphinxbuilder
source = ${buildout:directory}/docs/source
build = ${buildout:directory}/docs
interpreter = ${buildout:directory}/bin/${sphinx-python:interpreter}
[sphinx-python]
recipe = zc.recipe.egg
eggs =
sphinx_rtd_theme
sphinxcontrib-httpdomain
sphinxcontrib-httpexample
interpreter = sphinxPython
[deploy-to-heroku]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
git push heroku master
output = ${buildout:directory}/bin/deploy-to-heroku
mode = 755
[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}
[sources]
plone.rest = git git://github.com/plone/plone.rest.git pushurl=git@github.com:plone/plone.rest.git branch=master
plone.schema = git git://github.com/plone/plone.schema.git pushurl=git@github.com:plone/plone.schema.git branch=newjsonschemafield