Use setuptools.find_packages in setup (#2363)
* Use setuptools.find_packages in setup * Address mypy errors
This commit is contained in:
parent
ae56983a5f
commit
dd6c674e3a
4
setup.py
4
setup.py
@ -1,5 +1,5 @@
|
|||||||
# Copyright (C) 2020 Łukasz Langa
|
# Copyright (C) 2020 Łukasz Langa
|
||||||
from setuptools import setup
|
from setuptools import setup, find_packages
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ def get_long_description() -> str:
|
|||||||
license="MIT",
|
license="MIT",
|
||||||
py_modules=["_black_version"],
|
py_modules=["_black_version"],
|
||||||
ext_modules=ext_modules,
|
ext_modules=ext_modules,
|
||||||
packages=["blackd", "black", "blib2to3", "blib2to3.pgen2", "black_primer"],
|
packages=find_packages(where="src"),
|
||||||
package_dir={"": "src"},
|
package_dir={"": "src"},
|
||||||
package_data={
|
package_data={
|
||||||
"blib2to3": ["*.txt"],
|
"blib2to3": ["*.txt"],
|
||||||
|
0
src/black_primer/__init__.py
Normal file
0
src/black_primer/__init__.py
Normal file
@ -7,7 +7,7 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from shutil import rmtree, which
|
from shutil import rmtree, which
|
||||||
from tempfile import gettempdir
|
from tempfile import gettempdir
|
||||||
from typing import Any, Union
|
from typing import Any, Union, Optional
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
@ -29,8 +29,8 @@
|
|||||||
|
|
||||||
|
|
||||||
def _handle_debug(
|
def _handle_debug(
|
||||||
ctx: click.core.Context,
|
ctx: Optional[click.core.Context],
|
||||||
param: Union[click.core.Option, click.core.Parameter],
|
param: Optional[Union[click.core.Option, click.core.Parameter]],
|
||||||
debug: Union[bool, int, str],
|
debug: Union[bool, int, str],
|
||||||
) -> Union[bool, int, str]:
|
) -> Union[bool, int, str]:
|
||||||
"""Turn on debugging if asked otherwise INFO default"""
|
"""Turn on debugging if asked otherwise INFO default"""
|
||||||
|
@ -189,7 +189,7 @@ def test_process_queue(self, mock_stdout: Mock) -> None:
|
|||||||
with patch("black_primer.lib.git_checkout_or_rebase", return_false):
|
with patch("black_primer.lib.git_checkout_or_rebase", return_false):
|
||||||
with TemporaryDirectory() as td:
|
with TemporaryDirectory() as td:
|
||||||
return_val = loop.run_until_complete(
|
return_val = loop.run_until_complete(
|
||||||
lib.process_queue(str(config_path), td, 2)
|
lib.process_queue(str(config_path), Path(td), 2)
|
||||||
)
|
)
|
||||||
self.assertEqual(0, return_val)
|
self.assertEqual(0, return_val)
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ def test_async_main(self) -> None:
|
|||||||
"no_diff": False,
|
"no_diff": False,
|
||||||
}
|
}
|
||||||
with patch("black_primer.cli.lib.process_queue", return_zero):
|
with patch("black_primer.cli.lib.process_queue", return_zero):
|
||||||
return_val = loop.run_until_complete(cli.async_main(**args))
|
return_val = loop.run_until_complete(cli.async_main(**args)) # type: ignore
|
||||||
self.assertEqual(0, return_val)
|
self.assertEqual(0, return_val)
|
||||||
|
|
||||||
def test_handle_debug(self) -> None:
|
def test_handle_debug(self) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user