From 6a4091b3e4734fe032397b0bcd350820f6037d0f Mon Sep 17 00:00:00 2001 From: NyanKiyoshi Date: Mon, 6 May 2019 19:17:33 +0200 Subject: [PATCH 1/3] from_enum can now take a deprecation reason (#957) --- graphene/tests/issues/test_956.py | 8 ++++++++ graphene/types/enum.py | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 graphene/tests/issues/test_956.py diff --git a/graphene/tests/issues/test_956.py b/graphene/tests/issues/test_956.py new file mode 100644 index 00000000..72ff9713 --- /dev/null +++ b/graphene/tests/issues/test_956.py @@ -0,0 +1,8 @@ +import graphene + + +def test_issue(): + options = {"description": "This my enum", "deprecation_reason": "For the funs"} + new_enum = graphene.Enum("MyEnum", [("some", "data")], **options) + assert new_enum._meta.description == options["description"] + assert new_enum._meta.deprecation_reason == options["deprecation_reason"] diff --git a/graphene/types/enum.py b/graphene/types/enum.py index 6e6bab8f..7b8e71f5 100644 --- a/graphene/types/enum.py +++ b/graphene/types/enum.py @@ -46,7 +46,12 @@ class EnumMeta(SubclassWithMeta_Meta): def __call__(cls, *args, **kwargs): # noqa: N805 if cls is Enum: description = kwargs.pop("description", None) - return cls.from_enum(PyEnum(*args, **kwargs), description=description) + deprecation_reason = kwargs.pop("deprecation_reason", None) + return cls.from_enum( + PyEnum(*args, **kwargs), + description=description, + deprecation_reason=deprecation_reason, + ) return super(EnumMeta, cls).__call__(*args, **kwargs) # return cls._meta.enum(*args, **kwargs) From a5162e9ae39bcb7d6b0655bf3385e674611e6d17 Mon Sep 17 00:00:00 2001 From: Scott Crunkleton Date: Tue, 7 May 2019 10:31:30 -0600 Subject: [PATCH 2/3] Update aniso8601 dependency to allow versions 4+. (#935) * Update aniso8601 dependency to allow versions 4+. * Upper bound to aniso8601 dependency version. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 48e5be35..82bb011c 100644 --- a/setup.py +++ b/setup.py @@ -88,7 +88,7 @@ setup( "six>=1.10.0,<2", "graphql-core>=2.1,<3", "graphql-relay>=0.4.5,<1", - "aniso8601>=3,<4", + "aniso8601>=3,<=6.0.*", ], tests_require=tests_require, extras_require={ From f73055f72bf7d4b06130507eeeed4ae70f61bd97 Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 7 May 2019 21:16:22 +0200 Subject: [PATCH 3/3] Drop support for Python 3.4 because it is EOL (#963) --- .travis.yml | 2 -- README.md | 4 ++-- README.rst | 8 ++++---- setup.py | 3 +-- tox.ini | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53878e74..33c8665a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,6 @@ matrix: include: - env: TOXENV=py27 python: 2.7 - - env: TOXENV=py34 - python: 3.4 - env: TOXENV=py35 python: 3.5 - env: TOXENV=py36 diff --git a/README.md b/README.md index 8b5a83e3..713da3cc 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ You can also run the benchmarks with: py.test graphene --benchmark-only ``` -Graphene supports several versions of Python. To make sure that changes do not break compatibility with any of those versions, we use `tox` to create virtualenvs for each python version and run tests with that version. To run against all python versions defined in the `tox.ini` config file, just run: +Graphene supports several versions of Python. To make sure that changes do not break compatibility with any of those versions, we use `tox` to create virtualenvs for each Python version and run tests with that version. To run against all Python versions defined in the `tox.ini` config file, just run: ```sh tox @@ -180,7 +180,7 @@ If you wish to run against a specific version defined in the `tox.ini` file: tox -e py36 ``` -Tox can only use whatever versions of python are installed on your system. When you create a pull request, Travis will also be running the same tests and report the results, so there is no need for potential contributors to try to install every single version of python on their own system ahead of time. We appreciate opening issues and pull requests to make graphene even more stable & useful! +Tox can only use whatever versions of Python are installed on your system. When you create a pull request, Travis will also be running the same tests and report the results, so there is no need for potential contributors to try to install every single version of Python on their own system ahead of time. We appreciate opening issues and pull requests to make graphene even more stable & useful! ### Building Documentation diff --git a/README.rst b/README.rst index 5b3f3747..d6f4592b 100644 --- a/README.rst +++ b/README.rst @@ -308,8 +308,8 @@ You can also run the benchmarks with: Graphene supports several versions of Python. To make sure that changes do not break compatibility with any of those versions, we use ``tox`` to -create virtualenvs for each python version and run tests with that -version. To run against all python versions defined in the ``tox.ini`` +create virtualenvs for each Python version and run tests with that +version. To run against all Python versions defined in the ``tox.ini`` config file, just run: .. code:: sh @@ -323,10 +323,10 @@ file: tox -e py36 -Tox can only use whatever versions of python are installed on your +Tox can only use whatever versions of Python are installed on your system. When you create a pull request, Travis will also be running the same tests and report the results, so there is no need for potential -contributors to try to install every single version of python on their +contributors to try to install every single version of Python on their own system ahead of time. We appreciate opening issues and pull requests to make graphene even more stable & useful! diff --git a/setup.py b/setup.py index 82bb011c..c75df0ba 100644 --- a/setup.py +++ b/setup.py @@ -76,10 +76,9 @@ setup( "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: PyPy", ], keywords="api graphql protocol rest relay graphene", diff --git a/tox.ini b/tox.ini index 2b7ae59c..c1dbd01d 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ deps = setenv = PYTHONPATH = .:{envdir} commands = - py{27,34,py}: py.test --cov=graphene graphene examples {posargs} + py{27,py}: py.test --cov=graphene graphene examples {posargs} py{35,36,37}: py.test --cov=graphene graphene examples tests_asyncio {posargs} [testenv:pre-commit]