jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/371095 )

Change subject: Add script to get phan version from extra.phan-version in 
composer.json
......................................................................


Add script to get phan version from extra.phan-version in composer.json

It defaults to 0.8 during the migraiton period but it will throw an
exception in the future. This allows each repository to set their own
phan version and control upgrades, but it can't be set in "require-dev"
due to the PHP 7.0 dependency.

Change-Id: Ie9a7b83f3446a339378ff5f7928ca60d6f941bac
---
A bin/mw-get-phan-version.py
1 file changed, 26 insertions(+), 0 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/bin/mw-get-phan-version.py b/bin/mw-get-phan-version.py
new file mode 100755
index 0000000..ac88f3b
--- /dev/null
+++ b/bin/mw-get-phan-version.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+"""
+extract version number out of composer.json
+Copyright (C) 2017 Kunal Mehta <lego...@member.fsf.org>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+import json
+
+with open('composer.json') as f:
+    d = json.load(f)
+
+print(d.get('extra', {}).get('phan-version', 0.8))

-- 
To view, visit https://gerrit.wikimedia.org/r/371095
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9a7b83f3446a339378ff5f7928ca60d6f941bac
Gerrit-PatchSet: 2
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: WMDE-Fisch <christoph.jau...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to