Skip to content

Commit

Permalink
update vendored dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored and neersighted committed Nov 19, 2022
1 parent 24cb523 commit efc7349
Show file tree
Hide file tree
Showing 32 changed files with 367 additions and 133 deletions.
2 changes: 1 addition & 1 deletion src/poetry/core/_vendor/_pyrsistent_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.18.1'
__version__ = '0.19.2'
11 changes: 11 additions & 0 deletions src/poetry/core/_vendor/jsonschema/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import json
import sys
import traceback
import warnings

try:
from importlib import metadata
Expand All @@ -24,6 +25,16 @@
from jsonschema.exceptions import SchemaError
from jsonschema.validators import RefResolver, validator_for

warnings.warn(
(
"The jsonschema CLI is deprecated and will be removed in a future "
"version. Please use check-jsonschema instead, which can be installed "
"from https://pypi.org/project/check-jsonschema/"
),
DeprecationWarning,
stacklevel=2,
)


class _CannotLoadFile(Exception):
pass
Expand Down
4 changes: 3 additions & 1 deletion src/poetry/core/_vendor/jsonschema/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ def __len__(self):
return self.total_errors

def __repr__(self):
return f"<{self.__class__.__name__} ({len(self)} total errors)>"
total = len(self)
errors = "error" if total == 1 else "errors"
return f"<{self.__class__.__name__} ({total} total {errors})>"

@property
def total_errors(self):
Expand Down
19 changes: 7 additions & 12 deletions src/poetry/core/_vendor/jsonschema/schemas/draft3.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

"properties" : {
"type" : "object",
"additionalProperties" : {"$ref" : "#", "type" : "object"},
"additionalProperties" : {"$ref" : "#"},
"default" : {}
},

Expand Down Expand Up @@ -47,7 +47,7 @@
},

