mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #2528 from johnfraney/fix-failing-ci
Remove Python 3.4
This commit is contained in:
commit
e967988eff
11 changed files with 37 additions and 37 deletions
|
|
@ -5,7 +5,6 @@ env:
|
||||||
- TOX_ENV=docs
|
- TOX_ENV=docs
|
||||||
- TOX_ENV=flake8
|
- TOX_ENV=flake8
|
||||||
- TOX_ENV=py27
|
- TOX_ENV=py27
|
||||||
- TOX_ENV=py34
|
|
||||||
- TOX_ENV=py35
|
- TOX_ENV=py35
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
Installing Pelican
|
Installing Pelican
|
||||||
##################
|
##################
|
||||||
|
|
||||||
Pelican currently runs best on Python 2.7.x and 3.4+; earlier versions of
|
Pelican currently runs best on Python 2.7.x and 3.5+; earlier versions of
|
||||||
Python are not supported.
|
Python are not supported.
|
||||||
|
|
||||||
You can install Pelican via several different methods. The simplest is via
|
You can install Pelican via several different methods. The simplest is via
|
||||||
|
|
|
||||||
|
|
@ -444,8 +444,8 @@ def get_instance(args):
|
||||||
|
|
||||||
config_file = args.settings
|
config_file = args.settings
|
||||||
if config_file is None and os.path.isfile(DEFAULT_CONFIG_NAME):
|
if config_file is None and os.path.isfile(DEFAULT_CONFIG_NAME):
|
||||||
config_file = DEFAULT_CONFIG_NAME
|
config_file = DEFAULT_CONFIG_NAME
|
||||||
args.settings = DEFAULT_CONFIG_NAME
|
args.settings = DEFAULT_CONFIG_NAME
|
||||||
|
|
||||||
settings = read_settings(config_file, override=get_config(args))
|
settings = read_settings(config_file, override=get_config(args))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,7 @@ class HTMLReader(BaseReader):
|
||||||
class _HTMLParser(HTMLParser):
|
class _HTMLParser(HTMLParser):
|
||||||
def __init__(self, settings, filename):
|
def __init__(self, settings, filename):
|
||||||
try:
|
try:
|
||||||
# Python 3.4+
|
# Python 3.5+
|
||||||
HTMLParser.__init__(self, convert_charrefs=False)
|
HTMLParser.__init__(self, convert_charrefs=False)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
HTMLParser.__init__(self)
|
HTMLParser.__init__(self)
|
||||||
|
|
|
||||||
|
|
@ -524,11 +524,11 @@ def configure_settings(settings):
|
||||||
|
|
||||||
# check content caching layer and warn of incompatibilities
|
# check content caching layer and warn of incompatibilities
|
||||||
if settings.get('CACHE_CONTENT', False) and \
|
if settings.get('CACHE_CONTENT', False) and \
|
||||||
settings.get('CONTENT_CACHING_LAYER', '') == 'generator' and \
|
settings.get('CONTENT_CACHING_LAYER', '') == 'generator' and \
|
||||||
settings.get('WITH_FUTURE_DATES', False):
|
settings.get('WITH_FUTURE_DATES', False):
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"WITH_FUTURE_DATES conflicts with CONTENT_CACHING_LAYER "
|
"WITH_FUTURE_DATES conflicts with CONTENT_CACHING_LAYER "
|
||||||
"set to 'generator', use 'reader' layer instead")
|
"set to 'generator', use 'reader' layer instead")
|
||||||
|
|
||||||
# Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined
|
# Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined
|
||||||
feed_keys = [
|
feed_keys = [
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,8 @@ class TestWordpressXmlImporter(unittest.TestCase):
|
||||||
def test_ignore_empty_posts(self):
|
def test_ignore_empty_posts(self):
|
||||||
self.assertTrue(self.posts)
|
self.assertTrue(self.posts)
|
||||||
for (title, content, fname, date, author,
|
for (title, content, fname, date, author,
|
||||||
categ, tags, status, kind, format) in self.posts:
|
categ, tags, status, kind, format) in self.posts:
|
||||||
self.assertTrue(title.strip())
|
self.assertTrue(title.strip())
|
||||||
|
|
||||||
def test_recognise_page_kind(self):
|
def test_recognise_page_kind(self):
|
||||||
""" Check that we recognise pages in wordpress, as opposed to posts """
|
""" Check that we recognise pages in wordpress, as opposed to posts """
|
||||||
|
|
@ -111,9 +111,9 @@ class TestWordpressXmlImporter(unittest.TestCase):
|
||||||
# Collect (title, filename, kind) of non-empty posts recognised as page
|
# Collect (title, filename, kind) of non-empty posts recognised as page
|
||||||
pages_data = []
|
pages_data = []
|
||||||
for (title, content, fname, date, author,
|
for (title, content, fname, date, author,
|
||||||
categ, tags, status, kind, format) in self.posts:
|
categ, tags, status, kind, format) in self.posts:
|
||||||
if kind == 'page':
|
if kind == 'page':
|
||||||
pages_data.append((title, fname))
|
pages_data.append((title, fname))
|
||||||
self.assertEqual(2, len(pages_data))
|
self.assertEqual(2, len(pages_data))
|
||||||
self.assertEqual(('Page', 'contact'), pages_data[0])
|
self.assertEqual(('Page', 'contact'), pages_data[0])
|
||||||
self.assertEqual(('Empty Page', 'empty'), pages_data[1])
|
self.assertEqual(('Empty Page', 'empty'), pages_data[1])
|
||||||
|
|
@ -151,22 +151,22 @@ class TestWordpressXmlImporter(unittest.TestCase):
|
||||||
self.assertTrue(self.posts)
|
self.assertTrue(self.posts)
|
||||||
pages_data = []
|
pages_data = []
|
||||||
for (title, content, fname, date, author, categ,
|
for (title, content, fname, date, author, categ,
|
||||||
tags, status, kind, format) in self.posts:
|
tags, status, kind, format) in self.posts:
|
||||||
if kind == 'page' or kind == 'article':
|
if kind == 'page' or kind == 'article':
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
pages_data.append((title, fname))
|
pages_data.append((title, fname))
|
||||||
self.assertEqual(0, len(pages_data))
|
self.assertEqual(0, len(pages_data))
|
||||||
|
|
||||||
def test_recognise_custom_post_type(self):
|
def test_recognise_custom_post_type(self):
|
||||||
self.assertTrue(self.custposts)
|
self.assertTrue(self.custposts)
|
||||||
cust_data = []
|
cust_data = []
|
||||||
for (title, content, fname, date, author, categ,
|
for (title, content, fname, date, author, categ,
|
||||||
tags, status, kind, format) in self.custposts:
|
tags, status, kind, format) in self.custposts:
|
||||||
if kind == 'article' or kind == 'page':
|
if kind == 'article' or kind == 'page':
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
cust_data.append((title, kind))
|
cust_data.append((title, kind))
|
||||||
self.assertEqual(3, len(cust_data))
|
self.assertEqual(3, len(cust_data))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
('A custom post in category 4', 'custom1'),
|
('A custom post in category 4', 'custom1'),
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ from pelican.settings import read_settings
|
||||||
from pelican.utils import SafeDatetime, slugify
|
from pelican.utils import SafeDatetime, slugify
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from html import unescape # py3.4+
|
from html import unescape # py3.5+
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from six.moves.html_parser import HTMLParser
|
from six.moves.html_parser import HTMLParser
|
||||||
unescape = HTMLParser().unescape
|
unescape = HTMLParser().unescape
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,9 @@ def main():
|
||||||
to_sym = args.to_symlink or args.clean
|
to_sym = args.to_symlink or args.clean
|
||||||
|
|
||||||
if args.action:
|
if args.action:
|
||||||
if args.action is 'list':
|
if args.action == 'list':
|
||||||
list_themes(args.verbose)
|
list_themes(args.verbose)
|
||||||
elif args.action is 'path':
|
elif args.action == 'path':
|
||||||
print(_THEMES_PATH)
|
print(_THEMES_PATH)
|
||||||
elif to_install or args.to_remove or to_sym:
|
elif to_install or args.to_remove or to_sym:
|
||||||
if args.to_remove:
|
if args.to_remove:
|
||||||
|
|
|
||||||
|
|
@ -787,12 +787,15 @@ def folder_watcher(path, extensions, ignores=[]):
|
||||||
dirs[:] = [x for x in dirs if not x.startswith(os.curdir)]
|
dirs[:] = [x for x in dirs if not x.startswith(os.curdir)]
|
||||||
|
|
||||||
for f in files:
|
for f in files:
|
||||||
if f.endswith(tuple(extensions)) and \
|
valid_extension = f.endswith(tuple(extensions))
|
||||||
not any(fnmatch.fnmatch(f, ignore) for ignore in ignores):
|
file_ignored = any(
|
||||||
try:
|
fnmatch.fnmatch(f, ignore) for ignore in ignores
|
||||||
yield os.stat(os.path.join(root, f)).st_mtime
|
)
|
||||||
except OSError as e:
|
if valid_extension and not file_ignored:
|
||||||
logger.warning('Caught Exception: %s', e)
|
try:
|
||||||
|
yield os.stat(os.path.join(root, f)).st_mtime
|
||||||
|
except OSError as e:
|
||||||
|
logger.warning('Caught Exception: %s', e)
|
||||||
|
|
||||||
LAST_MTIME = 0
|
LAST_MTIME = 0
|
||||||
while True:
|
while True:
|
||||||
|
|
|
||||||
1
setup.py
1
setup.py
|
|
@ -62,7 +62,6 @@ setup(
|
||||||
'Programming Language :: Python :: 2',
|
'Programming Language :: Python :: 2',
|
||||||
'Programming Language :: Python :: 2.7',
|
'Programming Language :: Python :: 2.7',
|
||||||
'Programming Language :: Python :: 3',
|
'Programming Language :: Python :: 3',
|
||||||
'Programming Language :: Python :: 3.4',
|
|
||||||
'Programming Language :: Python :: 3.5',
|
'Programming Language :: Python :: 3.5',
|
||||||
'Programming Language :: Python :: 3.6',
|
'Programming Language :: Python :: 3.6',
|
||||||
'Programming Language :: Python :: 3.7',
|
'Programming Language :: Python :: 3.7',
|
||||||
|
|
|
||||||
3
tox.ini
3
tox.ini
|
|
@ -1,10 +1,9 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py{27,34,35,36,37},docs,flake8
|
envlist = py{27,35,36,37},docs,flake8
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
basepython =
|
basepython =
|
||||||
py27: python2.7
|
py27: python2.7
|
||||||
py34: python3.4
|
|
||||||
py35: python3.5
|
py35: python3.5
|
||||||
py36: python3.6
|
py36: python3.6
|
||||||
py37: python3.7
|
py37: python3.7
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue