Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/512 update dare2 location type #1

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
476 commits
Select commit Hold shift + click to select a range
188ce2a
Add update_workflow script. Update hotfix version to avoid excessive …
alecpm Jul 27, 2016
570a926
Merge branch 'jazkarta-plone4' of https://github.com/isawnyu/pleiades…
cguardia Jul 28, 2016
6ff4e68
add fix for issue 191
witekdev Jul 28, 2016
9251755
add create capability to batch update script
cguardia Jul 28, 2016
9c5ff18
Merge branch 'jazkarta-plone4' of https://github.com/isawnyu/pleiades…
cguardia Jul 28, 2016
73fc30a
indicate content type on content type views.
witekdev Jul 29, 2016
6814ba0
Update pins.
alecpm Jul 29, 2016
97f827a
update geographer
davisagli Jul 29, 2016
22784f8
Add reference migration
alecpm Jul 31, 2016
88f4542
Add cache minimization to reference updater.
alecpm Jul 31, 2016
4a1f306
Fix counting of references.
alecpm Jul 31, 2016
48f0c48
Update missing pin for pleiades.json
alecpm Aug 1, 2016
7be7405
Update vocabularies version pin.
alecpm Aug 2, 2016
1c64e6f
update PleiadesEntity
davisagli Aug 3, 2016
b1d9208
add script to update rights properties on places, connections, locati…
witekdev Aug 9, 2016
d475ae1
add extra command line arguments to update_rights_property script for…
witekdev Aug 10, 2016
5461d3d
fixes to update_rights_property script
witekdev Aug 10, 2016
c9be9b0
Update bib migration
alecpm Aug 10, 2016
0089ba5
fix workflow option behavior when updating
cguardia Aug 10, 2016
ed94035
update PleiadesEntity pin to fix credits title
witekdev Aug 10, 2016
c4fea8a
Merge branch 'jazkarta-plone4' of github.com:isawnyu/pleiades3-buildo…
witekdev Aug 10, 2016
0d02f4c
update PleiadesEntity pin to fix credits title again
witekdev Aug 10, 2016
6db9376
update PleiadesEntity pin to include standardized content type icons
witekdev Aug 11, 2016
3e4a279
Update pleiades.rdf pin
alecpm Aug 11, 2016
c30a82c
Add staging bibitems dependencies.
alecpm Aug 11, 2016
97fa360
Add notredame to staging sources.
alecpm Aug 11, 2016
e7c1e8b
fix bug where content was modified instead of working copy when check…
cguardia Aug 15, 2016
9138eb8
show path of working copy when checking out content
cguardia Aug 15, 2016
8893429
fixes for reported issues on batch update
cguardia Aug 17, 2016
046366f
Update pins.
alecpm Aug 21, 2016
7411ba7
update PleiadesEntity
davisagli Aug 23, 2016
7ef5f36
update readme for more specific and flexible development installation…
paregorios Aug 24, 2016
6f707a9
update pleiades.notredame
davisagli Aug 24, 2016
b9310ca
change installation/setup instructions to reflect correct URL to use …
paregorios Aug 24, 2016
23562c4
responding to comments from @davisagli on https://github.com/isawnyu/…
paregorios Aug 25, 2016
41c2411
Merge pull request #2 from paregorios/jazkarta-plone4
davisagli Aug 25, 2016
45229bd
update pleiades.kml
davisagli Aug 26, 2016
a0e0131
update pin to fix issue 213
witekdev Aug 26, 2016
f26f0d7
Add bibitems to production build.
alecpm Aug 29, 2016
56a7949
Update pleiades entity pin
alecpm Aug 29, 2016
8a54e5f
Updates for reference migration.
alecpm Aug 30, 2016
26322df
Update PE version.
alecpm Aug 30, 2016
547b78f
Migration fixes.
alecpm Aug 30, 2016
a4c9ef5
Fix unicode issue in migration logging.
alecpm Aug 30, 2016
4375685
Don't try to migrate obsolete references.
alecpm Aug 30, 2016
5c91f11
Update PE version to incorporate bib uri fix.
alecpm Aug 30, 2016
0f661b0
add 20160830 hotfix 1.0
witekdev Aug 30, 2016
e3ca4f4
Merge branch 'jazkarta-plone4' of github.com:isawnyu/pleiades3-buildo…
witekdev Aug 30, 2016
8f5f7ba
update version of PleiadesEntity
cguardia Aug 31, 2016
71532c9
version pins for plone4.3.10
witekdev Aug 31, 2016
dbc51cc
Merge branch 'plone4.3.10' into jazkarta-plone4 temporarily to deploy…
witekdev Sep 1, 2016
d26335c
Revert "version pins for plone4.3.10"
witekdev Sep 1, 2016
722ff04
Revert "Revert "version pins for plone4.3.10""
witekdev Sep 1, 2016
62a3992
use davisagli-better-transnames collective.newrelic branch
witekdev Sep 1, 2016
5816e17
fix mr developer syntax
witekdev Sep 1, 2016
59ab4a3
pin davisaglis collective.newrelic branch in staging sources, revert …
witekdev Sep 1, 2016
14ec7ed
dont use branch use a revision
witekdev Sep 1, 2016
313f1b3
Revert "Revert "Revert "version pins for plone4.3.10"""
witekdev Sep 1, 2016
e52e1a0
make sure that 4.3.10 versions do not pollute the production buildout
witekdev Sep 1, 2016
14b3650
update p.kml
davisagli Sep 2, 2016
5de6537
new update for pleiades.kml
cguardia Sep 12, 2016
7afc76a
Update rdf dump script default url
alecpm Sep 21, 2016
4466644
Fix typo
alecpm Sep 21, 2016
d59ff10
Update staging sources
alecpm Sep 22, 2016
706a3f1
Update version pins.
alecpm Sep 23, 2016
fee99a5
Update version pins.
alecpm Sep 23, 2016
d7a67f4
update PleiadesEntity
davisagli Sep 26, 2016
02cf0a9
fix
davisagli Sep 26, 2016
d68bbac
fix busted text formatting in README
paregorios Oct 28, 2016
156c7fb
add missing field for names (nameTransliterated) and remove redundant…
paregorios Oct 28, 2016
8022d6f
include commit message on workflow transitions, not just on working c…
paregorios Oct 28, 2016
97f52d0
add support for setting time periods to the batch update script
paregorios Oct 28, 2016
1ddc78e
update PleiadesEntity
davisagli Oct 31, 2016
cb03695
update Pleiades.Entity
witekdev Oct 31, 2016
9db0d45
update Pleiades.Entity for kml fix (issue 220)
witekdev Oct 31, 2016
5481aed
update PleiadesEntity
davisagli Nov 1, 2016
8449e89
update to plone 4.3.10
witekdev Nov 1, 2016
283f506
update collective.newrelic version pin
witekdev Nov 1, 2016
9db6fe5
update PleiadesEntity
davisagli Nov 1, 2016
2bd9f93
Merge pull request #3 from paregorios/october-surprise
davisagli Nov 1, 2016
5d5d332
4.3.10 is in production, we no longer need explicit staging 4.3.10 ve…
witekdev Nov 1, 2016
867a93e
update Products.PleiadesEntity pin to include missing gif images
witekdev Nov 2, 2016
65ac874
update PleiadesEntity
davisagli Nov 3, 2016
d790cc4
Add connection metadata update script.
alecpm Nov 3, 2016
df5d3f4
Handle empty connection metadata
alecpm Nov 4, 2016
44f77c2
update p.vocabularies
davisagli Nov 4, 2016
7af6de8
Add cache minimize call to avoid excessive RAM usage.
alecpm Nov 4, 2016
0cfc3e1
Update iterate version pin
alecpm Nov 4, 2016
4abccde
Update dependencies.
alecpm Nov 6, 2016
f69eedc
Add policy overrides zcml to buildout
alecpm Nov 7, 2016
279d73e
Add zcml overrides for staging config.
alecpm Nov 7, 2016
39a624d
Fix bad buildout part for staging config
alecpm Nov 7, 2016
df31bd6
Remove redundant config
alecpm Nov 7, 2016
c073a8b
Fix typo
alecpm Nov 7, 2016
4d04415
update pleiades entity version
cguardia Nov 7, 2016
6ad24a1
deploy story 92
davisagli Nov 8, 2016
f576019
deploy PleiadesEntity
davisagli Nov 8, 2016
bbec3f0
Remove overrides zcml from non-staging.
alecpm Nov 23, 2016
e36f4da
update PleiadesEntity
davisagli Nov 24, 2016
1954ed5
update PleiadesEntity
davisagli Nov 24, 2016
7b1b6c1
apply hotfix, update plone.
alecpm Nov 29, 2016
74ef7b1
Postpone Plone 4.3.11 upgrade
alecpm Nov 29, 2016
71b436e
when creating a new Place, ignore dummy ID in input JSON file and aut…
paregorios Dec 2, 2016
18bc5d7
update pleiades entity version
cguardia Dec 20, 2016
0d15eed
add hotfix
davisagli Jan 18, 2017
3b046e2
update PleiadesEntity to latest rev for fixes to credits page
paregorios Feb 14, 2017
e24fdcb
combine elements of value lists before calling mutator for title or d…
paregorios Oct 27, 2017
377fcfd
Merge pull request #5 from isawnyu/issue319
paregorios Oct 27, 2017
fe72222
add hotfix
davisagli Nov 30, 2017
b495eb4
specify https index explicitly
davisagli Nov 30, 2017
b285d20
update PleiadesEntity for edit form ref fixes
paregorios Dec 15, 2017
b9a79ac
updated rev for PleiadesEntity to include all fixes for https://githu…
paregorios Dec 27, 2017
41f8d8a
update PleiadesEntity commit to deploy fixes for https://github.com/i…
paregorios Jan 1, 2018
2c34dea
update PleiadesEntity and pleiades-notredame commit hashes to deploy …
paregorios Jan 2, 2018
f233b64
update PleiadesEntity commit hash to deploy changes for https://githu…
paregorios Jan 10, 2018
ee60428
bump PleiadesEntity revision number to ad3fdaaddc4d3f943b206390f70b76…
paregorios Jan 10, 2018
3ddc4f4
bump picked pleiades.notredame commit to cc22c16d5b9f17778aaa54fa372c…
paregorios Jan 11, 2018
eefe9a9
update PleiadesEntity pinned revision to 859d23303d9deb2cb6a4f609e424…
paregorios Jan 12, 2018
8a76c98
working script to add references specified in a JSON file
paregorios Jun 7, 2018
c59e0a5
update pinned commit for PleiadesEntity to deploy fixes for https://g…
paregorios Jun 10, 2018
66d8785
update pinned rev for pleiades.portlet.pelagios
paregorios Oct 31, 2018
b1ed875
Update pillow version
alecpm Mar 26, 2019
b0db1d6
Revert "Update pillow version"
alecpm Mar 26, 2019
ea8a51f
Merge pull request #4 from paregorios/placemaker
cguardia Mar 27, 2019
fcf8486
minor edit
cguardia Mar 27, 2019
d2d89dd
Fix source for flickr portlet on staging.
alecpm Mar 28, 2019
26e1903
Move annoying old supervisor config out of the way.
alecpm Mar 28, 2019
2fa1dc9
make sure place-types dump uses appropriate vocabulary source
cguardia Mar 29, 2019
63726a1
Version pin and staging branch updates.
alecpm Apr 3, 2019
ab50083
Update version pins and add build to ignores.
alecpm Apr 10, 2019
c14280b
Oops, wrong hash.
alecpm Apr 10, 2019
95c1f4d
Update PleiadesEntity version
MatthewWilkes Apr 11, 2019
6450329
Updated PleiadesEntity version pin for dump fix.
alecpm Apr 15, 2019
bea1a63
Update PleiadesEntity pin, gracefully handle unindexed content in dump.
alecpm Apr 15, 2019
e11b1a7
Update pin again.
alecpm Apr 15, 2019
16cfdc0
Update pins for ATVM removal.
alecpm Jun 3, 2019
7e7485c
Update pleiades.vocabularies pin.
alecpm Jun 4, 2019
ff5fa69
Update version pin for PleiadesEntity to enable Name naming.
alecpm Jun 6, 2019
0f00038
Update pleiadesentity for zombie reduction
MatthewWilkes Jun 7, 2019
67d2ca6
Update rdf pin.
alecpm Jun 7, 2019
4e1c2f8
Merge issues 290 and 343.
cguardia Jun 7, 2019
736723f
Update PleiadesEntity pin
alecpm Jun 12, 2019
c7f1102
Use staging branch for pelagios portlet
alecpm Aug 30, 2019
1979398
Update pins.
alecpm Aug 30, 2019
3e5b47a
Update pleiadesentity pin.
alecpm Sep 4, 2019
d04cf4d
Udpate version pins.
alecpm Sep 6, 2019
37a5d19
One more pin.
alecpm Sep 6, 2019
048623b
Add hotfix.
alecpm Jan 21, 2020
04cb74f
bump rev on isaw.bibitems
paregorios Feb 3, 2020
76c28a9
Bump rev on PleiadesEntity
paregorios Apr 23, 2020
78a62fd
bump rev on Pleiades Entity
paregorios May 21, 2020
f2baec5
bump rev on PleiadesEntity
paregorios Jun 7, 2020
3c25e00
bump PleiadesEntity version
paregorios Jun 7, 2020
72fdad2
bump version on pleiades.vocabularies
paregorios Jun 8, 2020
69e44de
Bump version on PleiadesEntity
paregorios Oct 14, 2020
7557f18
Update pins and bootstrap
alecpm Nov 16, 2020
d32e16e
Fix bad pin
alecpm Nov 16, 2020
d35b9cc
Remove obsolete extension.
alecpm Nov 16, 2020
845d199
Remove unwanted parts.
alecpm Nov 16, 2020
7e2ed19
Fix duplicated config.
alecpm Nov 16, 2020
becc676
Fix product installation issue.
alecpm Nov 16, 2020
16ba499
Fix backups.
alecpm Nov 16, 2020
2326191
update pin for PleiadesEntity
paregorios Nov 16, 2020
8ea8771
Simplify and fix buildout issues.
alecpm Nov 17, 2020
70e3a0c
Update PleiadesEntity pin for issue 433
alecpm Nov 19, 2020
6238fda
Update pin for issue #416 fix.
alecpm Nov 19, 2020
dd5b072
Upgrade to Plone 4.3.19
alecpm Nov 21, 2020
e794e2f
reindex updated objects
cguardia Nov 21, 2020
65ff130
Merge branch 'updated-pins' of https://github.com/isawnyu/pleiades3-b…
cguardia Nov 21, 2020
d56d976
Update pleiades.vocabularies pin.
alecpm Nov 21, 2020
a0795d7
Another Plone version bump.
alecpm Nov 24, 2020
663ed7b
Update geographer pin.
alecpm Dec 1, 2020
4e45877
Update PleiadesEntity pin
alecpm Dec 1, 2020
bfa986b
Add connection type fix.
alecpm Dec 1, 2020
636b82d
Update pleiades.geographer pin.
alecpm Dec 6, 2020
e5930f1
bumped PleiadesEntity pin
paregorios Jan 5, 2021
5f4664e
start new batch ingest with script created for the YDEA project initi…
paregorios Feb 9, 2021
cc77782
added example files for the placemaker script
paregorios Feb 9, 2021
7c8381b
bumped pin on pleiades.notredame
paregorios Feb 16, 2021
ee6fdd0
bumped pin for pleiades.geographer
paregorios Feb 19, 2021
406f264
bump pin for PleiadesEntity
paregorios Feb 19, 2021
5a0b4e8
start new batch ingest with script created for the YDEA project initi…
paregorios Feb 9, 2021
5e18888
added example files for the placemaker script
paregorios Feb 9, 2021
c003a79
Merge branch 'issue445' of github.com:paregorios/pleiades3-buildout i…
paregorios Feb 23, 2021
d1c44e6
Merge pull request #6 from paregorios/issue445
paregorios Feb 23, 2021
e924d4d
bump pin for PleiadesEntity
paregorios Feb 23, 2021
da21b63
bump pin for PleiadesEntity
paregorios Mar 10, 2021
b7d69b7
Update notredame pin.
alecpm Apr 21, 2021
df15500
Update PleiadesEntity pin
alecpm Apr 21, 2021
484337f
Hotfix
alecpm May 21, 2021
bd25c8a
Hotfix and setuptools update.
alecpm Jun 11, 2021
61eeab4
Pin backup recipe
alecpm Jun 11, 2021
9976656
Use available version of pyproj
alecpm Sep 10, 2021
0158973
Add log rotation.
alecpm Sep 23, 2021
d4c8e8d
handle ID collisions on location creation to address https://github.c…
paregorios Nov 3, 2021
db35a34
make command-line argument list construction more flexible: use eithe…
paregorios Nov 3, 2021
58c8126
Merge pull request #7 from isawnyu/issue457
paregorios Nov 4, 2021
90056f3
remove old FALLBACKIDs hack
Jan 12, 2022
f54cf12
refactor connection creation code to check for full Pleiades URIs, si…
Jan 12, 2022
499f0fa
handle command-line input of multi-word tags without stripping out sp…
Jan 27, 2022
6207033
Merge pull request #8 from isawnyu/issue460
paregorios Jan 27, 2022
f93c66e
handle command-line input of multi-word tags without stripping out sp…
Jan 27, 2022
5f58fb0
Merge branch 'master' into issue459
Jan 27, 2022
f995557
Merge remote-tracking branch 'origin' into issue458
Jan 27, 2022
43dc0c5
Merge pull request #9 from isawnyu/issue458
paregorios Jan 27, 2022
18ad9d5
Merge branch 'master' into issue459
Jan 27, 2022
ea6dd79
add "actor" argument; set "actor" and "message" on the first (only) w…
Jan 27, 2022
8f6331b
change default workflow history message
Jan 27, 2022
07e9b5d
Merge pull request #10 from isawnyu/issue459
paregorios Jan 27, 2022
bb1b9db
Update SSL pins.
alecpm Mar 4, 2022
f486539
Update version pins to include right-hand rule geojson.
alecpm Mar 23, 2022
8daafa1
Update buildout and shapely versions.
alecpm Mar 23, 2022
ae9082c
Update version pins.
alecpm Mar 24, 2022
f2d5b26
No policy overrides.
alecpm Mar 24, 2022
f125022
Pin updates for release.
alecpm Mar 25, 2022
2907d38
Add rdf pin.
alecpm Mar 25, 2022
e32e311
Merge branch 'buildout-updates'
alecpm Mar 25, 2022
0bbfb37
Update pleiadesentity pin.
alecpm Mar 25, 2022
d728219
Update pin for map zoom fix.
alecpm Mar 25, 2022
ba5c779
Update PleiadesEntity pin.
alecpm Mar 25, 2022
c3cb7ed
Update PleiadesEntity pin.
alecpm Apr 27, 2022
bac4dd0
Update PleiadesEntity pin.
alecpm Apr 28, 2022
8173bbe
Bump PleiadesEntity version.
alecpm Apr 28, 2022
7d0b581
Bump PleiadesEntity version.
alecpm Apr 28, 2022
790afed
script to batch load locations
Aug 30, 2022
87d0a82
Bump pin for pleiades.dump to most recent commit
jessesnyder Nov 7, 2022
0fff79f
Merge pull request #13 from isawnyu/location_maker
jessesnyder Nov 7, 2022
a42585e
Merge branch 'issues/470-bump-dumps-pin'
jessesnyder Nov 7, 2022
829fdb1
Remove New Relic APM support.
alecpm Nov 7, 2022
ae852fd
Update PleiadesEntity pin for #344.
alecpm Nov 7, 2022
e384610
Merge branch 'remove-newrelic'
alecpm Nov 7, 2022
67f7536
Bump pin for Products.PleiadesEntity to complete issue 463
jessesnyder Nov 11, 2022
d4f1b66
Bump pleaides.dump
alecpm Nov 11, 2022
6f32290
Update PleiadesEntity pin for pleiades-gazetteer #432 and #157
silviot Dec 2, 2022
3a4f78b
Ignore .vscode directory
jessesnyder Mar 30, 2023
647a50d
Update pins for #492 and #493
jessesnyder Apr 4, 2023
b91a8b4
Update sha to deploy https://github.com/isawnyu/pleiades-gazetteer/is…
jessesnyder Jun 22, 2023
8a12a9d
Update PleiadesEntity and vocabularies to include reference optimization
silviot Jun 27, 2023
6d486fd
Update sha to deploy https://github.com/isawnyu/pleiades-gazetteer/is…
silviot Feb 14, 2024
9eb3bf1
Add plone.contentratings until ZODB cruft can be removed
jessesnyder Feb 15, 2024
dc64d67
Merge pull request #14 from isawnyu/pleiades-gazetteer/issues/506
jessesnyder Feb 15, 2024
9bc1132
Update commit hash to update pleiades.policy
jessesnyder Feb 15, 2024
0ee0db2
Remove pleiades.portlet.pelagios from buildout
jessesnyder Feb 15, 2024
5c913a3
Update sha to deploy https://github.com/isawnyu/pleiades-gazetteer/is…
jessesnyder Feb 19, 2024
7d00441
Update PleiadesEntity SHA to deploy #507 and https://github.com/isawn…
silviot Feb 21, 2024
b7caf43
Pin plone.contentratings
jessesnyder Feb 21, 2024
327fe04
Merge branch 'issues/506-remove-pelagios-portlet-2'
jessesnyder Feb 21, 2024
c7bf41d
Update PleiadesEntity pin for accuracy buffers.
alecpm Feb 24, 2024
8eb1eef
Update pleiades.kml pin to deploy https://github.com/isawnyu/pleiades…
silviot Feb 27, 2024
1e3a0b4
Implement a script to update LocationType field for locations referen…
chiruzzimarco May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
.Python
.installed.cfg
.mr.developer.cfg
.vscode
supervisord.conf
this-production.cfg
bin
develop-eggs
downloads
eggs
include
lib
parts
src
var
local
build
Empty file removed 335-versions.cfg
Empty file.
36 changes: 36 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Pleiades Buildout
=================

