Skip to content

Commit

Permalink
Switch to PEP 517 packaging using hatchling
Browse files Browse the repository at this point in the history
Refs #1316
Refs #1649
Remake of #2388

Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
  • Loading branch information
akx and ofek committed Sep 5, 2023
1 parent e3de026 commit ce1d2fe
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 91 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 -e . -r dev_requirements.txt -r docs/requirements.txt
invoke build-docs
- name: upload docs
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
- uses: actions/checkout@v3
- uses: pypa/gh-action-pip-audit@v1.0.8
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.
inputs: .

lint:
name: Code linters
Expand Down Expand Up @@ -72,8 +72,7 @@ jobs:
- name: run tests
run: |
pip install -U setuptools wheel
pip install -r requirements.txt
pip install -r dev_requirements.txt
pip install -e . -r dev_requirements.txt
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
pip install hiredis
fi
Expand Down Expand Up @@ -127,8 +126,7 @@ jobs:
- name: run tests
run: |
pip install -U setuptools wheel
pip install -r requirements.txt
pip install -r dev_requirements.txt
pip install -e . -r dev_requirements.txt
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
pip install hiredis
fi
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ jobs:
pip install twine wheel
- name: Build package
run: |
python setup.py build
python setup.py sdist bdist_wheel
run: python -m build .
- name: Publish to Pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Here's how to get started with your code contribution:
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 -e .

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 Down
6 changes: 0 additions & 6 deletions INSTALL

This file was deleted.

6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
click==8.0.4
build>=0.8.0
black==22.3.0
flake8==5.0.4
flake8-isort==6.0.0
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ source .venv/bin/active
**Step 3**. Install dependencies:

```shell
pip install -r requirements.txt
pip install -e .
```

**Step 4**. Start the services using Docker and make sure Uptrace is running:
Expand Down
60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "redis"
version = "5.0.0"
description = "Python client for Redis database and key-value store"
readme = "README.md"
license = "MIT"
requires-python = ">=3.8"
authors = [
{ name = "Redis Inc.", email = "oss@redis.com" },
]
keywords = [
"Redis",
"database",
"key-value-store",
]
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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"async-timeout>=4.0.2; python_full_version<=\"3.11.2\"",
]

[project.optional-dependencies]
hiredis = [
"hiredis>=1.0.0",
]
ocsp = [
"cryptography>=36.0.1",
"pyopenssl==20.0.1",
"requests>=2.26.0",
]

[project.urls]
Changes = "https://github.com/redis/redis-py/releases"
Code = "https://github.com/redis/redis-py"
Documentation = "https://redis.readthedocs.io/en/latest/"
Homepage = "https://github.com/redis/redis-py"
"Issue tracker" = "https://github.com/redis/redis-py/issues"

[tool.hatch.build.targets.sdist]
include = [
"/redis",
]
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

64 changes: 0 additions & 64 deletions setup.py

This file was deleted.

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

0 comments on commit ce1d2fe

Please sign in to comment.