diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index e1ed369a..96e6df66 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -36,7 +36,7 @@ jobs: sudo apt-get install -yqq pandoc make - name: run code linters run: | - pip install -r requirements.txt -r dev_requirements.txt -r docs/requirements.txt + pip install '.[dev,docs]' invoke build-docs - name: upload docs diff --git a/.github/workflows/install_and_test.sh b/.github/workflows/install_and_test.sh index 99852513..539fa915 100755 --- a/.github/workflows/install_and_test.sh +++ b/.github/workflows/install_and_test.sh @@ -20,7 +20,7 @@ fi python -m venv ${DESTENV} source ${DESTENV}/bin/activate pip install --upgrade --quiet pip -pip install --quiet -r dev_requirements.txt +pip install --quiet '.[dev]' invoke devenv invoke package diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 207aa4ba..ef154014 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -32,7 +32,6 @@ jobs: - uses: actions/checkout@v4 - uses: pypa/gh-action-pip-audit@v1.1.0 with: - inputs: requirements.txt dev_requirements.txt ignore-vulns: | GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here. @@ -47,7 +46,7 @@ jobs: cache: 'pip' - name: run code linters run: | - pip install -r dev_requirements.txt + pip install '.[dev]' invoke linters populate-cache: @@ -105,8 +104,7 @@ jobs: - name: run tests run: | pip install -U setuptools wheel - pip install -r requirements.txt - pip install -r dev_requirements.txt + pip install '.[dev]' if [ "${{matrix.connection-type}}" == "libvalkey" ]; then pip install "libvalkey>=4.0.0" fi diff --git a/.github/workflows/pypi-publish.yaml b/.github/workflows/pypi-publish.yaml index ddc32c4c..f2cf0fab 100644 --- a/.github/workflows/pypi-publish.yaml +++ b/.github/workflows/pypi-publish.yaml @@ -22,7 +22,7 @@ jobs: python-version: 3.9 - name: Install dev tools run: | - pip install -r dev_requirements.txt + pip install '.[dev]' pip install twine wheel - name: Build package diff --git a/.readthedocs.yml b/.readthedocs.yml index 800cb148..6a0e79f3 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,10 +1,5 @@ version: 2 -python: - install: - - requirements: ./docs/requirements.txt - - requirements: requirements.txt - build: os: ubuntu-20.04 tools: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 939b3da1..74ccfe3f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,12 +89,11 @@ Here's how to get started with your code contribution: 1. Create your own fork of valkey-py 2. Do the changes in your fork 3. - *Create a virtualenv and install the development dependencies from the dev_requirements.txt file:* + *Create a virtualenv and install the development dependencies:* a. python -m venv .venv b. source .venv/bin/activate - c. pip install -r dev_requirements.txt - c. pip install -r requirements.txt + c. pip install '.[dev]' 4. If you need a development environment, run `invoke devenv`. Note: this relies on docker-compose to build environments, and assumes that you have a version supporting [docker profiles](https://docs.docker.com/compose/profiles/). 5. While developing, make sure the tests pass by running `invoke tests` @@ -106,7 +105,7 @@ To see what else is part of the automation, run `invoke -l` ## The Development Environment Running `invoke devenv` installs the development dependencies specified -in the dev_requirements.txt. It starts all of the dockers used by this +in pyproject.toml. It starts all of the dockers used by this project, and leaves them running. These can be easily cleaned up with `invoke clean`. NOTE: it is assumed that the user running these tests, can execute docker and its various commands. diff --git a/dev_requirements.txt b/dev_requirements.txt deleted file mode 100644 index c56d2483..00000000 --- a/dev_requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -black -cachetools -click -flake8-isort -flake8 -flynt -invoke -mock -packaging>=20.4 -pytest -pytest-asyncio -pytest-cov -pytest-timeout -ujson>=4.2.0 -uvloop -vulture>=2.3.0 -wheel>=0.30.0 diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 5b15c092..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -sphinx>=5.0,<7.0 -docutils<0.18 -nbsphinx -sphinx_gallery -ipython -sphinx-autodoc-typehints -furo -pandoc diff --git a/pyproject.toml b/pyproject.toml index 74f1f1b4..3243f0ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,35 @@ dependencies =[ [project.optional-dependencies] libvalkey = ["libvalkey>=4.0.0"] ocsp = ["cryptography>=36.0.1", "pyopenssl==23.2.1", "requests>=2.31.0"] +dev = [ + "black", + "cachetools", + "click", + "flake8-isort", + "flake8", + "flynt", + "invoke", + "mock", + "packaging>=20.4", + "pytest", + "pytest-asyncio", + "pytest-cov", + "pytest-timeout", + "ujson>=4.2.0", + "uvloop", + "vulture>=2.3.0", + "wheel>=0.30.0", +] +docs = [ + "sphinx>=5.0,<7.0", + "docutils<0.18", + "nbsphinx", + "sphinx_gallery", + "ipython", + "sphinx-autodoc-typehints", + "furo", + "pandoc", +] [project.urls] Homepage = "https://github.com/valkey-io/valkey-py" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index c919607e..00000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -async-timeout>=4.0.3; python_version<"3.11.3" diff --git a/tasks.py b/tasks.py index 4769a035..f138966f 100644 --- a/tasks.py +++ b/tasks.py @@ -20,7 +20,7 @@ def devenv(c): @task def build_docs(c): """Generates the sphinx documentation.""" - run("pip install -r docs/requirements.txt") + run("pip install '.[docs]'") run("make -C docs html")