Repository: Ch00k/ffmpy

Issue:
Bug: ffmpy breaks all typedefs in some situations
Hi there 👋  Great package thanks for your work :)

I recently spent several hours dealing with an issue in VSCode where all type annotations were broken and the root cause was the `py.typed` file that this package puts into the root of `site-packages` (see https://github.com/microsoft/pylance-release/issues/4844#issuecomment-2491843821).

It definitely seems accidental to express typedef readiness for _all_ site packages. Would you be willing to restructure this into a `ffmpy/` directory package instead of the single file, so this doesn't happen to others?

Discussion:
@Ch00k: Ouch, that is a nasty one 😞 Great find though, thank you for reporting it. I'll see what I can do.@Ch00k: @patrickhulce I just released 0.5.0, which, among other housekeeping changes, moves the code into a package, along with `py.typed` file. Please have a look if this addresses the issue for you.

Solution patch:
diff --git a/ffmpy/__init__.py b/ffmpy/__init__.py
new file mode 100644
index 0000000..fc682bb
--- /dev/null
+++ b/ffmpy/__init__.py
@@ -0,0 +1,3 @@
+from .ffmpy import FFExecutableNotFoundError, FFmpeg, FFprobe, FFRuntimeError
+
+__all__ = ["FFmpeg", "FFprobe", "FFExecutableNotFoundError", "FFRuntimeError"]
diff --git a/ffmpy.py b/ffmpy/ffmpy.py
similarity index 100%
rename from ffmpy.py
rename to ffmpy/ffmpy.py
diff --git a/py.typed b/ffmpy/py.typed
similarity index 100%
rename from py.typed
rename to ffmpy/py.typed
diff --git a/pyproject.toml b/pyproject.toml
index 01e7dfc..bce62a5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -40,7 +40,7 @@ classifiers = [
   "Operating System :: POSIX :: Linux",
   "Operating System :: MacOS :: MacOS X",
 ]
-packages = [{ include = "ffmpy.py" }, { include = "py.typed" }]
+packages = [{ include = "ffmpy" }]
 
 [tool.poetry.dependencies]
 python = "^3.8"


Test patch:
diff --git a/tests/test_cmd_execution.py b/tests/test_cmd_execution.py
index fd9f559..576e242 100644
--- a/tests/test_cmd_execution.py
+++ b/tests/test_cmd_execution.py
@@ -202,7 +202,7 @@ def test_terminate_process() -> None:
     assert ff.process.returncode == -15
 
 
-@mock.patch("ffmpy.subprocess.Popen")
+@mock.patch("ffmpy.ffmpy.subprocess.Popen")
 def test_custom_env(popen_mock: mock.MagicMock) -> None:
     ff = FFmpeg()
     popen_mock.return_value.communicate.return_value = ("output", "error")
@@ -213,7 +213,7 @@ def test_custom_env(popen_mock: mock.MagicMock) -> None:
     )
 
 
-@mock.patch("ffmpy.subprocess.Popen")
+@mock.patch("ffmpy.ffmpy.subprocess.Popen")
 def test_arbitraty_popen_kwargs(popen_mock: mock.MagicMock) -> None:
     ff = FFmpeg()
     popen_mock.return_value.communicate.return_value = ("output", "error")