Skip to content

remove aniso8601, mock, iso8601 #1548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[settings]
known_third_party = aniso8601,graphql,graphql_relay,promise,pytest,pyutils,setuptools,snapshottest,sphinx_graphene_theme
known_third_party = graphql,graphql_relay,promise,pytest,pyutils,setuptools,snapshottest,sphinx_graphene_theme
7 changes: 3 additions & 4 deletions graphene/types/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import datetime

from aniso8601 import parse_date, parse_datetime, parse_time
from graphql.error import GraphQLError
from graphql.language import StringValueNode, print_ast

Expand Down Expand Up @@ -39,7 +38,7 @@ def parse_value(value):
if not isinstance(value, str):
raise GraphQLError(f"Date cannot represent non-string value: {repr(value)}")
try:
return parse_date(value)
return datetime.date.fromisoformat(value)
except ValueError:
raise GraphQLError(f"Date cannot represent value: {repr(value)}")

Expand Down Expand Up @@ -74,7 +73,7 @@ def parse_value(value):
f"DateTime cannot represent non-string value: {repr(value)}"
)
try:
return parse_datetime(value)
return datetime.datetime.fromisoformat(value)
except ValueError:
raise GraphQLError(f"DateTime cannot represent value: {repr(value)}")

Expand Down Expand Up @@ -107,6 +106,6 @@ def parse_value(cls, value):
if not isinstance(value, str):
raise GraphQLError(f"Time cannot represent non-string value: {repr(value)}")
try:
return parse_time(value)
return datetime.time.fromisoformat(value)
except ValueError:
raise GraphQLError(f"Time cannot represent value: {repr(value)}")
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ def run_tests(self):
"pytest-asyncio>=0.16,<2",
"snapshottest>=0.6,<1",
"coveralls>=3.3,<4",
"mock>=4,<5",
"iso8601>=1,<2",
]

dev_requires = ["black==22.3.0", "flake8>=4,<5"] + tests_require
Expand Down Expand Up @@ -83,7 +81,6 @@ def run_tests(self):
install_requires=[
"graphql-core>=3.1,<3.3",
"graphql-relay>=3.1,<3.3",
"aniso8601>=8,<10",
],
tests_require=tests_require,
extras_require={"test": tests_require, "dev": dev_requires},
Expand Down
Loading