-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
ImportError: cannot import name 'NoReturn' #1666
Comments
|
Thanks for the heads up. :) Perhaps an update of the documentation will do? Dropping 3.6.1 |
Please see PR #1668 to update the README, and the |
I mildly prefer continuing to support 3.6.0/1 by adding a fallback to |
I vote either way. I feel 3.6.2 is very accessible these days (with most distros defaulting to > 3.6.2 these days). Since the backport is easy, we already have the dependency and it's only for typing, I see no big reason to not support 3.6.0. But I expect a reason to eventually come to need > 3.6.1 ... |
I feel like given how easy it is to work around this (implementation & maintenance wise), I'd rather not drop support for 3.6.0 and 3.6.1 just because of this issue. |
(from experience) when adjusting as for linting / preventing something like this in the future, I've created a flake8 plugin for this: flake8-typing-imports |
I vote for maintain (technically start supporting) Python 3.6.0 and 3.6.1 since the maintenance cost is minimal. I doubt we'll need to drop 3.6.0/1 for the future, especially since 3.6's EOL is in 10 months. Since I see no real objection to supporting 3.6.0/1, I'll create a counter-proposal PR (the good first issue label did nothing unfortunately). |
Actually there are some nasty issues on Python 3.6.0: =================================================================== FAILURES ===================================================================
___________________________________________________ BlackTestCase.test_bpo_33660_workaround ____________________________________________________
self = <tests.test_black.BlackTestCase testMethod=test_bpo_33660_workaround>
def test_bpo_33660_workaround(self) -> None:
if system() == "Windows":
return
# https://bugs.python.org/issue33660
old_cwd = Path.cwd()
try:
root = Path("/")
os.chdir(str(root))
path = Path("workspace") / "project"
report = black.Report(verbose=True)
normalized_path = black.normalize_path_maybe_ignore(path, root, report)
> self.assertEqual(normalized_path, "workspace/project")
E AssertionError: 'workspace' != 'workspace/project'
E - workspace
E + workspace/project
tests/test_black.py:1800: AssertionError
______________________________________________________ PrimerLibTests.test_process_queue _______________________________________________________
self = <tests.test_primer.PrimerLibTests testMethod=test_process_queue>, mock_stdout = <_io.StringIO object at 0x7f61a2912af8>
@patch("sys.stdout", new_callable=StringIO)
@event_loop()
def test_process_queue(self, mock_stdout: Mock) -> None:
loop = asyncio.get_event_loop()
config_path = Path(lib.__file__).parent / "primer.json"
with patch("black_primer.lib.git_checkout_or_rebase", return_false):
with TemporaryDirectory() as td:
return_val = loop.run_until_complete(
> lib.process_queue(str(config_path), td, 2)
)
tests/test_primer.py:183:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/python3.6.0/lib/python3.6/asyncio/base_events.py:466: in run_until_complete
return future.result()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config_file = '/home/ichard26/programming/oss/black/env/lib/python3.6/site-packages/black_primer/primer.json', work_path = '/tmp/tmpec7saic8'
workers = 2, keep = False, long_checkouts = False, rebase = False
async def process_queue(
config_file: str,
work_path: Path,
workers: int,
keep: bool = False,
long_checkouts: bool = False,
rebase: bool = False,
) -> int:
"""
Process the queue with X workers and evaluate results
- Success is guaged via the config "expect_formatting_changes"
Integer return equals the number of failed projects
"""
> results = Results()
E TypeError: __new__() missing 2 required positional arguments: 'stats' and 'failed_projects'
env/lib/python3.6/site-packages/black_primer/lib.py:306: TypeError
=============================================================== warnings summary ===============================================================
tests/test_blackd.py: 14 warnings
/home/ichard26/programming/oss/black/env/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py:188: DeprecationWarning: Bare functions are deprecated, use async ones
"Bare functions are deprecated, " "use async ones", DeprecationWarning
-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================================================== short test summary info ============================================================
FAILED tests/test_black.py::BlackTestCase::test_bpo_33660_workaround - AssertionError: 'workspace' != 'workspace/project'
FAILED tests/test_primer.py::PrimerLibTests::test_process_queue - TypeError: __new__() missing 2 required positional arguments: 'stats' and '...
======================================= 2 failed, 170 passed, 3 xfailed, 14 warnings in 99.38s (0:01:39) ======================================= For the |
Describe the bug A clear and concise description of what the bug is.
Running black in the console generates a traceback.
To Reproduce Steps to reproduce the behavior:
Running black directly in the console gives me the following traceback.
Expected behavior A clear and concise description of what you expected to happen.
Shouldn't have any error.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: