From f99f31923ae9f182f3212af7a990fb9bed6f34eb Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Fri, 15 Nov 2024 14:53:45 -0500 Subject: [PATCH] build: remove all the stale requirements*.txt files --- .github/workflows/matrix-tests.yml | 3 +-- .github/workflows/tests.yml | 13 ++----------- .pre-commit-config.yaml | 2 +- Contributing.md | 8 ++++---- README.md | 2 +- docs/requirements.txt | 1 - pyproject.toml | 5 +++++ readalongs/web_api.py | 2 +- requirements.api.txt | 7 ------- requirements.ci.txt | 4 ---- requirements.dev.txt | 14 -------------- requirements.min.txt | 16 ---------------- requirements.txt | 4 ---- 13 files changed, 15 insertions(+), 66 deletions(-) delete mode 100644 requirements.api.txt delete mode 100644 requirements.ci.txt delete mode 100644 requirements.dev.txt delete mode 100644 requirements.min.txt delete mode 100644 requirements.txt diff --git a/.github/workflows/matrix-tests.yml b/.github/workflows/matrix-tests.yml index 987bf3eb..384dd114 100644 --- a/.github/workflows/matrix-tests.yml +++ b/.github/workflows/matrix-tests.yml @@ -23,7 +23,6 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Python dependencies run: | - pip install wheel - pip install -r requirements.txt -r requirements.dev.txt -r requirements.ci.txt -e . + pip install -e .[all] - name: Run tests run: cd test && python run.py prod diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6625b8ed..d2249df7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,13 +24,8 @@ jobs: run: | # Keep pip up to date python -m pip install --upgrade pip - # Some dependencies are built using wheel - pip install wheel # Install all Python dependencies in just one pip call, including Studio itself - pip install -r requirements.txt \ - -r requirements.dev.txt \ - -r requirements.ci.txt \ - -e . + pip install -e .[all] - name: Run tests run: | @@ -106,11 +101,7 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install wheel - pip install -r requirements.txt ` - -r requirements.dev.txt ` - -r requirements.ci.txt ` - -e . + pip install -e .[all] - name: Run tests on Windows run: cd test && python run.py prod diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 789d5ad6..9ac26e15 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: exclude: \.svg$ - repo: local # Using local repos because these won't work for me from remote repo -EJ - # They're also more convenient because we install them via requirements.dev.txt + # They're also more convenient because we install them via .[dev] in pyproject.toml # and they are then available on the command line as well as in pre-commit. hooks: - id: isort diff --git a/Contributing.md b/Contributing.md index 7013855b..3167e91f 100644 --- a/Contributing.md +++ b/Contributing.md @@ -16,7 +16,7 @@ commits. Run these commands in each of your sandboxes to enable our pre-commit hooks and commitlint: ```sh -pip install -r requirements.dev.txt +pip install -e .[dev] pre-commit install gitlint install-hook ``` @@ -49,10 +49,10 @@ All the pre-commit hooks are executed using a tool called hooks each time you try to commit anything in this repo. We've listed all the developper dependencies for the project in -[requirements.dev.txt](requirements.dev.txt) to make them easy to install: +[pyproject.toml](pyproject.toml) to make them easy to install: ```sh -pip install -r requirements.dev.txt +pip install -e .[dev] pre-commit install ``` @@ -114,7 +114,7 @@ commit-msg hook in Git. Run this command in your g2p sandbox to install and enable the commit-msg hook: ```sh -pip install -r requirements/requirements.dev.txt +pip install -e .[dev] gitlint install-hook ``` diff --git a/README.md b/README.md index 80ef8b3d..1d5e23e9 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ This repo follows the [Contributor Covenant](http://contributor-covenant.org/ver You can install our standard Git hooks by running these commands in your sandbox: ```sh -pip install -r requirements.dev.txt +pip install -e .[dev] pre-commit install gitlint install-hook ``` diff --git a/docs/requirements.txt b/docs/requirements.txt index 251201ca..f495fb7f 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,4 +4,3 @@ mkdocs-material>=9.5.27 mkdocs-autorefs>=1.0.1 mkdocstrings[python]>=0.25.1 mike>=2.1.1 --r ../requirements.min.txt diff --git a/pyproject.toml b/pyproject.toml index df03aa7f..0e0d70e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,6 +85,11 @@ ci = [ "pip-licenses", ] +all = [ + "readalongs[dev]", + "readalongs[ci]", +] + [project.scripts] readalongs = "readalongs.cli:cli" diff --git a/readalongs/web_api.py b/readalongs/web_api.py index 30ff8126..27cb234c 100644 --- a/readalongs/web_api.py +++ b/readalongs/web_api.py @@ -20,7 +20,7 @@ (or in a dashboard) and will depend on your hosting environment. You can also spin up the API server grade (on Linux, not Windows) with gunicorn: - pip install -r requirements.api.txt + pip install -e .[api] gunicorn -w 4 -k uvicorn.workers.UvicornWorker readalongs.web_api:web_api_app Once spun up, the documentation and API playground will be visible at diff --git a/requirements.api.txt b/requirements.api.txt deleted file mode 100644 index 47074bea..00000000 --- a/requirements.api.txt +++ /dev/null @@ -1,7 +0,0 @@ -# These are dependencies required by the production Web API -# gunivorn is only available on *nix, but it's only required for production deployments -gunicorn>=23.0.0 -# uvicorn works on all platforms and is required for both dev and prod deployments -uvicorn>=0.30.1 -# For deployment on Heroku, we want the latest g2p off GitHub -g2p @ git+https://github.com/roedoejet/g2p.git@main diff --git a/requirements.ci.txt b/requirements.ci.txt deleted file mode 100644 index d108cc3a..00000000 --- a/requirements.ci.txt +++ /dev/null @@ -1,4 +0,0 @@ -# These are dependencies required by our continuous integration and testing pipelines -coverage -pip-licenses --r requirements.api.txt diff --git a/requirements.dev.txt b/requirements.dev.txt deleted file mode 100644 index fddc063c..00000000 --- a/requirements.dev.txt +++ /dev/null @@ -1,14 +0,0 @@ -# This is a set of development dependencies -black~=24.3 -flake8>=4.0.1 -gitlint-core>=0.17.0 -httpx>=0.24.1 -isort>=5.10.1 -mypy>=1.4.1 -mypy>=1.5.1; python_version >= "3.8" -pep440>=0.1.2 -pre-commit>=2.6.0 -types-python-slugify>=5.0.3 -types-pyyaml>=6.0.5 -types-requests>=2.31.0 -types-setuptools>=57.4.9 diff --git a/requirements.min.txt b/requirements.min.txt deleted file mode 100644 index ac33550c..00000000 --- a/requirements.min.txt +++ /dev/null @@ -1,16 +0,0 @@ -# This is the minimal set of dependencies required for the readalongs package -audioop-lts; python_version>='3.13' -chevron==0.14.0 -click>=8.0.4 -coloredlogs>=10.0 -fastapi>=0.103.0 -g2p>=1.1.20230822, <3 -lxml>=4.9.4 -numpy>=1.20.2 -pydantic>=1.8.2,<3 -pydub>=0.23.1 -pympi-ling>=1.69,<2.0 -python-slugify==5.0.0 -requests>=2.31.0 -soundswallower~=0.6.0 -webvtt-py==0.4.2 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 89c49607..00000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Heroku can only read requirements from "requirements.txt", -# so we separate the minimal library from the rest of the dependencies. --r requirements.min.txt --r requirements.api.txt