Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update setup.py to pyproject.toml #96

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ pubsub
punsubscribe
py
pypi
pyproject
quickstart
readonly
readwrite
Expand All @@ -148,6 +149,7 @@ subcommands
thevalueofmykey
timeseries
toctree
toml
topk
triaging
txt
Expand Down
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
5 changes: 2 additions & 3 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ 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
run: |
python setup.py build
python setup.py sdist bdist_wheel
python -m build -sw

- name: Basic package test prior to upload
run: |
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
4 changes: 2 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Please use
python setup.py install
pip install .

and report errors to via https://github.com/valkey-io/valkey-py/issues/new
and report errors to us via https://github.com/valkey-io/valkey-py/issues/new

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.

97 changes: 97 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
[project]
name = "valkey"
description = "Python client for Valkey forked from redis-py"
readme = "README.md"
keywords = ["Valkey", "key-value store", "database"]
license = { text = "MIT License" }
version = "6.0.2"

authors = [
{ name = "valkey-py authors", email = "[email protected]" }
]

classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]

requires-python = ">=3.8"

dependencies =[
'async-timeout>=4.0.3; python_version<"3.11.3"',
]

[project.optional-dependencies]
libvalkey = ["libvalkey>=4.0.0"]
ocsp = ["cryptography>=36.0.1", "pyopenssl==23.2.1", "requests>=2.31.0"]
dev = [
"black",
"build",
"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"
Documentation = "https://valkey-py.readthedocs.io/en/latest/"
Changes = "https://github.com/valkey-io/valkey-py/releases"
Code = "https://github.com/valkey-io/valkey-py"
"Issue tracker" = "https://github.com/valkey-io/valkey-py/issues"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = [
"valkey",
"valkey._parsers",
"valkey.asyncio",
"valkey.commands",
"valkey.commands.bf",
"valkey.commands.json",
"valkey.commands.search",
"valkey.commands.timeseries",
"valkey.commands.graph",
"valkey.parsers",
]

[tool.setuptools.package-data]
valkey = ["py.typed"]
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

63 changes: 2 additions & 61 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,62 +1,3 @@
#!/usr/bin/env python
from setuptools import find_packages, setup
from setuptools import setup

setup(
name="valkey",
description="Python client for Valkey forked from redis-py",
long_description=open("README.md").read().strip(),
long_description_content_type="text/markdown",
keywords=["Valkey", "key-value store", "database"],
license="MIT",
version="6.0.2",
packages=find_packages(
include=[
"valkey",
"valkey._parsers",
"valkey.asyncio",
"valkey.commands",
"valkey.commands.bf",
"valkey.commands.json",
"valkey.commands.search",
"valkey.commands.timeseries",
"valkey.commands.graph",
"valkey.parsers",
]
),
package_data={"valkey": ["py.typed"]},
include_package_data=True,
url="https://github.com/valkey-io/valkey-py",
project_urls={
"Documentation": "https://valkey-py.readthedocs.io/en/latest/",
"Changes": "https://github.com/valkey-io/valkey-py/releases",
"Code": "https://github.com/valkey-io/valkey-py",
"Issue tracker": "https://github.com/valkey-io/valkey-py/issues",
},
author="valkey-py authors",
author_email="[email protected]",
python_requires=">=3.8",
install_requires=[
'async-timeout>=4.0.3; python_version<"3.11.3"',
],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
extras_require={
"libvalkey": ["libvalkey>=4.0.0"],
"ocsp": ["cryptography>=36.0.1", "pyopenssl==23.2.1", "requests>=2.31.0"],
},
)
setup()
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -91,4 +91,4 @@ def clean(c):
@task
def package(c):
"""Create the python packages"""
run("python setup.py sdist bdist_wheel")
run("python -m build -sw")
Loading