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

"NotImplementedError: Imports staying and going on same line" #55

Open
lmmx opened this issue Mar 24, 2023 · 0 comments · May be fixed by #57
Open

"NotImplementedError: Imports staying and going on same line" #55

lmmx opened this issue Mar 24, 2023 · 0 comments · May be fixed by #57
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@lmmx
Copy link
Owner

lmmx commented Mar 24, 2023

Source:

  File "/home/louis/miniconda3/lib/python3.10/site-packages/mvdef/core/agenda.py", line 340, in apply
    raise NotImplementedError("Imports staying and going on same line")
NotImplementedError: Imports staying and going on same line

Example minimal reproduction:

  • bar.py
from pathlib import Path

from .foo import FOO, xs

path = Path()


def bar():
    assert path in xs


if FOO:
    bar()
mvdef -d -m="bar" bar.py baz.py

Traceback (most recent call last):
  File "/home/louis/miniconda3/bin/mvdef", line 8, in <module>
    sys.exit(cli_move())
  File "/home/louis/miniconda3/lib/python3.10/site-packages/mvdef/cli.py", line 57, in cli_move
    return cli(MvCls=MvDef, *args, **kwargs)
  File "/home/louis/miniconda3/lib/python3.10/site-packages/mvdef/cli.py", line 43, in cli
    diffs = mover.diffs(print_out=True)
  File "/home/louis/miniconda3/lib/python3.10/site-packages/mvdef/transfer/move.py", line 98, in diffs
    src_unidiff = self.src_diff.unidiff()
  File "/home/louis/miniconda3/lib/python3.10/site-packages/mvdef/core/diff/diff.py", line 38, in unidiff
    return self.agenda.unidiff(target_file=self.target_file, is_src=self.is_src)
  File "/home/louis/miniconda3/lib/python3.10/site-packages/mvdef/core/agenda.py", line 267, in unidiff
    new = self.simulate(input_text=old)
  File "/home/louis/miniconda3/lib/python3.10/site-packages/mvdef/core/agenda.py", line 479, in simulate
    return self.resimulate(
  File "/home/louis/miniconda3/lib/python3.10/site-packages/mvdef/core/agenda.py", line 450, in resimulate
    filtered = self.apply(
  File "/home/louis/miniconda3/lib/python3.10/site-packages/mvdef/core/agenda.py", line 340, in apply
    raise NotImplementedError("Imports staying and going on same line")
NotImplementedError: Imports staying and going on same line
@lmmx lmmx added bug Something isn't working enhancement New feature or request labels Mar 24, 2023
@lmmx lmmx self-assigned this Mar 24, 2023
@lmmx lmmx linked a pull request Mar 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant