Adding upstream version 3.3.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
2f72ef8d68
commit
8a475bec34
7 changed files with 24 additions and 14 deletions
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
github: asottile
|
|
@ -1,6 +1,6 @@
|
|||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.5.0
|
||||
rev: v4.0.1
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
|
@ -9,30 +9,30 @@ repos:
|
|||
- id: debug-statements
|
||||
- id: name-tests-test
|
||||
- id: requirements-txt-fixer
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
rev: 3.8.0
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 3.9.2
|
||||
hooks:
|
||||
- id: flake8
|
||||
- repo: https://github.com/pre-commit/mirrors-autopep8
|
||||
rev: v1.5.2
|
||||
rev: v1.5.7
|
||||
hooks:
|
||||
- id: autopep8
|
||||
- repo: https://github.com/asottile/reorder_python_imports
|
||||
rev: v2.3.0
|
||||
rev: v2.5.0
|
||||
hooks:
|
||||
- id: reorder-python-imports
|
||||
args: [--py3-plus]
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v2.4.1
|
||||
rev: v2.16.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py36-plus]
|
||||
- repo: https://github.com/asottile/add-trailing-comma
|
||||
rev: v2.0.1
|
||||
rev: v2.1.0
|
||||
hooks:
|
||||
- id: add-trailing-comma
|
||||
args: [--py36-plus]
|
||||
- repo: https://github.com/asottile/setup-cfg-fmt
|
||||
rev: v1.9.0
|
||||
rev: v1.17.0
|
||||
hooks:
|
||||
- id: setup-cfg-fmt
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
[![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/asottile.cfgv?branchName=master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=24&branchName=master)
|
||||
[![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/24/master.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=24&branchName=master)
|
||||
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/cfgv/master.svg)](https://results.pre-commit.ci/latest/github/asottile/cfgv/master)
|
||||
|
||||
cfgv
|
||||
====
|
||||
|
|
|
@ -10,10 +10,9 @@ resources:
|
|||
type: github
|
||||
endpoint: github
|
||||
name: asottile/azure-pipeline-templates
|
||||
ref: refs/tags/v1.0.1
|
||||
ref: refs/tags/v2.1.0
|
||||
|
||||
jobs:
|
||||
- template: job--pre-commit.yml@asottile
|
||||
- template: job--python-tox.yml@asottile
|
||||
parameters:
|
||||
toxenvs: [pypy3, py36, py37, py38]
|
||||
|
|
4
cfgv.py
4
cfgv.py
|
@ -392,8 +392,8 @@ def load_from_filename(
|
|||
exc_tp=ValidationError,
|
||||
):
|
||||
with reraise_as(exc_tp):
|
||||
if not os.path.exists(filename):
|
||||
raise ValidationError(f'{filename} does not exist')
|
||||
if not os.path.isfile(filename):
|
||||
raise ValidationError(f'{filename} is not a file')
|
||||
|
||||
with validate_context(f'File {filename}'):
|
||||
try:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[metadata]
|
||||
name = cfgv
|
||||
version = 3.2.0
|
||||
version = 3.3.0
|
||||
description = Validate configuration and produce human readable error messages.
|
||||
long_description = file: README.md
|
||||
long_description_content_type = text/markdown
|
||||
|
@ -16,6 +16,7 @@ classifiers =
|
|||
Programming Language :: Python :: 3.6
|
||||
Programming Language :: Python :: 3.7
|
||||
Programming Language :: Python :: 3.8
|
||||
Programming Language :: Python :: 3.9
|
||||
Programming Language :: Python :: Implementation :: CPython
|
||||
Programming Language :: Python :: Implementation :: PyPy
|
||||
|
||||
|
|
|
@ -529,7 +529,15 @@ class Error(Exception):
|
|||
def test_load_from_filename_file_does_not_exist():
|
||||
with pytest.raises(Error) as excinfo:
|
||||
load_from_filename('does_not_exist', map_required, json.loads, Error)
|
||||
assert excinfo.value.args[0].error_msg == 'does_not_exist does not exist'
|
||||
assert excinfo.value.args[0].error_msg == 'does_not_exist is not a file'
|
||||
|
||||
|
||||
def test_load_from_filename_not_a_file(tmpdir):
|
||||
with tmpdir.as_cwd():
|
||||
tmpdir.join('f').ensure_dir()
|
||||
with pytest.raises(Error) as excinfo:
|
||||
load_from_filename('f', map_required, json.loads, Error)
|
||||
assert excinfo.value.args[0].error_msg == 'f is not a file'
|
||||
|
||||
|
||||
def test_load_from_filename_unicode_error(tmp_path):
|
||||
|
|
Loading…
Add table
Reference in a new issue