Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
80b03ece
Commit
80b03ece
authored
May 21, 2022
by
David Hotham
Committed by
Branch Vincent
May 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use types-jsonschema
parent
504eb96b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
poetry.lock
+13
-1
pyproject.toml
+1
-1
src/poetry/json/__init__.py
+3
-3
No files found.
poetry.lock
View file @
80b03ece
...
...
@@ -739,6 +739,14 @@ optional = false
python-versions = "*"
[[package]]
name = "types-jsonschema"
version = "4.4.4"
description = "Typing stubs for jsonschema"
category = "dev"
optional = false
python-versions = "*"
[[package]]
name = "types-requests"
version = "2.27.26"
description = "Typing stubs for requests"
...
...
@@ -820,7 +828,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-
[metadata]
lock-version = "1.1"
python-versions = "^3.7"
content-hash = "
58010109be37f846df33e17737ed95a64df555288aabf96c3089fd0d58cc6872
"
content-hash = "
35d68e6eba695382502b1b6faab833606823a2e0cadc1b96137059f1e343e1ad
"
[metadata.files]
atomicwrites = [
...
...
@@ -1291,6 +1299,10 @@ types-html5lib = [
{file = "types-html5lib-1.1.7.tar.gz", hash = "sha256:fdb307102ceea52adf52aea0e10255d142ee29d7f169014144a730707a92066a"},
{file = "types_html5lib-1.1.7-py3-none-any.whl", hash = "sha256:4bc5a1de03b9a697b7cc04b0d03eeed5d36c0073165dd9dc54f2f43d0f23b31f"},
]
types-jsonschema = [
{file = "types-jsonschema-4.4.4.tar.gz", hash = "sha256:d03f0c1a97ff06dda9535dfa51916a98f38bf40d6828ef4d93bc40708effe507"},
{file = "types_jsonschema-4.4.4-py3-none-any.whl", hash = "sha256:294d2de9ea3564fbec6c56153e84d1f3f7d9b2ada36e183d88a63c126da7bc3d"},
]
types-requests = [
{file = "types-requests-2.27.26.tar.gz", hash = "sha256:a6a04c0274c0949fd0525f35d8b53ac34e77afecbeb3c4932ddc6ce675ac009c"},
{file = "types_requests-2.27.26-py3-none-any.whl", hash = "sha256:302137cb5bd482357398a155faf3ed095855fbc6994e952d0496c7fd50f44125"},
...
...
pyproject.toml
View file @
80b03ece
...
...
@@ -74,6 +74,7 @@ flatdict = "^4.0.1"
mypy
=
">=0.950"
types-entrypoints
=
">=0.3.7"
types-html5lib
=
">=1.1.7"
types-jsonschema
=
">=4.4.4"
types-requests
=
">=2.27.11"
[tool.poetry.scripts]
...
...
@@ -142,7 +143,6 @@ module = [
'cachy.*'
,
'cleo.*'
,
'crashtest.*'
,
'jsonschema.*'
,
'pexpect.*'
,
'pkginfo.*'
,
'poetry.core.*'
,
...
...
src/poetry/json/__init__.py
View file @
80b03ece
...
...
@@ -17,12 +17,12 @@ class ValidationError(ValueError):
def
validate_object
(
obj
:
dict
[
str
,
Any
],
schema_name
:
str
)
->
list
[
str
]:
schema
=
os
.
path
.
join
(
SCHEMA_DIR
,
f
"{schema_name}.json"
)
schema
_file
=
os
.
path
.
join
(
SCHEMA_DIR
,
f
"{schema_name}.json"
)
if
not
os
.
path
.
exists
(
schema
):
if
not
os
.
path
.
exists
(
schema
_file
):
raise
ValueError
(
f
"Schema {schema_name} does not exist."
)
with
open
(
schema
,
encoding
=
"utf-8"
)
as
f
:
with
open
(
schema
_file
,
encoding
=
"utf-8"
)
as
f
:
schema
=
json
.
loads
(
f
.
read
())
validator
=
jsonschema
.
Draft7Validator
(
schema
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment