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

Deprecation: nesting argument groups #1988

Closed
1 task done
pawamoy opened this issue Jun 8, 2023 · 0 comments
Closed
1 task done

Deprecation: nesting argument groups #1988

pawamoy opened this issue Jun 8, 2023 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@pawamoy
Copy link
Contributor

pawamoy commented Jun 8, 2023

  • I have searched the issue tracker and believe that this is not a duplicate.

Nesting argument groups seems to be deprecated, starting at Python 3.11.

Steps to reproduce

Simply run PDM with deprecation warnings enabled.

Actual behavior

From pytest output:

  ___________________________________________________________________________________________ test_multirun ____________________________________________________________________________________________
  [gw0] linux -- Python 3.11.0 /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.11.0/bin/python3.11

      def test_multirun() -> None:
          """Basic run."""
  >       main(["multirun", "python", "-V"])

  tests/test_plugin.py:8: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  __pypackages__/3.11/lib/pdm/core.py:289: in main
      return Core().main(args)
  __pypackages__/3.11/lib/pdm/core.py:57: in __init__
      self.init_parser()
  __pypackages__/3.11/lib/pdm/core.py:93: in init_parser
      self.register_command(klass, klass.name or name)
  __pypackages__/3.11/lib/pdm/core.py:232: in register_command
      command.register_to(self.subparsers, name)
  __pypackages__/3.11/lib/pdm/cli/commands/base.py:44: in register_to
      command = cls(parser)
  __pypackages__/3.11/lib/pdm/cli/commands/base.py:25: in __init__
      self.add_arguments(parser)
  __pypackages__/3.11/lib/pdm/cli/commands/run.py:354: in add_arguments
      exec = action.add_argument_group("execution", "Execution parameters")
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

  self = <argparse._MutuallyExclusiveGroup object at 0x7fb3d80b9690>, args = ('execution', 'Execution parameters'), kwargs = {}

      def add_argument_group(self, *args, **kwargs):
  >       warnings.warn(
              "Nesting argument groups is deprecated.",
              category=DeprecationWarning,
              stacklevel=2
          )
  E       DeprecationWarning: Nesting argument groups is deprecated.

Expected behavior

The code should be updated to avoid the deprecated nested groups.
I'll ignore the warning in the meantime 🙂

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:
  2.7.0
Python Interpreter:
  /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.11.0/bin/python3 (3.11)
Project Root:
  /media/data/dev/pdm-multirun
Local Packages:
  /media/data/dev/pdm-multirun/__pypackages__/3.11
{
  "implementation_name": "cpython",
  "implementation_version": "3.11.0",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "6.3.6-arch1-1",
  "platform_system": "Linux",
  "platform_version": "#1 SMP PREEMPT_DYNAMIC Mon, 05 Jun 2023 15:12:57 +0000",
  "python_full_version": "3.11.0",
  "platform_python_implementation": "CPython",
  "python_version": "3.11",
  "sys_platform": "linux"
}
@pawamoy pawamoy added the 🐛 bug Something isn't working label Jun 8, 2023
sanmai-NL added a commit to sanmai-NL/pdm that referenced this issue Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant