Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-ini2toml for openSUSE:Factory checked in at 2023-05-19 11:55:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ini2toml (Old) and /work/SRC/openSUSE:Factory/.python-ini2toml.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ini2toml" Fri May 19 11:55:20 2023 rev:6 rq:1087243 version:0.12 Changes: -------- --- /work/SRC/openSUSE:Factory/python-ini2toml/python-ini2toml.changes 2023-04-23 22:44:32.937723363 +0200 +++ /work/SRC/openSUSE:Factory/.python-ini2toml.new.1533/python-ini2toml.changes 2023-05-19 11:55:51.827380722 +0200 @@ -1,0 +2,9 @@ +Fri May 5 00:13:56 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 0.12: + * Fix logging in case of early errors while loading plugins, + * Log warning if ``flake8`` and ``devpi`` sections are + translation, prompting the user to review the output + * Fix parsing of ``filterwarnings`` + +------------------------------------------------------------------- Old: ---- ini2toml-0.11.3.tar.gz New: ---- ini2toml-0.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ini2toml.spec ++++++ --- /var/tmp/diff_new_pack.SRbkWv/_old 2023-05-19 11:55:52.371383832 +0200 +++ /var/tmp/diff_new_pack.SRbkWv/_new 2023-05-19 11:55:52.375383855 +0200 @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # + %{?sle15_python_module_pythons} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" @@ -48,8 +49,9 @@ %bcond_with experimental %define skip_python2 1 +%{?sle15_python_module_pythons} Name: python-ini2toml%{psuffix} -Version: 0.11.3 +Version: 0.12 Release: 0 Summary: Automatic conversion of .ini/cfg files to TOML equivalents License: MPL-2.0 @@ -62,6 +64,7 @@ Requires(post): update-alternatives Requires(postun):update-alternatives %if %{with test} +BuildRequires: %{python_module ConfigUpdater} BuildRequires: %{python_module packaging >= 20.7} BuildRequires: %{python_module pytest} BuildRequires: %{python_module validate-pyproject >= 0.6 with %python-validate-pyproject < 2} ++++++ ini2toml-0.11.3.tar.gz -> ini2toml-0.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/.cirrus.yml new/ini2toml-0.12/.cirrus.yml --- old/ini2toml-0.11.3/.cirrus.yml 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/.cirrus.yml 2023-03-17 19:29:02.000000000 +0100 @@ -1,47 +1,51 @@ -# Cirrus CI configuration file using the matrix feature -# Read more under https://cirrus-ci.org/guide/writing-tasks/ -# THIS FILE IS SUPPOSED TO BE AN EXAMPLE. MODIFY IT ACCORDING TO YOUR NEEDS! --- -# Default values to be merged into tasks: -auto_cancellation: false +# ---- Default values to be merged into tasks ---- + env: - PATH: ${HOME}/.local/bin:${PATH} - # ^ add user paths - # COVERALLS_REPO_TOKEN: ENCRYPTED[] - # ^ You can add an encrypted token or use CirrusCI web interface to set the variable - # See discussion in: https://github.com/cirruslabs/cirrus-ci-docs/discussions/866 - TYPE_CHECKING: true # Enable/disable type checking - PIP_CACHE: ${HOME}/.cache/pip LC_ALL: C.UTF-8 LANG: C.UTF-8 - COVERAGE: NO + PIP_CACHE_DIR: ${CIRRUS_WORKING_DIR}/.cache/pip + PRE_COMMIT_HOME: ${CIRRUS_WORKING_DIR}/.cache/pre-commit + # Coveralls configuration CI_NAME: cirrus-ci CI_BRANCH: ${CIRRUS_BRANCH} CI_PULL_REQUEST: ${CIRRUS_PR} CI_BUILD_NUMBER: ${CIRRUS_BUILD_ID} CI_BUILD_URL: https://cirrus-ci.com/build/${CIRRUS_BUILD_ID} + COVERALLS_PARALLEL: "true" + COVERALLS_FLAG_NAME: ${CIRRUS_TASK_NAME} +# ---- Templates ---- -# This template is used in most of the tasks -.regular_task_template: ®ULAR_TASK_TEMPLATE - pip_cache: &pip-cache - folder: $PIP_CACHE - tox_install_script: - - python -m pip install --upgrade pip setuptools tox - prepare_script: &prepare - # This script is also used in Windows, so the shell is not POSIX +.task_template: &task-template + debug_information_script: + - echo "$(which python) -- $(python -VV)" + - echo "$(which pip) -- $(pip -VV)" + - python -c 'import os, sys; print(os.name, sys.platform, getattr(sys, "abiflags", None))' + prepare_script: # avoid git failing with setuptools-scm - git config --global user.email "y...@example.com" - git config --global user.name "Your Name" - clean_workspace_script: - # Avoid information carried from one run to the other - - rm -rf .coverage junit-*.xml .tox - # The following scripts are also used in Windows, be aware the shell is not POSIX - build_script: &build - - python -m tox -e build # Ensure PEP517-style build works - test_script: &test - - python -m tox -- -rfEx --durations 10 --color yes - # ^ tox is better if invoked as a module on Windows/OSX - + pip_cache: + folder: "${CIRRUS_WORKING_DIR}/.cache/pip" + fingerprint_script: echo "${CIRRUS_OS}-${CIRRUS_TASK_NAME}" + reupload_on_changes: true + pre_commit_cache: + folder: "${CIRRUS_WORKING_DIR}/.cache/pre-commit" + fingerprint_script: echo "${CIRRUS_OS}-${CIRRUS_TASK_NAME}" | cat - .pre-commit-config.yaml + reupload_on_changes: true + +.test_template: &test-template + # Requires pip, tox, and pipx to be installed via OS/pip + alias: test + depends_on: [build] + <<: *task-template + dist_cache: {folder: dist, fingerprint_script: echo $CIRRUS_BUILD_ID} # download + test_script: > + tox --installpkg dist/*.whl -- + -n 5 --randomly-seed=42 -rfEx --durations 10 --color yes + submit_coverage_script: + - pipx run coverage xml -o coverage.xml + - pipx run coveralls --submit coverage.xml # Deep clone script for POSIX environments (required for setuptools-scm) .clone_script: &clone | @@ -54,27 +58,32 @@ git reset --hard $CIRRUS_CHANGE_IN_REPO fi +# ---- CI Pipeline ---- -# ---- Task definitions ---- - -typecheck_task: - name: typecheck (Linux - 3.10) - only_if: $TYPE_CHECKING == 'true' +build_task: + name: build (Linux - 3.10) + alias: build + container: {image: "python:3.10-bullseye"} clone_script: *clone - container: {image: "python:3.10-bullseye"} # most recent => better type support - pip_cache: *pip-cache - mypy_cache: - folder: .mypy_cache - tox_install_script: - - python -m pip install --upgrade pip setuptools tox - prepare_script: *prepare - typecheck_script: - - python -m tox -e typecheck - + dist_cache: # build once and upload to be used by other tasks + folder: dist + fingerprint_script: echo $CIRRUS_BUILD_ID + reupload_on_changes: true + <<: *task-template + install_script: pip install tox + build_script: tox -e clean,build + +check_task: + name: check (Linux - 3.11) + alias: check + depends_on: [build] + container: {image: "python:3.11-bullseye"} # most recent => better types + dist_cache: {folder: dist, fingerprint_script: echo $CIRRUS_BUILD_ID} # download + <<: *task-template + install_script: pip install tox + check_script: tox --installpkg dist/*.whl -e lint,typecheck -linux_mac_task: - # Use custom cloning since otherwise git tags are missing - clone_script: *clone +linux_task: matrix: - name: test (Linux - 3.6) container: {image: "python:3.6-bullseye"} @@ -88,133 +97,88 @@ - name: test (Linux - 3.10) container: {image: "python:3.10-bullseye"} - name: test (Linux - 3.11) - container: {image: "python:3.11-rc-bullseye"} + container: {image: "python:3.11-bullseye"} + - name: test (Linux - 3.12) + container: {image: "python:3.12-rc-bullseye"} allow_failures: true # Experimental - - name: test (Linux - Anaconda) - container: {image: "continuumio/anaconda3:2021.11"} - extra_install_script: - - conda install -y -c conda-forge virtualenv build setuptools setuptools-scm pip tox - - name: test (OS X) - macos_instance: {image: "big-sur-xcode"} - env: - PYTHON_VERSION: 3.9 - # ^ update when the default version of python in homebrew changes - PATH: "${HOME}/.local/bin:${HOME}/Library/Python/${PYTHON_VERSION}/bin:/usr/local/opt/python/libexec/bin:${PATH}" - # ^ add user and homebrew paths - PIP_CACHE: "${HOME}/Library/Caches/pip" - brew_cache: - folder: "$HOME/Library/Caches/Homebrew" - install_script: - - brew install python - - brew cleanup - <<: *REGULAR_TASK_TEMPLATE + install_script: + - python -m pip install --upgrade pip tox pipx + <<: *test-template +mamba_task: + name: test (Linux - mambaforge) + container: {image: "condaforge/mambaforge"} + install_script: # Overwrite template + - mamba install -y pip tox pipx + <<: *test-template + +macos_task: + name: test (macOS - brew) + macos_instance: + image: ghcr.io/cirruslabs/macos-monterey-xcode + brew_cache: {folder: "$HOME/Library/Caches/Homebrew"} + install_script: brew install python tox pipx + env: + PATH: "/opt/homebrew/opt/python/libexec/bin:${PATH}" + <<: *test-template + +freebsd_task: + name: test (freebsd - 3.9) + freebsd_instance: {image_family: freebsd-13-1} + install_script: + - pkg remove -y python lang/python + - pkg install -y git python39 py39-pip py39-gdbm py39-sqlite3 py39-tox py39-pipx py39-tomli + - ln -s /usr/local/bin/python3.9 /usr/local/bin/python + <<: *test-template -# If you find some problems with long paths on Windows, -# please check the .cirrus.yml file of PyScaffold itself for some workarounds. windows_task: - name: test (Windows) - tools_cache: - folder: 'C:\tools' - fingerprint_script: - - ps: echo "$env:CIRRUS_OS - nuget v6.0.0 - git 2.34.1" - populate_script: - - ps: (mkdir 'C:\tools') - # ^ use parentheses to suppress errors - - ps: Invoke-WebRequest -OutFile 'C:\tools\nuget.exe' 'https://dist.nuget.org/win-x86-commandline/v6.0.0/nuget.exe' - - ps: nuget install GitForWindows -Version 2.34.1 -NonInteractive -OutputDirectory C:\tools - workaround_git_script: - - git config --system core.longpaths true # Fix for windows git checkout problems - clone_script: - # Use custom cloning since otherwise git tags are missing - CMD.exe /C ECHO ON & - IF NOT DEFINED CIRRUS_PR ( - git clone --recursive --branch=%CIRRUS_BRANCH% https://x-access-token:%cirrus_repo_clone_tok...@github.com/%CIRRUS_REPO_FULL_NAME%.git %CIRRUS_WORKING_DIR% & - git reset --hard %CIRRUS_CHANGE_IN_REPO% - ) ELSE ( - git clone --recursive https://x-access-token:%cirrus_repo_clone_tok...@github.com/%CIRRUS_REPO_FULL_NAME%.git %CIRRUS_WORKING_DIR% & - git fetch origin pull/%CIRRUS_PR%/head:pull/%CIRRUS_PR% & - git reset --hard %CIRRUS_CHANGE_IN_REPO% - ) + name: test (Windows - 3.9.10) windows_container: - image: "python:3.8-windowsservercore" + image: "cirrusci/windowsservercore:2019" os_version: 2019 env: - # Single quotes are used bellow to escape Windows backslash and % (YAML restrictions). - PYTHON_HOME: 'C:\Python' - PYTHON_APPDATA: '%APPDATA%\Python\Python38' - # ^ update when python version changes - GIT_HOME: 'C:\tools\GitForWindows.2.34.1\tools' - # ^ update when git version changes - HOME: '%USERPROFILE%' - USERNAME: ContainerAdministrator - # ^ ensure USERNAME is set in Windows, so the getpass module doesn't raise exceptions - PATH: '%HOME%\.local\bin\;%PYTHON_APPDATA%\Scripts\;%PYTHON_HOME%\;%PYTHON_HOME%\Scripts\;C:\tools\;%GIT_HOME%\cmd\;%PATH%' - # ^ add user paths (if POSIX tools are needed you can try also adding %GIT_HOME\usr\bin\) - PIP_CACHE: '%LocalAppData%\pip\Cache' - PIP_TRUSTED_HOST: 'pypi.org pypi.python.org files.pythonhosted.org' - PIP_CONFIG_FILE: '%AppData%\pip\pip.ini' - COVERAGE: 'NO' - pip_cache: - folder: '%PIP_CACHE%' + CIRRUS_SHELL: bash + PATH: /c/Python39:/c/Python39/Scripts:/c/tools:${PATH} install_script: # Activate long file paths to avoid some errors - - REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f - # Set Windows encoding to UTF-8 - - REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v Autorun /t REG_SZ /d "@chcp 65001>nul" /f - - python -m ensurepip - - python -m pip install --upgrade --user pip setuptools certifi tox - prepare_script: *prepare - clean_workspace_script: - # Avoid information carried from one run to the other - # CMD is not capable of globbing, so we have to use PowerShell - - ps: (rm -Recurse -Force -ErrorAction SilentlyContinue .tox,junit-*.xml) - build_script: *build - test_script: *test - - -coverage_task: - name: coverage (Linux - 3.8) - clone_script: *clone - container: {image: "python:3.8-bullseye"} - env: - COVERAGE: yes - PRE_COMMIT_HOME: ${HOME}/.cache/pre-commit - depends_on: - - test (Linux - 3.7) - - test (Linux - 3.8) - - test (Linux - 3.9) - - test (Linux - 3.10) - - test (Linux - Anaconda) - - test (OS X) - pip_install_script: - pip install --user --upgrade coverage coveralls pre-commit - precommit_script: - - pre-commit install - - pre-commit run --all-files - <<: *REGULAR_TASK_TEMPLATE - coverage_script: - - coveralls - pre_commit_cache: &pre-commit-cache - folder: $PRE_COMMIT_HOME - fingerprint_script: - - echo $CIRRUS_OS - - python --version - - pre-commit --version - - cat .pre-commit-config.yaml - + - ps: New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force + - choco install -y --no-progress python3 --version=3.9.10 --params "/NoLockdown" + - pip install --upgrade certifi + - python -m pip install -U pip tox pipx + <<: *test-template + +finalize_task: + container: {image: "python:3.10-bullseye"} + depends_on: [test] + <<: *task-template + install_script: pip install coveralls + finalize_coverage_script: coveralls --finish linkcheck_task: - name: linkcheck (Linux - 3.9) - # only_if: $CIRRUS_BRANCH == 'master' + name: linkcheck (Linux - 3.10) + container: {image: "python:3.10-bullseye"} + depends_on: [finalize] allow_failures: true - clone_script: *clone - container: {image: "python:3.9-bullseye"} - depends_on: - - test (Linux - 3.9) - pip_cache: *pip-cache - tox_install_script: - - python -m pip install --upgrade pip setuptools tox - prepare_script: *prepare - linkcheck_script: - - python -m tox -e linkcheck -- -q + dist_cache: {folder: dist, fingerprint_script: echo $CIRRUS_BUILD_ID} # download + <<: *task-template + install_script: pip install tox + linkcheck_script: tox --installpkg dist/*.whl -e linkcheck -- -q + +# # The following task is already covered by a GitHub Action, +# # (commented to avoid errors when publishing duplicated packages to PyPI) +# publish_task: +# name: publish (Linux - 3.10) +# container: {image: "python:3.10-bullseye"} +# depends_on: [check, build, test] +# only_if: $CIRRUS_TAG =~ 'v\d.*' && $CIRRUS_USER_PERMISSION == "admin" +# <<: *task-template +# dist_cache: {folder: dist, fingerprint_script: echo $CIRRUS_BUILD_ID} # download +# env: +# TWINE_REPOSITORY: pypi +# TWINE_USERNAME: __token__ +# TWINE_PASSWORD: $PYPI_TOKEN +# # See: https://cirrus-ci.org/guide/writing-tasks/#encrypted-variables +# install_script: pip install tox +# publish_script: +# - ls dist/* +# - tox -e publish diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/.github/workflows/ci.yml new/ini2toml-0.12/.github/workflows/ci.yml --- old/ini2toml-0.11.3/.github/workflows/ci.yml 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/.github/workflows/ci.yml 2023-03-17 19:29:02.000000000 +0100 @@ -5,7 +5,7 @@ # Avoid using all the resources/limits available by checking only # relevant branches and tags. Other branches can be checked via PRs. # branches: [main] - tags: ['v*'] # Push events to matching v*, i.e. v1.0, v20.15.10 + tags: ['v[0-9]*', '[0-9]+.[0-9]+*'] # Match tags that resemble a version # pull_request: # Run in every PR workflow_dispatch: # Allow manually triggering the workflow schedule: @@ -35,7 +35,7 @@ run: pipx run --python python3.10 tox -e clean,build - name: Record the path of wheel distribution id: wheel-distribution - run: echo "::set-output name=path::$(ls dist/*.whl)" + run: echo "path=$(ls dist/*.whl)" >> $GITHUB_OUTPUT - name: Store the distribution files for use in other stages # `tests` and `publish` will use the same pre-built distributions, # so we make sure to release the exact same package that was tested @@ -51,8 +51,7 @@ matrix: python: - "3.7" # oldest Python supported by PSF - - "3.10" # newest Python that is stable - - "3.11-dev" # current Python beta + - "3.11" # newest Python that is stable platform: - ubuntu-latest - macos-latest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/.pre-commit-config.yaml new/ini2toml-0.12/.pre-commit-config.yaml --- old/ini2toml-0.11.3/.pre-commit-config.yaml 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/.pre-commit-config.yaml 2023-03-17 19:29:02.000000000 +0100 @@ -2,7 +2,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: trailing-whitespace exclude: 'test_(.*)\.py$' @@ -19,7 +19,7 @@ args: ['--fix=lf'] - repo: https://github.com/PyCQA/autoflake - rev: v1.7.7 + rev: v2.0.2 hooks: - id: autoflake args: [ @@ -28,36 +28,36 @@ --remove-unused-variables, ] -- repo: https://github.com/pycqa/isort - rev: 5.10.1 +- repo: https://github.com/PyCQA/isort + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.1.0 hooks: - id: black language_version: python3 - repo: https://github.com/asottile/blacken-docs - rev: v1.12.1 + rev: 1.13.0 hooks: - id: blacken-docs additional_dependencies: [black] - repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + rev: v2.2.4 hooks: - id: codespell # See setup.cfg for args - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 6.0.0 hooks: - id: flake8 - additional_dependencies: [flake8-bugbear] + additional_dependencies: [flake8-bugbear>=23.2.13] - repo: https://github.com/asottile/pyupgrade - rev: v3.2.2 + rev: v3.3.1 hooks: - id: pyupgrade args: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/CHANGELOG.rst new/ini2toml-0.12/CHANGELOG.rst --- old/ini2toml-0.11.3/CHANGELOG.rst 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/CHANGELOG.rst 2023-03-17 19:29:02.000000000 +0100 @@ -2,6 +2,15 @@ Changelog ========= +Version 0.12 +============ + +* Fix logging in case of early errors while loading plugins, :pr:`69` +* Log warning if ``flake8`` and ``devpi`` sections are translation, + prompting the user to review the output, :issue:`72` +* ``pytest`` plugin: + * Fix parsing of ``filterwarnings``, issue:`74` + Version 0.11.3 ============== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/PKG-INFO new/ini2toml-0.12/PKG-INFO --- old/ini2toml-0.11.3/PKG-INFO 2022-11-23 17:04:54.142139400 +0100 +++ new/ini2toml-0.12/PKG-INFO 2023-03-17 19:30:47.394671700 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ini2toml -Version: 0.11.3 +Version: 0.12 Summary: Automatically conversion of .ini/.cfg files to TOML equivalents Home-page: https://github.com/abravalheri/ini2toml/ Author: Anderson Bravalheri diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/setup.cfg new/ini2toml-0.12/setup.cfg --- old/ini2toml-0.11.3/setup.cfg 2022-11-23 17:04:54.146139600 +0100 +++ new/ini2toml-0.12/setup.cfg 2023-03-17 19:30:47.394671700 +0100 @@ -52,6 +52,8 @@ tomli pytest pytest-cov + pytest-xdist + pytest-randomly validate-pyproject>=0.6,<2 typechecking = typing-extensions; python_version<"3.8" @@ -67,6 +69,7 @@ pytest = ini2toml.plugins.pytest:activate mypy = ini2toml.plugins.mypy:activate independent_tasks = ini2toml.plugins.profile_independent_tasks:activate + toml_incompatibilities = ini2toml.plugins.toml_incompatibilities:activate [tool:pytest] addopts = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml/cli.py new/ini2toml-0.12/src/ini2toml/cli.py --- old/ini2toml-0.11.3/src/ini2toml/cli.py 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml/cli.py 2023-03-17 19:29:02.000000000 +0100 @@ -129,7 +129,6 @@ return meta -@critical_logging() def parse_args( args: Sequence[str], profiles: Sequence[Profile], @@ -169,7 +168,7 @@ @contextmanager -def exceptisons2exit(): +def exceptions2exit(): try: yield except Exception as ex: @@ -178,7 +177,7 @@ raise SystemExit(1) -@exceptisons2exit() +@exceptions2exit() def run(args: Sequence[str] = ()): """Wrapper allowing :obj:`Translator` to be called in a CLI fashion. @@ -189,11 +188,12 @@ args (List[str]): command line parameters as list of strings (for example ``["--verbose", "setup.cfg"]``). """ - args = args or sys.argv[1:] - translator = Translator() - profiles = list(translator.profiles.values()) - profile_augmentations = list(translator.augmentations.values()) - params = parse_args(args, profiles, profile_augmentations) + with critical_logging(): + args = args or sys.argv[1:] + translator = Translator() + profiles = list(translator.profiles.values()) + profile_augmentations = list(translator.augmentations.values()) + params = parse_args(args, profiles, profile_augmentations) setup_logging(params.loglevel) out = translator.translate( params.input_file.read(), params.profile, params.active_augmentations @@ -248,4 +248,4 @@ def _format_choice_help(choice: CLIChoice) -> str: - return f'- "{choice.name}": {_flatten_str(choice.help_text)}.' + return f"- {choice.name!r}: {_flatten_str(choice.help_text)}." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml/drivers/lite_toml.py new/ini2toml-0.12/src/ini2toml/drivers/lite_toml.py --- old/ini2toml-0.11.3/src/ini2toml/drivers/lite_toml.py 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml/drivers/lite_toml.py 2023-03-17 19:29:02.000000000 +0100 @@ -7,7 +7,7 @@ from tomli_w import dumps except ImportError: # pragma: no cover # Let's try another API-compatible popular library as a last hope - from toml import dumps # type: ignore + from toml import dumps # type: ignore[import] from ..types import IntermediateRepr from . import plain_builtins diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml/errors.py new/ini2toml-0.12/src/ini2toml/errors.py --- old/ini2toml-0.11.3/src/ini2toml/errors.py 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml/errors.py 2023-03-17 19:29:02.000000000 +0100 @@ -46,7 +46,7 @@ def __init__(self, name: str): msg = self.__class__.__doc__ or "" - super().__init__(f"{msg} ('{name}' given)") + super().__init__(f"{msg} ({name!r} given)") @classmethod def check(cls, name: str): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml/plugins/pytest.py new/ini2toml-0.12/src/ini2toml/plugins/pytest.py --- old/ini2toml-0.11.3/src/ini2toml/plugins/pytest.py 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml/plugins/pytest.py 2023-03-17 19:29:02.000000000 +0100 @@ -9,10 +9,10 @@ R = TypeVar("R", bound=IntermediateRepr) -list_with_space = partial(split_list, sep=" ") -split_markers = partial(split_list, sep="\n") +split_spaces = partial(split_list, sep=" ") +split_lines = partial(split_list, sep="\n") # ^ most of the list values in pytest use whitespace separators, -# but markers are a special case, since they can define a help text +# but markers/filterwarnings are a special case. def activate(translator: Translator): @@ -25,8 +25,11 @@ class Pytest: """Convert settings to 'pyproject.toml' ('ini_options' table)""" - LIST_VALUES = ( + LINE_SEPARATED_LIST_VALUES = ( + "markers", "filterwarnings", + ) + SPACE_SEPARATED_LIST_VALUES = ( "norecursedirs", "python_classes", "python_files", @@ -56,9 +59,9 @@ for field in section: if field in self.DONT_TOUCH: continue - if field == "markers": - section[field] = split_markers(section[field]) - elif field in self.LIST_VALUES: - section[field] = list_with_space(section[field]) + if field in self.LINE_SEPARATED_LIST_VALUES: + section[field] = split_lines(section[field]) + elif field in self.SPACE_SEPARATED_LIST_VALUES: + section[field] = split_spaces(section[field]) else: section[field] = coerce_scalar(section[field]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml/plugins/setuptools_pep621.py new/ini2toml-0.12/src/ini2toml/plugins/setuptools_pep621.py --- old/ini2toml-0.11.3/src/ini2toml/plugins/setuptools_pep621.py 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml/plugins/setuptools_pep621.py 2023-03-17 19:29:02.000000000 +0100 @@ -3,7 +3,20 @@ import warnings from functools import partial, reduce from itertools import chain, zip_longest -from typing import Any, Dict, List, Mapping, Sequence, Set, Tuple, Type, TypeVar, Union +from typing import ( + Any, + Dict, + Iterator, + List, + Mapping, + Optional, + Sequence, + Set, + Tuple, + Type, + TypeVar, + Union, +) try: from packaging.requirements import Requirement @@ -254,7 +267,7 @@ """ metadata: IR = doc["metadata"] - def _split_values(field): + def _split_values(field: str) -> Tuple[Iterator[str], Optional[str]]: commented: Commented[str] = metadata.get(field, Commented()) values = commented.value_or("").strip().split(",") return (v.strip() for v in values), commented.comment @@ -509,7 +522,7 @@ if "setup-requires" in options: msg = "The field 'setup_requires' is deprecated. " msg += "Converting to `build-system.requires` as specified by PEP 518." - warnings.warn(msg, DeprecationWarning) + warnings.warn(msg, DeprecationWarning) # noqa: B028 requirements: CommentedList[str] = options.pop("setup-requires") # Deduplicate existing = {Requirement(r).name: r for r in requirements.as_list()} @@ -535,7 +548,7 @@ msg = "The field 'tests_require' is deprecated and no longer supported. " msg += "Dependencies will be converted to optional (`testing` extra). " msg += "You can use a tool like `tox` or `nox` to replace this workflow." - warnings.warn(msg, DeprecationWarning) + warnings.warn(msg, DeprecationWarning) # noqa: B028 reqs: CommentedList[str] = doc["options"].pop("tests-require") if "project:optional-dependencies" not in doc: doc["project:optional-dependencies"] = IR(testing=reqs) @@ -684,7 +697,7 @@ for alias, cannonic in self.setupcfg_aliases().items(): if alias in metadata: msg = f"{alias!r} is deprecated. Translating to {cannonic!r} instead." - warnings.warn(msg, DeprecationWarning) + warnings.warn(msg, DeprecationWarning) # noqa: B028 metadata.rename(alias, cannonic) return cfg @@ -762,7 +775,7 @@ return joiner.join((dep, marker)) -def split_deps(value): +def split_deps(value: str) -> CommentedList: """Setuptools seem to accept line continuations for markers (with comments in the middle), and that is more difficult to process. e.g.: https://github.com/jaraco/zipp @@ -779,7 +792,7 @@ i += 1 continue while line.value and line.value[-1].strip()[-1] == "\\": - comments: List[Tuple(int, str)] = [] + comments: List[Tuple[int, str]] = [] for j in range(i + 1, L): # Find the non commented / non empty line following = lines[j] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml/plugins/toml_incompatibilities.py new/ini2toml-0.12/src/ini2toml/plugins/toml_incompatibilities.py --- old/ini2toml-0.11.3/src/ini2toml/plugins/toml_incompatibilities.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml/plugins/toml_incompatibilities.py 2023-03-17 19:29:02.000000000 +0100 @@ -0,0 +1,49 @@ +import logging +from inspect import cleandoc +from typing import List, TypeVar + +from ..types import IntermediateRepr, Translator + +R = TypeVar("R", bound=IntermediateRepr) + +_logger = logging.getLogger(__package__) + +_FLAKE8_SECTIONS = ["flake8", "flake8-rst", "flake8:local-plugins"] + +_KNOWN_INCOMPATIBILITIES = { + "setup.cfg": [*_FLAKE8_SECTIONS, "devpi:upload"], + ".flake8": _FLAKE8_SECTIONS, +} + + +def activate(translator: Translator): + for name, sections in _KNOWN_INCOMPATIBILITIES.items(): + fn = ReportIncompatibleSections(name, sections) + translator[name].intermediate_processors.insert(0, fn) + + +class ReportIncompatibleSections: + """Remove well-know incompatible sections.""" + + def __init__(self, profile: str, sections: List[str]): + self._profile = profile + self._sections = sections + + def __call__(self, cfg: R) -> R: + invalid = [section for section in self._sections if section in cfg] + if invalid: + sections = ", ".join(repr(x) for x in invalid) + _logger.warning(_warning_text(self._profile, sections)) + return cfg + + +def _warning_text(profile: str, sections: str) -> str: + msg = f""" + Sections {sections} ({profile!r}) may be problematic. + + It might be the case TOML files are not supported by the relevant tools, + or that 'ini2toml' just lacks a plugin for this kind of configuration. + + Please review the generated output and remove these sections if necessary. + """ + return cleandoc(msg) + "\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml/transformations.py new/ini2toml-0.12/src/ini2toml/transformations.py --- old/ini2toml-0.11.3/src/ini2toml/transformations.py 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml/transformations.py 2023-03-17 19:29:02.000000000 +0100 @@ -127,7 +127,8 @@ @wraps(fn) def _fn(*args, **kwargs): - warnings.warn(f"{name!r} is deprecated{extra}", DeprecationWarning) + msg = f"{name!r} is deprecated{extra}" + warnings.warn(msg, DeprecationWarning, stacklevel=2) return fn(*args, **kwargs) return cast(TF, _fn) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml/translator.py new/ini2toml-0.12/src/ini2toml/translator.py --- old/ini2toml-0.11.3/src/ini2toml/translator.py 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml/translator.py 2023-03-17 19:29:02.000000000 +0100 @@ -50,7 +50,7 @@ try: from .drivers.configupdater import parse except ImportError: # pragma: no cover - from .drivers.configparser import parse # type: ignore[no-redef] + from .drivers.configparser import parse return parse @@ -60,7 +60,7 @@ from .drivers.full_toml import convert except ImportError: # pragma: no cover try: - from .drivers.lite_toml import convert # type: ignore[no-redef] + from .drivers.lite_toml import convert except ImportError: msg = "Please install either `ini2toml[full]` or `ini2toml[lite]`" _logger.warning(f"{msg}. `ini2toml` (alone) is not valid.") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml.egg-info/PKG-INFO new/ini2toml-0.12/src/ini2toml.egg-info/PKG-INFO --- old/ini2toml-0.11.3/src/ini2toml.egg-info/PKG-INFO 2022-11-23 17:04:54.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml.egg-info/PKG-INFO 2023-03-17 19:30:47.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ini2toml -Version: 0.11.3 +Version: 0.12 Summary: Automatically conversion of .ini/.cfg files to TOML equivalents Home-page: https://github.com/abravalheri/ini2toml/ Author: Anderson Bravalheri diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml.egg-info/SOURCES.txt new/ini2toml-0.12/src/ini2toml.egg-info/SOURCES.txt --- old/ini2toml-0.11.3/src/ini2toml.egg-info/SOURCES.txt 2022-11-23 17:04:54.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml.egg-info/SOURCES.txt 2023-03-17 19:30:47.000000000 +0100 @@ -62,6 +62,7 @@ src/ini2toml/plugins/profile_independent_tasks.py src/ini2toml/plugins/pytest.py src/ini2toml/plugins/setuptools_pep621.py +src/ini2toml/plugins/toml_incompatibilities.py tests/conftest.py tests/test_cli.py tests/test_examples.py @@ -110,4 +111,5 @@ tests/plugins/test_mypy.py tests/plugins/test_profile_independent_tasks.py tests/plugins/test_pytest.py -tests/plugins/test_setuptools_pep621.py \ No newline at end of file +tests/plugins/test_setuptools_pep621.py +tests/plugins/test_toml_incompatibilities.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml.egg-info/entry_points.txt new/ini2toml-0.12/src/ini2toml.egg-info/entry_points.txt --- old/ini2toml-0.11.3/src/ini2toml.egg-info/entry_points.txt 2022-11-23 17:04:54.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml.egg-info/entry_points.txt 2023-03-17 19:30:47.000000000 +0100 @@ -9,3 +9,4 @@ mypy = ini2toml.plugins.mypy:activate pytest = ini2toml.plugins.pytest:activate setuptools_pep621 = ini2toml.plugins.setuptools_pep621:activate +toml_incompatibilities = ini2toml.plugins.toml_incompatibilities:activate diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/src/ini2toml.egg-info/requires.txt new/ini2toml-0.12/src/ini2toml.egg-info/requires.txt --- old/ini2toml-0.11.3/src/ini2toml.egg-info/requires.txt 2022-11-23 17:04:54.000000000 +0100 +++ new/ini2toml-0.12/src/ini2toml.egg-info/requires.txt 2023-03-17 19:30:47.000000000 +0100 @@ -28,6 +28,8 @@ tomli pytest pytest-cov +pytest-xdist +pytest-randomly validate-pyproject<2,>=0.6 [typechecking] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/tests/plugins/test_pytest.py new/ini2toml-0.12/tests/plugins/test_pytest.py --- old/ini2toml-0.11.3/tests/plugins/test_pytest.py 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/tests/plugins/test_pytest.py 2023-03-17 19:29:02.000000000 +0100 @@ -19,7 +19,10 @@ dist build .tox - """ + filterwarnings= + error + ignore:Please use `dok_matrix` from the `scipy\\.sparse` namespace, the `scipy\\.sparse\\.dok` namespace is deprecated.:DeprecationWarning + """ # noqa expected = """\ [pytest] [pytest.ini_options] @@ -33,6 +36,10 @@ "build", ".tox", ] + filterwarnings = [ + "error", + 'ignore:Please use `dok_matrix` from the `scipy\\.sparse` namespace, the `scipy\\.sparse\\.dok` namespace is deprecated.:DeprecationWarning', + ] """ # noqa for convert in (lite_toml.convert, full_toml.convert): translator = Translator(plugins=[pytest.activate], toml_dumps_fn=convert) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/tests/plugins/test_toml_incompatibilities.py new/ini2toml-0.12/tests/plugins/test_toml_incompatibilities.py --- old/ini2toml-0.11.3/tests/plugins/test_toml_incompatibilities.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ini2toml-0.12/tests/plugins/test_toml_incompatibilities.py 2023-03-17 19:29:02.000000000 +0100 @@ -0,0 +1,50 @@ +import logging + +import pytest + +from ini2toml.drivers import configparser, configupdater +from ini2toml.plugins import toml_incompatibilities as plugin +from ini2toml.translator import Translator + +EXAMPLE_FLAKE8 = """ +[flake8] +# Some sane defaults for the code style checker flake8 +# black compatibility +max_line_length = 88 +# E203 and W503 have edge cases handled by black +extend_ignore = E203, W503 +exclude = + src/pyscaffold/contrib + .tox + build + dist + .eggs + docs/conf.py +""" + +EXAMPLE_DEVPI = """ +[devpi:upload] +# Options for the devpi: PyPI server and packaging tool +# VCS export must be deactivated since we are using setuptools-scm +no_vcs = 1 +formats = bdist_wheel +""" + +EXAMPLES = { + "flake8": (".flake8", "flake8", EXAMPLE_FLAKE8), + "flake8-setup.cfg": ("setup.cfg", "flake8", EXAMPLE_FLAKE8), + "devpi-setup.cfg": ("setup.cfg", "devpi:upload", EXAMPLE_DEVPI), +} + + +@pytest.mark.parametrize("example", EXAMPLES.keys()) +@pytest.mark.parametrize("convert", (configparser.parse, configupdater.parse)) +def test_log_warnings(example, convert, caplog): + """ini2toml should display a warning via the logging system""" + profile, section, content = EXAMPLES[example] + translator = Translator(plugins=[plugin.activate], ini_loads_fn=convert) + caplog.clear() + with caplog.at_level(logging.WARNING): + translator.translate(content, profile) + expected = plugin._warning_text(profile, repr(section)) + assert expected in caplog.text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ini2toml-0.11.3/tests/test_cli.py new/ini2toml-0.12/tests/test_cli.py --- old/ini2toml-0.11.3/tests/test_cli.py 2022-11-23 17:03:38.000000000 +0100 +++ new/ini2toml-0.12/tests/test_cli.py 2023-03-17 19:29:02.000000000 +0100 @@ -6,6 +6,7 @@ import pytest from ini2toml import cli +from ini2toml.plugins import ErrorLoadingPlugin from ini2toml.profile import Profile, ProfileAugmentation @@ -79,12 +80,29 @@ assert spy.call_args is None -def test_exceptisons2exit(): +def test_exceptions2exit(): with pytest.raises(SystemExit): - with cli.exceptisons2exit(): + with cli.exceptions2exit(): raise ValueError +def test_early_plugin_error(monkeypatch): + err = MagicMock(side_effect=ErrorLoadingPlugin("fake")) + monkeypatch.setattr("ini2toml.translator.list_all_plugins", err) + + # Remove all attached handlers, so `logging.basicConfig` can work + for logger in (logging.getLogger(), logging.getLogger(cli.__package__)): + monkeypatch.setattr(logger, "handlers", []) + + assert logger.getEffectiveLevel() in {logging.NOTSET, logging.WARNING} + + monkeypatch.setattr("sys.argv", ["ini2toml", "-vv"]) + with pytest.raises(SystemExit): + cli.run() + + assert logger.getEffectiveLevel() == logging.DEBUG + + def test_help(capsys): with pytest.raises(SystemExit): cli.run(["--help"]) @@ -93,12 +111,12 @@ text = " ".join(x.strip() for x in out.splitlines()) expected_profile_desc = """\ conversion. Available profiles: - - "best_effort": guess option value conversion based on the string format. - - ".coveragerc": convert settings to 'pyproject.toml' equivalent. - - "setup.cfg": convert settings to 'pyproject.toml' based on :pep:`621`. - - ".isort.cfg": convert settings to 'pyproject.toml' equivalent. - - "mypy.ini": convert settings to 'pyproject.toml' equivalent. - - "pytest.ini": convert settings to 'pyproject.toml' ('ini_options' table). + - 'best_effort': guess option value conversion based on the string format. + - '.coveragerc': convert settings to 'pyproject.toml' equivalent. + - 'setup.cfg': convert settings to 'pyproject.toml' based on :pep:`621`. + - '.isort.cfg': convert settings to 'pyproject.toml' equivalent. + - 'mypy.ini': convert settings to 'pyproject.toml' equivalent. + - 'pytest.ini': convert settings to 'pyproject.toml' ('ini_options' table). """ expected = " ".join(x.strip() for x in expected_profile_desc.splitlines()) print(out)