From ff3b8f1f9a2d0d17132f086d2b11a28fcd4e049b Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 17 May 2022 16:05:03 -0400 Subject: [PATCH 1/5] Drop support for Python <3.6 It's time to move on from Python 2 and, with it, Pythons below 3.6. This is the initial work to drop the old Pythons from all our configurations. It would be a good idea to rejigger the tox setup more comprehensively and test on recent Pythons (up to 3.10). --- .github/workflows/build.yml | 8 +------- confuse/__init__.py | 2 +- pyproject.toml | 12 +----------- setup.cfg | 2 +- tox.ini | 9 +++------ 5 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d3b257..07581ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,14 +14,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - tox-env: [py27-test, py35-test, py36-test, + tox-env: [py36-test, py37-test, py38-test, pypy-test] os: [ubuntu-latest, windows-latest] # Only test on a couple of versions on Windows. exclude: - - os: windows-latest - tox-env: py35-test - os: windows-latest tox-env: py36-test - os: windows-latest @@ -31,10 +29,6 @@ jobs: # Python interpreter versions. :/ include: - - tox-env: py27-test - python: 2.7 - - tox-env: py35-test - python: 3.5 - tox-env: py36-test python: 3.6 - tox-env: py37-test diff --git a/confuse/__init__.py b/confuse/__init__.py index be5090c..ffc8f90 100644 --- a/confuse/__init__.py +++ b/confuse/__init__.py @@ -3,7 +3,7 @@ from __future__ import division, absolute_import, print_function -__version__ = '1.7.0' +__version__ = '2.0.0' from .exceptions import * # NOQA from .util import * # NOQA diff --git a/pyproject.toml b/pyproject.toml index 2abd5f0..ab14373 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,23 +11,13 @@ requires = [ "pyyaml" ] description-file = "README.rst" -requires-python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4" +requires-python = ">=3.6, <4" classifiers = [ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', ] - -[tool.flit.metadata.requires-extra] -test = [ - "pathlib; python_version == '2.7'" -] diff --git a/setup.cfg b/setup.cfg index f8f8f37..9350912 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,7 +4,7 @@ logging-clear-handlers=1 eval-attr="!=slow" [flake8] -min-version=2.7 +min-version=3.6 # Default pyflakes errors we ignore: # - E241: missing whitespace after ',' (used to align visually) # - E221: multiple spaces before operator (used to align visually) diff --git a/tox.ini b/tox.ini index 0906920..f5a2ee3 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py{27,34,35,36,37,38}-test, py27-flake8, docs +envlist = py{36,37,38}-test, py38-flake8, docs isolated_build = True [tox:.package] @@ -31,17 +31,14 @@ passenv = NOSE_SHOW_SKIPPED # Undocumented feature of nose-show-skipped. deps = {test,cov}: {[_test]deps} - py{27,34,36}-flake8: {[_flake8]deps} + py{36,37,38}-flake8: {[_flake8]deps} commands = cov: nosetests --with-coverage {posargs} test: nosetests {posargs} - py27-flake8: flake8 --min-version 2.7 {posargs} {[_flake8]files} - py34-flake8: flake8 --min-version 3.4 {posargs} {[_flake8]files} py36-flake8: flake8 --min-version 3.6 {posargs} {[_flake8]files} [testenv:docs] -basepython = python2.7 -deps = +deps = sphinx sphinx-rtd-theme commands = sphinx-build -W -q -b html docs {envtmpdir}/html {posargs} From e8a39aeaf97881c70f439ca24fe796107005876f Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 16 Jul 2022 13:54:44 -0400 Subject: [PATCH 2/5] Try a new, simpler Actions setup --- .github/workflows/build.yml | 79 ++++++++++++++----------------------- 1 file changed, 29 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07581ad..c3d02b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,57 +1,36 @@ name: Build on: - push: - branches: - - master - pull_request: - branches: - - master + push: + branches: + - master + pull_request: + branches: + - master jobs: - test: - name: '${{ matrix.os }}: ${{ matrix.tox-env }}' - runs-on: ${{ matrix.os }} - strategy: - matrix: - tox-env: [py36-test, - py37-test, py38-test, pypy-test] - os: [ubuntu-latest, windows-latest] + test: + name: '${{ matrix.os }}: ${{ matrix.tox-env }}' + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11-dev'] + os: [ubuntu-latest, windows-latest] - # Only test on a couple of versions on Windows. - exclude: - - os: windows-latest - tox-env: py36-test - - os: windows-latest - tox-env: py37-test - - os: windows-latest - tox-env: pypy-test + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Tox + run: pip install tox + - name: Tox + run: tox -e py-test - # Python interpreter versions. :/ - include: - - tox-env: py36-test - python: 3.6 - - tox-env: py37-test - python: 3.7 - - tox-env: py38-test - python: 3.8 - - tox-env: pypy-test - python: pypy3 - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - name: Install Tox - run: pip install tox - - name: Tox - run: tox -e ${{ matrix.tox-env }} - - style: - name: Style - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: TrueBrain/actions-flake8@master + style: + name: Style + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: TrueBrain/actions-flake8@master From 1b1cd00a95f0fe34b230dfd391eb161e662e8784 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 16 Jul 2022 14:04:24 -0400 Subject: [PATCH 3/5] Switch from nose to nose2 --- tox.ini | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tox.ini b/tox.ini index f5a2ee3..e82806c 100644 --- a/tox.ini +++ b/tox.ini @@ -12,9 +12,7 @@ basepython = python3 [_test] deps = - coverage - nose - nose-show-skipped + nose2[coverage_plugin] pyyaml pathlib @@ -27,14 +25,12 @@ deps = files = example confuse test docs [testenv] -passenv = - NOSE_SHOW_SKIPPED # Undocumented feature of nose-show-skipped. deps = {test,cov}: {[_test]deps} py{36,37,38}-flake8: {[_flake8]deps} commands = - cov: nosetests --with-coverage {posargs} - test: nosetests {posargs} + cov: nose2 --with-coverage {posargs} + test: nose2 {posargs} py36-flake8: flake8 --min-version 3.6 {posargs} {[_flake8]files} [testenv:docs] From f08bba6460d00b0858ae8ce8619988235e4c16ed Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 16 Jul 2022 14:05:28 -0400 Subject: [PATCH 4/5] Fix job name --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3d02b7..9c52fd9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: test: - name: '${{ matrix.os }}: ${{ matrix.tox-env }}' + name: '${{ matrix.os }}: ${{ matrix.python-version }}' runs-on: ${{ matrix.os }} strategy: matrix: From c8d769aa2d1f18fea491ab1448a1a5e033824ce2 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 16 Jul 2022 14:09:49 -0400 Subject: [PATCH 5/5] Tolerate kwargs in mocked makedirs --- test/test_paths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_paths.py b/test/test_paths.py index 3cc740d..5333611 100644 --- a/test/test_paths.py +++ b/test/test_paths.py @@ -172,9 +172,9 @@ class PrimaryConfigDirTest(FakeSystem): def join(self, *args): return self.os_path.normpath(self.os_path.join(*args)) - def makedirs(self, path, *args): + def makedirs(self, path, *args, **kwargs): os.path, os_path = self.os_path, os.path - self._makedirs(path, *args) + self._makedirs(path, *args, **kwargs) os.path = os_path def setUp(self):