Skip to content

Commit

Permalink
Move requirements into pyproject.toml
Browse files Browse the repository at this point in the history
Signed-off-by: ds-cbo <[email protected]>
Signed-off-by: C. Bo <[email protected]>
  • Loading branch information
ds-cbo committed Sep 18, 2024
1 parent 3c4169a commit 063138a
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/install_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
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.
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
version: 2

python:
install:
- requirements: ./docs/requirements.txt
- requirements: requirements.txt

build:
os: ubuntu-20.04
tools:
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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.
Expand Down
17 changes: 0 additions & 17 deletions dev_requirements.txt

This file was deleted.

8 changes: 0 additions & 8 deletions docs/requirements.txt

This file was deleted.

29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down

0 comments on commit 063138a

Please sign in to comment.