The buildout configuration files are:

buildout.cfg
Libraries and eggs common to development and production

versions.cfg
Pinned versions for Pleiades

devel.cfg
Buildout for development

pleiades-production.cfg
Buildout for Pleiades production server,
including ZEO, nginx, varnish, & supervisor.

Pleiades package distributions are fetched from http://atlantides.org/eggcarton/.


Installation
------------

1. Install the libgeos prerequisite. (On OSX, this can be done with homebrew; the recipe is called "geos")
2. Clone the repos
3. Create a Python 2.7 virtual environment and activate it
4. In the clone, checkout the jazkarta-plone4 branch
5. Run "bin/python bootstrap.py"
6. Run "bin/buildout -c devel.cfg"
7. An admin user is created by default. If you need to create an additional login with admin powers, do: ``bin/instance adduser <name> <password>``
8. Start Zope instance in foreground with "bin/instance fg"
9. Go to http://localhost:9080
10. Authenticate with an administrative user account
11. Click Add Plone Site and create a Plone site named `plone`
12. Include the `Pleiades Site Policy` and `Pleiades Theme` add-ons.
8 changes: 8 additions & 0 deletions bin/freeze_revisions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

for pkg in $(ls src); do
cd src/$pkg
echo "$pkg = git $(cat .git/config | grep url | cut -f 3 -d' ') rev=$(git rev-parse HEAD)"
cd - > /dev/null
done
206 changes: 182 additions & 24 deletions bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
Expand All @@ -16,40 +16,198 @@
Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.

