Skip to content

Commit

Permalink
Store project metadata in pyproject.toml (PEP 621) (#1952)
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson authored and selwin committed Feb 24, 2024
1 parent efd4bd8 commit 0935f47
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 134 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
pip install redis==${{ matrix.redis-py-version }}
pip install -r requirements.txt -r dev-requirements.txt
pip install -e .
- name: Test with pytest
run: |
RUN_SLOW_TESTS_TOO=1 pytest --durations=5
RUN_SLOW_TESTS_TOO=1 hatch run test:pytest --durations=5
dependency-build:
name: Check development branches of dependencies
Expand Down Expand Up @@ -68,13 +67,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/redis/redis-py
pip install git+https://github.com/pallets/click
pip install -r dev-requirements.txt
pip install -e .
pip install hatch
- name: Test with pytest
run: RUN_SLOW_TESTS_TOO=1 pytest --durations=5 > log.txt 2>&1
run: RUN_SLOW_TESTS_TOO=1 hatch run test:pytest --durations=5 > log.txt 2>&1

- uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:


permissions:
contents: read write # to fetch code (actions/checkout)
contents: write # to fetch code (actions/checkout)
packages: write

jobs:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: addnab/docker-run-action@v3
with:
image: rqtest-image:latest
run: stunnel & redis-server & RUN_SSL_TESTS=1 tox run -e ssl
run: stunnel & redis-server & RUN_SSL_TESTS=1 hatch run tox run -e ssl

test:
name: Python${{ matrix.python-version }}/Redis${{ matrix.redis-version }}/redis-py${{ matrix.redis-py-version }}
Expand Down Expand Up @@ -53,13 +53,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
pip install redis==${{ matrix.redis-py-version }}
pip install -r requirements.txt -r dev-requirements.txt
pip install -e .
- name: Test with pytest
run: |
RUN_SLOW_TESTS_TOO=1 pytest --cov=rq --cov-config=.coveragerc --cov-report=xml --durations=5
RUN_SLOW_TESTS_TOO=1 hatch run test:cov --durations=5
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ repos:
rev: "v0.0.267"
hooks:
- id: ruff
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.12.0
hooks:
- id: pyproject-fmt
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

6 changes: 0 additions & 6 deletions dev-requirements-36.txt

This file was deleted.

6 changes: 0 additions & 6 deletions dev-requirements.txt

This file was deleted.

95 changes: 93 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,97 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling",
]

[project]
name = "rq"
description = "RQ is a simple, lightweight, library for creating background jobs, and processing them."
readme = "README.md"
license = "BSD-2-Clause"
maintainers = [
{name = "Selwin Ong"},
]
authors = [
{ name = "Vincent Driessen", email = "vincent@3rdcloud.com" },
]
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: BSD License",
"Operating System :: MacOS",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Internet",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Distributed Computing",
"Topic :: System :: Monitoring",
"Topic :: System :: Systems Administration",
]
dynamic = [
"version",
]
dependencies = [
"click>=5",
"redis>=3.5",
]
[project.urls]
changelog = "https://github.com/rq/rq/blob/master/CHANGES.md"
documentation = "https://python-rq.org/docs/"
homepage = "https://python-rq.org/"
repository = "https://github.com/rq/rq/"
[project.scripts]
rq = "rq.cli:main"
rqinfo = "rq.cli:info" # TODO [v2]: Remove
rqworker = "rq.cli:worker" # TODO [v2]: Remove

[tool.hatch.version]
path = "rq/version.py"

[tool.hatch.build.targets.sdist]
include = [
"/docs",
"/rq",
"/tests",
"CHANGES.md",
"LICENSE",
"pyproject.toml",
"README.md",
"requirements.txt",
"tox.ini",
]

[tool.hatch.envs.test]
dependencies = [
"black",
"coverage",
"packaging",
"psutil",
"pytest",
"pytest-cov",
"ruff",
"sentry-sdk",
"tox",
]
[tool.hatch.envs.test.scripts]
cov = "pytest --cov=rq --cov-config=.coveragerc --cov-report=xml {args:tests}"

[tool.black]
line-length = 120
target-version = ['py38']
target-version = ["py38"]
skip-string-normalization = true

[tool.ruff]
Expand All @@ -13,7 +104,7 @@ select = [
"W", # pycodestyle warnings
]
line-length = 120 # To match black.
target-version = 'py38'
target-version = "py38"

[tool.ruff.isort]
known-first-party = ["rq"]
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

88 changes: 0 additions & 88 deletions setup.py

This file was deleted.

7 changes: 2 additions & 5 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ WORKDIR /tmp/rq

RUN set -e && \
python3 -m pip install --upgrade pip && \
python3 -m pip install --no-cache-dir tox && \
pip3 install -r /tmp/rq/requirements.txt -r /tmp/rq/dev-requirements.txt && \
python3 /tmp/rq/setup.py build && \
python3 /tmp/rq/setup.py install
python3 -m pip install --no-cache-dir hatch tox

CMD stunnel \
& redis-server \
& RUN_SLOW_TESTS_TOO=1 RUN_SSL_TESTS=1 tox
& RUN_SLOW_TESTS_TOO=1 RUN_SSL_TESTS=1 hatch run tox
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ envlist=py36,py37,py38,py39,py310
[testenv]
commands=pytest --cov rq --cov-config=.coveragerc --durations=5 {posargs}
deps=
codecov
psutil
pytest
pytest-cov
sentry-sdk
codecov
psutil
passenv=
RUN_SSL_TESTS

Expand Down

0 comments on commit 0935f47

Please sign in to comment.