1
0
Fork 0
forked from github/pelican

Merge pull request #3055 from avaris/python-3.11

This commit is contained in:
Justin Mayer 2022-10-26 11:12:53 -10:00 committed by GitHub
commit f015ab89d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 49 deletions

View file

@ -23,6 +23,8 @@ jobs:
python: "3.9" python: "3.9"
- os: ubuntu - os: ubuntu
python: "3.10" python: "3.10"
- os: ubuntu
python: "3.11"
- os: macos - os: macos
python: "3.7" python: "3.7"
- os: windows - os: windows
@ -34,30 +36,8 @@ jobs:
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.config.python }} python-version: ${{ matrix.config.python }}
- name: Set up Pip cache (Linux) cache: 'pip'
uses: actions/cache@v3 cache-dependency-path: '**/requirements/*'
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/*') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Pip cache (macOS)
uses: actions/cache@v3
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/*') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup pip cache (Windows)
uses: actions/cache@v3
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/*') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install locale (Linux) - name: Install locale (Linux)
if: startsWith(runner.os, 'Linux') if: startsWith(runner.os, 'Linux')
run: sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8 run: sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8
@ -87,14 +67,8 @@ jobs:
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: "3.9" python-version: "3.9"
- name: Set pip cache (Linux) cache: 'pip'
uses: actions/cache@v3 cache-dependency-path: '**/requirements/*'
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install tox - name: Install tox
run: python -m pip install -U pip tox run: python -m pip install -U pip tox
- name: Check - name: Check
@ -111,14 +85,8 @@ jobs:
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: "3.9" python-version: "3.9"
- name: Set pip cache (Linux) cache: 'pip'
uses: actions/cache@v3 cache-dependency-path: '**/requirements/*'
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install tox - name: Install tox
run: python -m pip install -U pip tox run: python -m pip install -U pip tox
- name: Check - name: Check

View file

@ -2,7 +2,6 @@ import copy
import locale import locale
import os import os
from os.path import abspath, dirname, join from os.path import abspath, dirname, join
from sys import platform
from pelican.settings import (DEFAULT_CONFIG, DEFAULT_THEME, from pelican.settings import (DEFAULT_CONFIG, DEFAULT_THEME,
@ -136,18 +135,19 @@ class TestSettingsConfiguration(unittest.TestCase):
settings['ARTICLE_DIR'] settings['ARTICLE_DIR']
settings['PAGE_DIR'] settings['PAGE_DIR']
# locale.getdefaultlocale() is broken on Windows
# See: https://bugs.python.org/issue37945
@unittest.skipIf(platform == 'win32', "Doesn't work on Windows")
def test_default_encoding(self): def test_default_encoding(self):
# Test that the default locale is set if not specified in settings # Test that the user locale is set if not specified in settings
# Reset locale to Python's default locale
locale.setlocale(locale.LC_ALL, 'C') locale.setlocale(locale.LC_ALL, 'C')
self.assertEqual(self.settings['LOCALE'], DEFAULT_CONFIG['LOCALE']) # empty string = user system locale
self.assertEqual(self.settings['LOCALE'], [''])
configure_settings(self.settings) configure_settings(self.settings)
self.assertEqual(locale.getlocale(), locale.getdefaultlocale()) lc_time = locale.getlocale(locale.LC_TIME) # should be set to user locale
# explicitly set locale to user pref and test
locale.setlocale(locale.LC_TIME, '')
self.assertEqual(lc_time, locale.getlocale(locale.LC_TIME))
def test_invalid_settings_throw_exception(self): def test_invalid_settings_throw_exception(self):
# Test that the path name is valid # Test that the path name is valid

View file

@ -1,5 +1,5 @@
[tox] [tox]
envlist = py{3.7,3.8,3.9,3.10},docs,flake8 envlist = py{3.7,3.8,3.9,3.10,3.11},docs,flake8
[testenv] [testenv]
basepython = basepython =
@ -7,6 +7,7 @@ basepython =
py3.8: python3.8 py3.8: python3.8
py3.9: python3.9 py3.9: python3.9
py3.10: python3.10 py3.10: python3.10
py3.11: python3.11
passenv = * passenv = *
usedevelop=True usedevelop=True
deps = deps =