diff --git a/.dockerignore b/.dockerignore index 25eeda1..c53b52f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,5 @@ * -!requirements.txt -!MANIFEST.in -!setup.py +!pyproject.toml !script/setup !script/run !wyoming_satellite/*.py diff --git a/Dockerfile b/Dockerfile index 1700442..247f4f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /app COPY sounds/ ./sounds/ COPY script/setup ./script/ -COPY setup.py requirements.txt MANIFEST.in ./ +COPY pyproject.toml ./ COPY wyoming_satellite/ ./wyoming_satellite/ RUN script/setup diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index fd959fa..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include requirements.txt -include VERSION diff --git a/docs/tutorial_2mic.md b/docs/tutorial_2mic.md index 913c265..21ffd86 100644 --- a/docs/tutorial_2mic.md +++ b/docs/tutorial_2mic.md @@ -55,9 +55,7 @@ python3 -m venv .venv .venv/bin/pip3 install --upgrade wheel setuptools .venv/bin/pip3 install \ -f 'https://synesthesiam.github.io/prebuilt-apps/' \ - -r requirements.txt \ - -r requirements_audio_enhancement.txt \ - -r requirements_vad.txt + -e '.[all]' ``` If the installation was successful, you should be able to run: diff --git a/installer/__main__.py b/installer/__main__.py index d33fd85..9f43e84 100644 --- a/installer/__main__.py +++ b/installer/__main__.py @@ -123,7 +123,7 @@ def apply_settings(settings: Settings) -> None: ): result = run_with_gauge( "Installing vad...", - [pip_install("-r", str(PROGRAM_DIR / "requirements_vad.txt"))], + [pip_install("-e", f"{PROGRAM_DIR}[silerovad]")], ) if not result: error("installing vad") @@ -135,11 +135,7 @@ def apply_settings(settings: Settings) -> None: ): result = run_with_gauge( "Installing audio enhancements...", - [ - pip_install( - "-r", str(PROGRAM_DIR / "requirements_audio_enhancement.txt") - ) - ], + [pip_install("-e", f"{PROGRAM_DIR}[webrtc]")], ) if not result: error("installing audio enhancements") @@ -154,7 +150,7 @@ def apply_settings(settings: Settings) -> None: ) and (not can_import("gpiozero", "spidev")): result = run_with_gauge( "Installing event requirements...", - [pip_install("-r", str(PROGRAM_DIR / "requirements_respeaker.txt"))], + [pip_install("-e", f"{PROGRAM_DIR}[respeaker]")], ) if not result: error("installing event requirements") diff --git a/pyproject.toml b/pyproject.toml index 8024772..b03cd76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,17 @@ dependencies = [ all = ["pysilero-vad==1.0.0", "webrtc-noise-gain==1.2.3"] silerovad = ["pysilero-vad==1.0.0"] webrtc = ["webrtc-noise-gain==1.2.3"] +respeaker = ["gpiozero", "spidev"] +dev = [ + "black==22.12.0", + "flake8==6.0.0", + "isort==5.11.3", + "mypy==0.991", + "pylint==2.15.9", + "pytest==7.4.3", + "pytest-asyncio==0.23.3", + "build==1.2.2" +] [project.scripts] wyoming-satellite = "wyoming_satellite:__main__.run" diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index 758342f..0000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,8 +0,0 @@ -black==22.12.0 -flake8==6.0.0 -isort==5.11.3 -mypy==0.991 -pylint==2.15.9 -pytest==7.4.3 -pytest-asyncio==0.23.3 -build==1.2.2 diff --git a/requirements_respeaker.txt b/requirements_respeaker.txt deleted file mode 100644 index 39fa12e..0000000 --- a/requirements_respeaker.txt +++ /dev/null @@ -1,2 +0,0 @@ -gpiozero -spidev diff --git a/script/setup b/script/setup index f55fbb8..e0fe6c4 100755 --- a/script/setup +++ b/script/setup @@ -31,12 +31,12 @@ subprocess.check_call( "-f", "https://synesthesiam.github.io/prebuilt-apps/", "-e", - ".", + str(_PROGRAM_DIR), ] ) if args.dev: # Install dev requirements subprocess.check_call( - pip + ["install", "-r", str(_PROGRAM_DIR / "requirements_dev.txt")] + pip + ["install", "-e", f"{_PROGRAM_DIR}[dev]"] )