Skip to content
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

fixing drg-yasg new version changes. #206

Closed

Conversation

edx-requirements-bot
Copy link
Contributor

@edx-requirements-bot edx-requirements-bot commented Jun 17, 2023

Python requirements update. Please review the changelogs for the upgraded packages.

drf-yasg latest version removed 2 dependencies but edx-platform gives error due to those ( drf gives error )

https://github.com/axnsan12/drf-yasg/pull/854/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R58

make docs fails with new version drf-yasg==1.21.6

  File "manage.py", line 106, in <module>
    execute_from_command_line([sys.argv[0]] + django_args)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/management/commands/generate_swagger.py", line 152, in handle
    schema = self.get_schema(generator, request, not private)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/management/commands/generate_swagger.py", line 110, in get_schema
    return generator.get_schema(request=request, public=public)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/generators.py", line 276, in get_schema
    paths, prefix = self.get_paths(endpoints, components, request, public)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/generators.py", line 482, in get_paths
    operation = self.get_operation(view, path, prefix, method, components, request)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/generators.py", line 524, in get_operation
    operation = view_inspector.get_operation(operation_keys)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/inspectors/view.py", line 33, in get_operation
    query = self.get_query_parameters()
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/inspectors/view.py", line 293, in get_query_parameters
    natural_parameters = self.get_filter_parameters() + self.get_pagination_parameters()
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/inspectors/base.py", line 428, in get_pagination_parameters
    return self.probe_inspectors(self.paginator_inspectors, 'get_paginator_parameters',
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/inspectors/base.py", line 110, in probe_inspectors
    result = method(obj, **kwargs)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/drf_yasg/inspectors/query.py", line 22, in get_paginator_parameters
    fields = paginator.get_schema_fields(self.view)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/rest_framework/pagination.py", line 313, in get_schema_fields
    assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
AssertionError: coreapi must be installed to use `get_schema_fields()`

@edx-requirements-bot edx-requirements-bot requested a review from a team June 17, 2023 10:34
@edx-requirements-bot
Copy link
Contributor Author

List of packages in the PR without any issue.

  • drf-yasg changes from 1.21.5 to 1.21.6
  • virtualenv changes from 20.23.0 to 20.23.1

requests==2.31.0
# via coreapi
ruamel-yaml==0.17.31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@openedx openedx deleted a comment from edx-requirements-bot Jun 19, 2023
@awais786 awais786 changed the title Python Requirements Update fixing drg-yasg new version changes. Jun 19, 2023
Copy link
Member

@UsamaSadiq UsamaSadiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to mention packages explicitly. Mentioning drf-yasg[coreapi] will handle both dependencies.

@@ -1,6 +1,8 @@
# Core requirements for using this application
-c constraints.txt

drf-yasg[coreapi] # drf-yasg in 1.21.6 dropped this. https://drf-yasg.readthedocs.io/en/stable/changelog.html#id1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
drf-yasg[coreapi] # drf-yasg in 1.21.6 dropped this. https://drf-yasg.readthedocs.io/en/stable/changelog.html#id1

@@ -1,6 +1,8 @@
# Core requirements for using this application
-c constraints.txt

drf-yasg[coreapi] # drf-yasg in 1.21.6 dropped this. https://drf-yasg.readthedocs.io/en/stable/changelog.html#id1
drf-yasg[coreschema] # drf-yasg in 1.21.6 dropped this. https://drf-yasg.readthedocs.io/en/stable/changelog.html#id1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
drf-yasg[coreschema] # drf-yasg in 1.21.6 dropped this. https://drf-yasg.readthedocs.io/en/stable/changelog.html#id1

@awais786 awais786 force-pushed the jenkins/upgrade-python-requirements-2ba8e4c branch from d51f31f to 7ef4cd0 Compare June 19, 2023 12:37
@awais786 awais786 force-pushed the jenkins/upgrade-python-requirements-2ba8e4c branch from 4c7af62 to 2d4d2b1 Compare June 19, 2023 13:42
@edx-requirements-bot
Copy link
Contributor Author

Closing obsolete PR.

@edx-requirements-bot edx-requirements-bot deleted the jenkins/upgrade-python-requirements-2ba8e4c branch June 22, 2023 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants