From 92523ee61ee04068190ffe8eb53bd68594c91ba5 Mon Sep 17 00:00:00 2001 From: Firas K <3097061+firaskafri@users.noreply.github.com> Date: Wed, 3 May 2023 12:18:31 +0300 Subject: [PATCH 01/12] Use Python 3.10 for deployments on PyPi --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 07c0766f8..1b1e7a22d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.10 - name: Build wheel and source tarball run: | pip install wheel From 4a8fd954c8d049d48b782030245ef711c4ab8a8b Mon Sep 17 00:00:00 2001 From: Firas K <3097061+firaskafri@users.noreply.github.com> Date: Wed, 3 May 2023 12:36:27 +0300 Subject: [PATCH 02/12] Update gh-action-pypi-publish version --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1b1e7a22d..da00e1183 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,7 +20,7 @@ jobs: pip install wheel python setup.py sdist bdist_wheel - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@v1.1.0 + uses: pypa/gh-action-pypi-publish@v1.8.6 with: user: __token__ password: ${{ secrets.pypi_password }} From 5b8fa0bf5b4fc37aff38784526899e48655231bb Mon Sep 17 00:00:00 2001 From: Firas K <3097061+firaskafri@users.noreply.github.com> Date: Wed, 3 May 2023 12:36:51 +0300 Subject: [PATCH 03/12] Update python version --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9f1c3abea..c6ec9e35c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,10 +8,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.10 - name: Install dependencies run: | python -m pip install --upgrade pip From a86bcbc32688de6c8f8b712cc1b13f65906cd958 Mon Sep 17 00:00:00 2001 From: Firas K <3097061+firaskafri@users.noreply.github.com> Date: Wed, 3 May 2023 12:41:06 +0300 Subject: [PATCH 04/12] Update checkout and setup-python versions --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c2cdc996d..31b479ea4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,9 +14,9 @@ jobs: - django: "3.2" python-version: "3.7" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies From 05f227be46d5dd3dcb12db5df9c7a4addb6e83e0 Mon Sep 17 00:00:00 2001 From: Firas K <3097061+firaskafri@users.noreply.github.com> Date: Wed, 3 May 2023 12:41:10 +0300 Subject: [PATCH 05/12] Update checkout and setup-python versions --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c6ec9e35c..5f1b63d1f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3.10 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.10 - name: Install dependencies From 93af2e8084a79e7b3c83704a1a51a360b1441005 Mon Sep 17 00:00:00 2001 From: Firas K <3097061+firaskafri@users.noreply.github.com> Date: Wed, 3 May 2023 12:41:15 +0300 Subject: [PATCH 06/12] Update checkout and setup-python versions --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index da00e1183..1e43a22dc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3.10 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.10 - name: Build wheel and source tarball From ac484d43dc293b49f8dcc15ea01bf75bd57f7a57 Mon Sep 17 00:00:00 2001 From: Firas K <3097061+firaskafri@users.noreply.github.com> Date: Wed, 3 May 2023 12:44:43 +0300 Subject: [PATCH 07/12] python version in string --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1e43a22dc..a733c03de 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.10 + python-version: '3.10' - name: Build wheel and source tarball run: | pip install wheel From 2858c55d645e89c860d944c55bc3a1c9ebd74d17 Mon Sep 17 00:00:00 2001 From: Firas K <3097061+firaskafri@users.noreply.github.com> Date: Wed, 3 May 2023 12:44:57 +0300 Subject: [PATCH 08/12] Python version in string --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5f1b63d1f..8cee90a1b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.10 + python-version: '3.10' - name: Install dependencies run: | python -m pip install --upgrade pip From cbf7d234500f2b9e5ac00bf577ed740c58c9c7fa Mon Sep 17 00:00:00 2001 From: Firas K <3097061+firaskafri@users.noreply.github.com> Date: Wed, 3 May 2023 12:53:30 +0300 Subject: [PATCH 09/12] Update python version + repos versions --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e64c4e116..adb54c7a1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,8 @@ default_language_version: - python: python3.9 + python: python3.10 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: check-merge-conflict - id: check-json @@ -16,15 +16,15 @@ repos: - id: trailing-whitespace exclude: README.md - repo: https://github.com/asottile/pyupgrade - rev: v3.2.0 + rev: v3.3.2 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.3.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 6.0.0 hooks: - id: flake8 From b3640f4638e39f9aa733279dadf45f7d8bb67f0a Mon Sep 17 00:00:00 2001 From: Firas Kafri Date: Wed, 3 May 2023 13:08:39 +0300 Subject: [PATCH 10/12] Upgrade dev dependencies --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index cc9770c5d..8bb44255c 100644 --- a/setup.py +++ b/setup.py @@ -26,10 +26,10 @@ dev_requires = [ - "black==22.8.0", - "flake8==5.0.4", - "flake8-black==0.3.3", - "flake8-bugbear==22.9.11", + "black==23.3.0", + "flake8==6.0.0", + "flake8-black==0.3.6", + "flake8-bugbear==23.3.23", "pre-commit", ] + tests_require From 93320f214017d88cc22180f8b38543889ea24ed5 Mon Sep 17 00:00:00 2001 From: Firas Kafri Date: Wed, 3 May 2023 13:09:13 +0300 Subject: [PATCH 11/12] fromat examples and few files to follow black new version --- .../cookbook/ingredients/migrations/0001_initial.py | 1 - .../cookbook/ingredients/migrations/0002_auto_20161104_0050.py | 1 - .../cookbook/ingredients/migrations/0003_auto_20181018_1746.py | 1 - .../cookbook-plain/cookbook/recipes/migrations/0001_initial.py | 1 - .../cookbook/recipes/migrations/0002_auto_20161104_0106.py | 1 - .../cookbook/recipes/migrations/0003_auto_20181018_1728.py | 1 - .../cookbook/cookbook/ingredients/migrations/0001_initial.py | 1 - .../cookbook/ingredients/migrations/0002_auto_20161104_0050.py | 1 - examples/cookbook/cookbook/recipes/migrations/0001_initial.py | 1 - .../cookbook/recipes/migrations/0002_auto_20161104_0106.py | 1 - graphene_django/filter/tests/conftest.py | 1 - graphene_django/forms/mutation.py | 2 -- graphene_django/rest_framework/mutation.py | 1 - graphene_django/tests/schema_view.py | 1 - graphene_django/tests/test_query.py | 2 -- 15 files changed, 17 deletions(-) diff --git a/examples/cookbook-plain/cookbook/ingredients/migrations/0001_initial.py b/examples/cookbook-plain/cookbook/ingredients/migrations/0001_initial.py index 345cadb9b..23d71e87b 100644 --- a/examples/cookbook-plain/cookbook/ingredients/migrations/0001_initial.py +++ b/examples/cookbook-plain/cookbook/ingredients/migrations/0001_initial.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [] diff --git a/examples/cookbook-plain/cookbook/ingredients/migrations/0002_auto_20161104_0050.py b/examples/cookbook-plain/cookbook/ingredients/migrations/0002_auto_20161104_0050.py index 00fe255ab..5f9e7a06a 100644 --- a/examples/cookbook-plain/cookbook/ingredients/migrations/0002_auto_20161104_0050.py +++ b/examples/cookbook-plain/cookbook/ingredients/migrations/0002_auto_20161104_0050.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("ingredients", "0001_initial"), ] diff --git a/examples/cookbook-plain/cookbook/ingredients/migrations/0003_auto_20181018_1746.py b/examples/cookbook-plain/cookbook/ingredients/migrations/0003_auto_20181018_1746.py index 8015d1f72..e823a2e30 100644 --- a/examples/cookbook-plain/cookbook/ingredients/migrations/0003_auto_20181018_1746.py +++ b/examples/cookbook-plain/cookbook/ingredients/migrations/0003_auto_20181018_1746.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("ingredients", "0002_auto_20161104_0050"), ] diff --git a/examples/cookbook-plain/cookbook/recipes/migrations/0001_initial.py b/examples/cookbook-plain/cookbook/recipes/migrations/0001_initial.py index fceeb9b7a..c41514778 100644 --- a/examples/cookbook-plain/cookbook/recipes/migrations/0001_initial.py +++ b/examples/cookbook-plain/cookbook/recipes/migrations/0001_initial.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/examples/cookbook-plain/cookbook/recipes/migrations/0002_auto_20161104_0106.py b/examples/cookbook-plain/cookbook/recipes/migrations/0002_auto_20161104_0106.py index 015692038..f38bb697b 100644 --- a/examples/cookbook-plain/cookbook/recipes/migrations/0002_auto_20161104_0106.py +++ b/examples/cookbook-plain/cookbook/recipes/migrations/0002_auto_20161104_0106.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("recipes", "0001_initial"), ] diff --git a/examples/cookbook-plain/cookbook/recipes/migrations/0003_auto_20181018_1728.py b/examples/cookbook-plain/cookbook/recipes/migrations/0003_auto_20181018_1728.py index c54855b82..dacdb3041 100644 --- a/examples/cookbook-plain/cookbook/recipes/migrations/0003_auto_20181018_1728.py +++ b/examples/cookbook-plain/cookbook/recipes/migrations/0003_auto_20181018_1728.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("recipes", "0002_auto_20161104_0106"), ] diff --git a/examples/cookbook/cookbook/ingredients/migrations/0001_initial.py b/examples/cookbook/cookbook/ingredients/migrations/0001_initial.py index 345cadb9b..23d71e87b 100644 --- a/examples/cookbook/cookbook/ingredients/migrations/0001_initial.py +++ b/examples/cookbook/cookbook/ingredients/migrations/0001_initial.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [] diff --git a/examples/cookbook/cookbook/ingredients/migrations/0002_auto_20161104_0050.py b/examples/cookbook/cookbook/ingredients/migrations/0002_auto_20161104_0050.py index 00fe255ab..5f9e7a06a 100644 --- a/examples/cookbook/cookbook/ingredients/migrations/0002_auto_20161104_0050.py +++ b/examples/cookbook/cookbook/ingredients/migrations/0002_auto_20161104_0050.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("ingredients", "0001_initial"), ] diff --git a/examples/cookbook/cookbook/recipes/migrations/0001_initial.py b/examples/cookbook/cookbook/recipes/migrations/0001_initial.py index fceeb9b7a..c41514778 100644 --- a/examples/cookbook/cookbook/recipes/migrations/0001_initial.py +++ b/examples/cookbook/cookbook/recipes/migrations/0001_initial.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/examples/cookbook/cookbook/recipes/migrations/0002_auto_20161104_0106.py b/examples/cookbook/cookbook/recipes/migrations/0002_auto_20161104_0106.py index 015692038..f38bb697b 100644 --- a/examples/cookbook/cookbook/recipes/migrations/0002_auto_20161104_0106.py +++ b/examples/cookbook/cookbook/recipes/migrations/0002_auto_20161104_0106.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("recipes", "0001_initial"), ] diff --git a/graphene_django/filter/tests/conftest.py b/graphene_django/filter/tests/conftest.py index a11831c96..f8a65d7b2 100644 --- a/graphene_django/filter/tests/conftest.py +++ b/graphene_django/filter/tests/conftest.py @@ -87,7 +87,6 @@ class Query(graphene.ObjectType): events = DjangoFilterConnectionField(EventType) def resolve_events(self, info, **kwargs): - events = [ Event(name="Live Show", tags=["concert", "music", "rock"]), Event(name="Musical", tags=["movie", "music"]), diff --git a/graphene_django/forms/mutation.py b/graphene_django/forms/mutation.py index 3d5946409..40d1d3c7c 100644 --- a/graphene_django/forms/mutation.py +++ b/graphene_django/forms/mutation.py @@ -82,7 +82,6 @@ class Meta: def __init_subclass_with_meta__( cls, form_class=None, only_fields=(), exclude_fields=(), **options ): - if not form_class: raise Exception("form_class is required for DjangoFormMutation") @@ -129,7 +128,6 @@ def __init_subclass_with_meta__( exclude_fields=(), **options, ): - if not form_class: raise Exception("form_class is required for DjangoModelFormMutation") diff --git a/graphene_django/rest_framework/mutation.py b/graphene_django/rest_framework/mutation.py index c01d915fa..4062a4423 100644 --- a/graphene_django/rest_framework/mutation.py +++ b/graphene_django/rest_framework/mutation.py @@ -72,7 +72,6 @@ def __init_subclass_with_meta__( _meta=None, **options ): - if not serializer_class: raise Exception("serializer_class is required for the SerializerMutation") diff --git a/graphene_django/tests/schema_view.py b/graphene_django/tests/schema_view.py index 8ed2ecfde..4d538ba74 100644 --- a/graphene_django/tests/schema_view.py +++ b/graphene_django/tests/schema_view.py @@ -5,7 +5,6 @@ class QueryRoot(ObjectType): - thrower = graphene.String(required=True) request = graphene.String(required=True) test = graphene.String(who=graphene.String()) diff --git a/graphene_django/tests/test_query.py b/graphene_django/tests/test_query.py index df339d877..383ff2e33 100644 --- a/graphene_django/tests/test_query.py +++ b/graphene_django/tests/test_query.py @@ -780,7 +780,6 @@ def resolve_all_reporters(self, info, **args): def test_should_query_connectionfields_with_last(): - r = Reporter.objects.create( first_name="John", last_name="Doe", email="johndoe@example.com", a_choice=1 ) @@ -818,7 +817,6 @@ def resolve_all_reporters(self, info, **args): def test_should_query_connectionfields_with_manager(): - r = Reporter.objects.create( first_name="John", last_name="Doe", email="johndoe@example.com", a_choice=1 ) From 5f4d3921e7d682f9d6b8b73fa3158dd956a41c0a Mon Sep 17 00:00:00 2001 From: Firas Kafri Date: Wed, 3 May 2023 13:14:09 +0300 Subject: [PATCH 12/12] Upgrade pytest version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8bb44255c..96da8ff0f 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ tests_require = [ - "pytest>=7.1.3", + "pytest>=7.3.1", "pytest-cov", "pytest-random-order", "coveralls",