$Id$
"""

import os, shutil, sys, tempfile, urllib2
import os
import shutil
import sys
import tempfile

from optparse import OptionParser

__version__ = '2015-07-01'
# See zc.buildout's changelog if this version is up to date.

tmpeggs = tempfile.mkdtemp(prefix='bootstrap-')

usage = '''\
[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]

Bootstraps a buildout-based project.

Simply run this script in a directory containing a buildout.cfg, using the
Python that you want bin/buildout to use.

tmpeggs = tempfile.mkdtemp()
Note that by using --find-links to point to local resources, you can keep
this script from going over the network.
'''

parser = OptionParser(usage=usage)
parser.add_option("--version",
action="store_true", default=False,
help=("Return bootstrap.py version."))
parser.add_option("-t", "--accept-buildout-test-releases",
dest='accept_buildout_test_releases',
action="store_true", default=False,
help=("Normally, if you do not specify a --buildout-version, "
"the bootstrap script and buildout gets the newest "
"*final* versions of zc.buildout and its recipes and "
"extensions for you. If you use this flag, "
"bootstrap and buildout will get the newest releases "
"even if they are alphas or betas."))
parser.add_option("-c", "--config-file",
help=("Specify the path to the buildout configuration "
"file to be used."))
parser.add_option("-f", "--find-links",
help=("Specify a URL to search for buildout releases"))
parser.add_option("--allow-site-packages",
action="store_true", default=False,
help=("Let bootstrap.py use existing site packages"))
parser.add_option("--buildout-version",
help="Use a specific zc.buildout version")
parser.add_option("--setuptools-version",
help="Use a specific setuptools version")
parser.add_option("--setuptools-to-dir",
help=("Allow for re-use of existing directory of "
"setuptools versions"))

options, args = parser.parse_args()
if options.version:
print("bootstrap.py version %s" % __version__)
sys.exit(0)


######################################################################
# load/install setuptools

try:
import pkg_resources
from urllib.request import urlopen
except ImportError:
ez = {}
exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
).read() in ez
ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
from urllib2 import urlopen

ez = {}
if os.path.exists('ez_setup.py'):
exec(open('ez_setup.py').read(), ez)
else:
exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez)

if not options.allow_site_packages:
# ez_setup imports site, which adds site packages
# this will remove them from the path to ensure that incompatible versions
# of setuptools are not in the path
import site
# inside a virtualenv, there is no 'getsitepackages'.
# We can't remove these reliably
if hasattr(site, 'getsitepackages'):
for sitepackage_path in site.getsitepackages():
# Strip all site-packages directories from sys.path that
# are not sys.prefix; this is because on Windows
# sys.prefix is a site-package directory.
if sitepackage_path != sys.prefix:
sys.path[:] = [x for x in sys.path
if sitepackage_path not in x]

setup_args = dict(to_dir=tmpeggs, download_delay=0)

import pkg_resources
if options.setuptools_version is not None:
setup_args['version'] = options.setuptools_version
else:
setup_args['version'] = '42.0.2'
if options.setuptools_to_dir is not None:
setup_args['to_dir'] = options.setuptools_to_dir

cmd = 'from setuptools.command.easy_install import main; main()'
if sys.platform == 'win32':
cmd = '"%s"' % cmd # work around spawn lamosity on windows
ez['use_setuptools'](**setup_args)
import setuptools
import pkg_resources

# This does not (always?) update the default working set. We will
# do it.
for path in sys.path:
if path not in pkg_resources.working_set.entries:
pkg_resources.working_set.add_entry(path)

######################################################################
# Install buildout

ws = pkg_resources.working_set
assert os.spawnle(
os.P_WAIT, sys.executable, sys.executable,
'-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
dict(os.environ,
PYTHONPATH=
ws.find(pkg_resources.Requirement.parse('setuptools')).location
),
) == 0

setuptools_path = ws.find(
pkg_resources.Requirement.parse('setuptools')).location

# Fix sys.path here as easy_install.pth added before PYTHONPATH
cmd = [sys.executable, '-c',
'import sys; sys.path[0:0] = [%r]; ' % setuptools_path +
'from setuptools.command.easy_install import main; main()',
'-mZqNxd', tmpeggs]

find_links = os.environ.get(
'bootstrap-testing-find-links',
options.find_links or
('http://downloads.buildout.org/'
if options.accept_buildout_test_releases else None)
)
if find_links:
cmd.extend(['-f', find_links])

requirement = 'zc.buildout'
version = options.buildout_version
if version is None and not options.accept_buildout_test_releases:
# Figure out the most recent final version of zc.buildout.
import setuptools.package_index
_final_parts = '*final-', '*final'

def _final_version(parsed_version):
try:
return not parsed_version.is_prerelease
except AttributeError:
# Older setuptools
for part in parsed_version:
if (part[:1] == '*') and (part not in _final_parts):
return False
return True

index = setuptools.package_index.PackageIndex(
search_path=[setuptools_path])
if find_links:
index.add_find_links((find_links,))
req = pkg_resources.Requirement.parse(requirement)
if index.obtain(req) is not None:
best = []
bestv = None
for dist in index[req.project_name]:
distv = dist.parsed_version
if _final_version(distv):
if bestv is None or distv > bestv:
best = [dist]
bestv = distv
elif distv == bestv:
best.append(dist)
if best:
best.sort()
version = best[-1].version
if version:
requirement = '=='.join((requirement, version))
cmd.append(requirement)

import subprocess
if subprocess.call(cmd) != 0:
raise Exception(
"Failed to execute command:\n%s" % repr(cmd)[1:-1])

######################################################################
# Import and run buildout

ws.add_entry(tmpeggs)
ws.require('zc.buildout')
ws.require(requirement)
import zc.buildout.buildout
zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])

if not [a for a in args if '=' not in a]:
args.append('bootstrap')

# if -c was provided, we push it back into args for buildout' main function
if options.config_file is not None:
args[0:0] = ['-c', options.config_file]

zc.buildout.buildout.main(args)
shutil.rmtree(tmpeggs)

Loading