jenkins-bot has submitted this change and it was merged.
Change subject: [IMPR] Do not create a folder for reading operation
......................................................................
[IMPR] Do not create a folder for reading operation
Assinging a file path to the filename creates the folder but this is
superfluous because reading from empty folder results in IOError which
also passes the constructor. The folder should be created by writing
the file only which is done in PrimaryIgnoreManager.ignore method.
Change-Id: Ibc46093fd060fd9dd2466df7d3394b5bc4df82f9
---
M scripts/solve_disambiguation.py
1 file changed, 10 insertions(+), 4 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 0e108c5..7a032fe 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -82,6 +82,7 @@
import codecs
import itertools
+import os
import re
import pywikibot
@@ -408,11 +409,16 @@
def __init__(self, disambPage, enabled=False):
self.disambPage = disambPage
self.enabled = enabled
-
self.ignorelist = []
- filename = config.datafilepath(
- 'disambiguations',
- self.disambPage.title(as_filename=True) + '.txt')
+
+ folder = config.datafilepath('disambiguations')
+ if os.path.exists(folder):
+ self._read_ignorelist(folder)
+
+ def _read_ignorelist(self, folder):
+ """Read pages to be ignored from file."""
+ filename = os.path.join(
+ folder, self.disambPage.title(as_filename=True) + '.txt')
try:
# The file is stored in the disambiguation/ subdir.
# Create if necessary.
--
To view, visit https://gerrit.wikimedia.org/r/223335
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc46093fd060fd9dd2466df7d3394b5bc4df82f9
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2525
Status: Fixed
Duration: 15 minutes and 3 seconds
Commit: 0222b40 (master)
Author: John Vandenberg
Message: Sync requirements.txt with setup.py
Use the environment markers introduced in pip 6.0
to prevent installation of unnecessary or broken packages
based on the Python version.
Use travis default 'install' step which processes
requirements.txt. For PYSETUP_TEST_EXTRAS=1 builds
remove the requirements.txt so tests activated by
existing extras are skipped.
Flag pYsearch as an external unverified package.
Use git repo for pydot fork which supports Python 3.
mwlib is not included, as it is incompatible with
other dependencies.
Also create dev-requirements.txt for dev/test dependencies,
and use this in .travis.yml and .appveyor.yml
pywin32 and pywinauto are not included as they do not
have any effect on the Appveyor builds.
This allows the time installing dependencies to be reported
as opposed to it being included in the setup.py test duration.
Change-Id: I6c19152c544a38c21c79d9311fbfbd211c5a4b43
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/6e752a85b86e...0222b409…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/70539255
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: Sync requirements.txt with setup.py
......................................................................
Sync requirements.txt with setup.py
Use the environment markers introduced in pip 6.0
to prevent installation of unnecessary or broken packages
based on the Python version.
Use travis default 'install' step which processes
requirements.txt. For PYSETUP_TEST_EXTRAS=1 builds
remove the requirements.txt so tests activated by
existing extras are skipped.
Flag pYsearch as an external unverified package.
Use git repo for pydot fork which supports Python 3.
mwlib is not included, as it is incompatible with
other dependencies.
Also create dev-requirements.txt for dev/test dependencies,
and use this in .travis.yml and .appveyor.yml
pywin32 and pywinauto are not included as they do not
have any effect on the Appveyor builds.
This allows the time installing dependencies to be reported
as opposed to it being included in the setup.py test duration.
Change-Id: I6c19152c544a38c21c79d9311fbfbd211c5a4b43
---
M .appveyor.yml
M .travis.yml
A dev-requirements.txt
M requirements.txt
4 files changed, 53 insertions(+), 17 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.appveyor.yml b/.appveyor.yml
index 18c93b7..acd7c07 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -81,7 +81,7 @@
# This is needed for Python versions not installed on Appveyor build machines
- ps: if (-not(Test-Path($env:PYTHON))) { iex $wc.DownloadString($env:APPVEYOR_PYTHON_URL + 'install.ps1') }
- - pip install unittest2==0.8
+ - pip install -r dev-requirements.txt
- pip install requests
build: off
diff --git a/.travis.yml b/.travis.yml
index 12117f1..f6a5a3a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,21 +21,30 @@
- graphviz
- liblua5.1-0-dev
-install:
+before_install:
+ # When PYSETUP_TEST_EXTRAS is not enabled, do not allow the
+ # default 'install' step to install all dependencies listed in
+ # requirements.txt to verify that a minimal install works as expected.
+ # Instead install requests in the before_script step below.
+ - if [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then rm requirements.txt ; fi
+
- if [[ "$SITE_ONLY" == '1' ]]; then export USE_NOSE=1; fi
- - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2==0.8.0; fi
- - pip install six
- export GITHUB_USER=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 1`
- mkdir ~/.python-eggs
- chmod 700 ~/.python-eggs
-
- - pip install requests
- if [[ "$GITHUB_USER" != "wikimedia" ]]; then
export PYWIKIBOT2_TEST_WRITE_FAIL=1 ;
fi
+before_script:
+ - pip install -r dev-requirements.txt
+
+script:
+ - if [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then pip install requests ; fi
+
- mkdir ~/.pywikibot
+
- python pwb.py generate_family_file 'http://test.orain.org/' oraintest
- python -W error::UserWarning -m generate_user_files -dir:~/.pywikibot/ -family:$FAMILY -lang:$LANGUAGE -v -user:"$PYWIKIBOT2_USERNAME"
@@ -55,7 +64,6 @@
- python -c "import setuptools; print(setuptools.__version__)"
-script:
- if [[ "$USE_NOSE" == "1" ]]; then
if [[ "$SITE_ONLY" == "1" ]]; then
echo "Running site tests only code ${LANGUAGE} on family ${FAMILY}" ;
diff --git a/dev-requirements.txt b/dev-requirements.txt
new file mode 100644
index 0000000..ee37c1b
--- /dev/null
+++ b/dev-requirements.txt
@@ -0,0 +1,13 @@
+# This is a PIP 6+ requirements file for development dependencies
+#
+unittest2==0.8.0 ; python_version < '2.7'
+
+six
+
+nose
+
+# pywin32 & pywinauto>=0.4.0 are Win32 UI test dependencies that have been
+# excluded from this file as they are quite expensive to install, and they
+# are not useful on the Appveyor Win32 builds since the relevant UI tests
+# also require accessing the menu of the console window, which doesnt exist
+# in the Appveyor environment.
diff --git a/requirements.txt b/requirements.txt
index 9362c5f..e697427 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-# This is a PIP requirements file
+# This is a PIP 6+ requirements file for using Pywikibot and scripts
#
# All dependencies can be installed using:
# $ sudo pip install -r requirements.txt
@@ -21,18 +21,31 @@
# mandatory; see README.conversion.txt
requests
+future ; python_version < '2.7'
# core interwiki_graph.py:
-pydot
+git+https://github.com/nlhepler/pydot#egg=pydot-1.0.29
+
+# wikistats.py and scripts
+unicodecsv ; python_version < '3'
+
+# cosmetic_changes and scripts/isbn
+python-stdnum
+
+# GUI
+Pillow
# core pagegenerators
-pYsearch
+--allow-external pYsearch
+--allow-unverified pYsearch
+pYsearch ; python_version < '3'
google >= 1.7
+socketIO-client<0.6.1
# scripts/script_wui.py:
crontab
-# scipts/replicate_wiki.py
-argparse
+# scipts/replicate_wiki.py and scripts/editarticle.py
+argparse ; python_version < '2.7'
# scripts/flickrripper.py
# On Python 2, flickrapi 1.4.x or 2.x may be used. Only 2.x works on Python 3.
@@ -41,21 +54,23 @@
# pkg_resources.VersionConflict: (requests 1.2.3 (/usr/lib/python2.7/site-packages), Requirement.parse('requests>=2.2.1'))
# If you see that on Python 2, change this to flickrapi==1.4.5
# On Python 3, force pip to install requests 2.2.1, or remove flickrapi below.
-Pillow
flickrapi
# incomplete core component botirc
-irc
+irc ; python_version > '2.6'
# textlib.py
-mwparserfromhell>=0.3.3
+mwparserfromhell>=0.3.3 ; python_version <= '3.4'
# The mysql generator in pagegenerators depends on either oursql or MySQLdb
-# pywikibot prefers oursql
-oursql
+# pywikibot prefers oursql. Both are Python 2 only; T89976.
+oursql ; python_version < '3'
# scripts/script_wui.py depends on Lua, which is not available using pip
# but can be obtained from: https://github.com/bastibe/lunatic-python
# core HTML comparison parser in diff module
beautifulsoup4
+
+# scripts/states_redirect.py
+pycountry
--
To view, visit https://gerrit.wikimedia.org/r/224101
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6c19152c544a38c21c79d9311fbfbd211c5a4b43
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2524
Status: Broken
Duration: 23 minutes and 54 seconds
Commit: 6e752a8 (master)
Author: John Vandenberg
Message: Update test copyright years
Use copyright start year from first test contributed
to compat, and end year of 2015 where substantive change
made this year.
Also update docstring for tools_ip_tests to be more generic.
Change-Id: I5b2be85c9355e7d59772ce68aa60e5f0afc4b58d
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/7034ed14265a...6e752a85…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/70510064
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: Update test copyright years
......................................................................
Update test copyright years
Use copyright start year from first test contributed
to compat, and end year of 2015 where substantive change
made this year.
Also update docstring for tools_ip_tests to be more generic.
Change-Id: I5b2be85c9355e7d59772ce68aa60e5f0afc4b58d
---
M tests/category_tests.py
M tests/data_ingestion_tests.py
M tests/date_tests.py
M tests/pagegenerators_tests.py
M tests/textlib_tests.py
M tests/tools_ip_tests.py
M tests/xmlreader_tests.py
7 files changed, 12 insertions(+), 7 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/category_tests.py b/tests/category_tests.py
index df7fc19..4321d8b 100644
--- a/tests/category_tests.py
+++ b/tests/category_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests for the Category class."""
#
-# (C) Pywikibot team, 2008-2014
+# (C) Pywikibot team, 2014-2015
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/data_ingestion_tests.py b/tests/data_ingestion_tests.py
index 0b195fa..8c131ab 100644
--- a/tests/data_ingestion_tests.py
+++ b/tests/data_ingestion_tests.py
@@ -1,6 +1,11 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Unit tests for data_ingestion.py script."""
+#
+# (C) Pywikibot team, 2012-2015
+#
+# Distributed under the terms of the MIT license.
+#
from __future__ import unicode_literals
__version__ = '$Id$'
diff --git a/tests/date_tests.py b/tests/date_tests.py
index 526b358..c9560ee 100644
--- a/tests/date_tests.py
+++ b/tests/date_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests for the date module."""
#
-# (C) Pywikibot team, 2014
+# (C) Pywikibot team, 2012-2015
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 5411b9c..4211188 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""Test pagegenerators module."""
#
-# (C) Pywikibot team, 2014-2015
+# (C) Pywikibot team, 2009-2015
#
# Distributed under the terms of the MIT license.
from __future__ import unicode_literals
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 29d2741..dda81dc 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Test textlib module."""
#
-# (C) Pywikibot team, 2007-2015
+# (C) Pywikibot team, 2011-2015
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/tools_ip_tests.py b/tests/tools_ip_tests.py
index 6cc65d2..4bfd507 100644
--- a/tests/tools_ip_tests.py
+++ b/tests/tools_ip_tests.py
@@ -1,8 +1,8 @@
#!/usr/bin/python
-"""Test IP regex."""
+"""Test IP module/regex."""
# -*- coding: utf-8 -*-
#
-# (C) Pywikibot team, 2015
+# (C) Pywikibot team, 2012-2015
#
# Distributed under the terms of the MIT license.
from __future__ import unicode_literals
diff --git a/tests/xmlreader_tests.py b/tests/xmlreader_tests.py
index bee3cb5..de2e86c 100644
--- a/tests/xmlreader_tests.py
+++ b/tests/xmlreader_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests for xmlreader module."""
#
-# (C) Pywikibot team, 2014
+# (C) Pywikibot team, 2009-2014
#
# Distributed under the terms of the MIT license.
#
--
To view, visit https://gerrit.wikimedia.org/r/224059
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5b2be85c9355e7d59772ce68aa60e5f0afc4b58d
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>