"dependencies" : {
"type" : ["string", "array", "object"],
"type" : "object",
"additionalProperties" : {
"type" : ["string", "array", {"$ref" : "#"}],
"items" : {
Expand Down Expand Up @@ -75,11 +75,6 @@
"default" : false
},

"maxDecimal": {
"minimum": 0,
"type": "number"
},

"minItems" : {
"type" : "integer",
"minimum" : 0,
Expand Down Expand Up @@ -112,7 +107,9 @@
},

"enum" : {
"type" : "array"
"type" : "array",
"minItems" : 1,
"uniqueItems" : true
},

"default" : {
Expand Down Expand Up @@ -153,13 +150,11 @@
},

"id" : {
"type" : "string",
"format" : "uri"
"type" : "string"
},

"$ref" : {
"type" : "string",
"format" : "uri"
"type" : "string"
},

"$schema" : {
Expand Down
8 changes: 4 additions & 4 deletions src/poetry/core/_vendor/jsonschema/schemas/draft4.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
"type": "object",
"properties": {
"id": {
"format": "uri",
"type": "string"
},
"$schema": {
"type": "string",
"format": "uri"
"type": "string"
},
"title": {
"type": "string"
Expand Down Expand Up @@ -122,7 +120,9 @@
}
},
"enum": {
"type": "array"
"type": "array",
"minItems": 1,
"uniqueItems": true
},
"type": {
"anyOf": [
Expand Down
12 changes: 9 additions & 3 deletions src/poetry/core/_vendor/jsonschema/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,15 @@ def __attrs_post_init__(self):
)

@classmethod
def check_schema(cls, schema):
def check_schema(cls, schema, format_checker=_UNSET):
Validator = validator_for(cls.META_SCHEMA, default=cls)
for error in Validator(cls.META_SCHEMA).iter_errors(schema):
if format_checker is _UNSET:
format_checker = Validator.FORMAT_CHECKER
validator = Validator(
schema=cls.META_SCHEMA,
format_checker=format_checker,
)
for error in validator.iter_errors(schema):
raise exceptions.SchemaError.create_from(error)

def evolve(self, **changes):
Expand Down Expand Up @@ -758,7 +764,7 @@ def from_schema(cls, schema, id_of=_id_of, *args, **kwargs):
`RefResolver`
"""

return cls(base_uri=id_of(schema), referrer=schema, *args, **kwargs)
return cls(base_uri=id_of(schema), referrer=schema, *args, **kwargs) # noqa: B026, E501

def push_scope(self, scope):
"""
Expand Down
1 change: 0 additions & 1 deletion src/poetry/core/_vendor/lark/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

43 changes: 36 additions & 7 deletions src/poetry/core/_vendor/lark/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
from .utils import logger
from .tree import Tree, ParseTree
from .visitors import Transformer, Visitor, v_args, Discard, Transformer_NonRecursive
from .exceptions import (ParseError, LexError, GrammarError, UnexpectedToken,
UnexpectedInput, UnexpectedCharacters, UnexpectedEOF, LarkError)
from .lexer import Token
from .exceptions import (
GrammarError,
LarkError,
LexError,
ParseError,
UnexpectedCharacters,
UnexpectedEOF,
UnexpectedInput,
UnexpectedToken,
)
from .lark import Lark
from .lexer import Token
from .tree import ParseTree, Tree
from .utils import logger
from .visitors import Discard, Transformer, Transformer_NonRecursive, Visitor, v_args

__version__: str = "1.1.4"

__version__: str = "1.1.3"
__all__ = (
"GrammarError",
"LarkError",
"LexError",
"ParseError",
"UnexpectedCharacters",
"UnexpectedEOF",
"UnexpectedInput",
"UnexpectedToken",
"Lark",
"Token",
"ParseTree",
"Tree",
"logger",
"Discard",
"Transformer",
"Transformer_NonRecursive",
"Visitor",
"v_args",
)
2 changes: 1 addition & 1 deletion src/poetry/core/_vendor/lark/__pyinstaller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
import os

def get_hook_dirs():
return [os.path.dirname(__file__)]
return [os.path.dirname(__file__)]
2 changes: 1 addition & 1 deletion src/poetry/core/_vendor/lark/ast_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def create_transformer(ast_module: types.ModuleType,
Parameters:
ast_module: A Python module containing all the subclasses of ``ast_utils.Ast``
transformer (Optional[Transformer]): An initial transformer. Its attributes may be overwritten.
decorator_factory (Callable): An optional callable accepting two booleans, inline, and meta,
decorator_factory (Callable): An optional callable accepting two booleans, inline, and meta,
and returning a decorator for the methods of ``transformer``. (default: ``v_args``).
"""
t = transformer or Transformer()
Expand Down
2 changes: 1 addition & 1 deletion src/poetry/core/_vendor/lark/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def __str__(self):


class UnexpectedCharacters(LexError, UnexpectedInput):
"""An exception that is raised by the lexer, when it cannot match the next
"""An exception that is raised by the lexer, when it cannot match the next
string of characters to any of its terminals.
"""

Expand Down
14 changes: 7 additions & 7 deletions src/poetry/core/_vendor/lark/grammars/python.lark
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ lambda_kwparams: "**" name ","?
?stmt: simple_stmt | compound_stmt
?simple_stmt: small_stmt (";" small_stmt)* [";"] _NEWLINE
?small_stmt: (expr_stmt | assign_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt)
expr_stmt: testlist_star_expr
expr_stmt: testlist_star_expr
assign_stmt: annassign | augassign | assign

annassign: testlist_star_expr ":" test ["=" test]
assign: testlist_star_expr ("=" (yield_expr|testlist_star_expr))+
augassign: testlist_star_expr augassign_op (yield_expr|testlist)
!augassign_op: "+=" | "-=" | "*=" | "@=" | "/=" | "%=" | "&=" | "|=" | "^=" | "<<=" | ">>=" | "**=" | "//="
?testlist_star_expr: test_or_star_expr
?testlist_star_expr: test_or_star_expr
| test_or_star_expr ("," test_or_star_expr)+ ","? -> tuple
| test_or_star_expr "," -> tuple

Expand Down Expand Up @@ -95,13 +95,13 @@ for_stmt: "for" exprlist "in" testlist ":" suite ["else" ":" suite]
try_stmt: "try" ":" suite except_clauses ["else" ":" suite] [finally]
| "try" ":" suite finally -> try_finally
finally: "finally" ":" suite
except_clauses: except_clause+
except_clauses: except_clause+
except_clause: "except" [test ["as" name]] ":" suite
// NB compile.c makes sure that the default except clause is last


with_stmt: "with" with_items ":" suite
with_items: with_item ("," with_item)*
with_items: with_item ("," with_item)*
with_item: test ["as" name]

match_stmt: "match" test ":" _NEWLINE _INDENT case+ _DEDENT
Expand Down Expand Up @@ -204,7 +204,7 @@ AWAIT: "await"
| "{" _set_exprlist "}" -> set
| "{" comprehension{test} "}" -> set_comprehension
| name -> var
| number
| number
| string_concat
| "(" test ")"
| "..." -> ellipsis
Expand All @@ -217,7 +217,7 @@ AWAIT: "await"

_testlist_comp: test | _tuple_inner
_tuple_inner: test_or_star_expr (("," test_or_star_expr)+ [","] | ",")


?test_or_star_expr: test
| star_expr
Expand Down Expand Up @@ -253,7 +253,7 @@ kwargs: "**" test ("," argvalue)*


comprehension{comp_result}: comp_result comp_fors [comp_if]
comp_fors: comp_for+
comp_fors: comp_for+
comp_for: [ASYNC] "for" exprlist "in" or_test
ASYNC: "async"
?comp_if: "if" test_nocond
Expand Down
4 changes: 2 additions & 2 deletions src/poetry/core/_vendor/lark/lark.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC, abstractmethod
import getpass
import sys, os, pickle, hashlib
import sys, os, pickle
import tempfile
import types
import re
Expand All @@ -17,7 +17,7 @@
else:
from typing_extensions import Literal
from .parser_frontends import ParsingFrontend

from .exceptions import ConfigurationError, assert_config, UnexpectedInput
from .utils import Serialize, SerializeMemoizer, FS, isascii, logger
from .load_grammar import load_grammar, FromPackageLoader, Grammar, verify_used_files, PackageResource, md5_digest
Expand Down

0 comments on commit efc7349

Please sign in to comment.