Skip to content

Commit dbb16b5

Browse files
authored
switch to pyproject (#341)
* switch to pyproject * fix compatibility between requirements files * add pointless setup.py, fix coverage
1 parent 593a61b commit dbb16b5

11 files changed

Lines changed: 104 additions & 84 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
python-version: '3.10'
2323

24-
- run: pip install -r requirements/linting.txt -r requirements/setup.txt pre-commit
24+
- run: pip install -r requirements/linting.txt -r requirements/pyproject.txt pre-commit
2525

2626
- run: pre-commit run -a
2727

@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
python-version: '3.10'
3838

39-
- run: pip install -r requirements/docs.txt -r requirements/setup.txt
39+
- run: pip install -r requirements/docs.txt -r requirements/pyproject.txt
4040
- run: pip install .
4141

4242
- run: make docs
@@ -78,7 +78,7 @@ jobs:
7878
with:
7979
python-version: ${{ matrix.python }}
8080

81-
- run: pip install -r requirements/testing.txt -r requirements/setup.txt
81+
- run: pip install -r requirements/testing.txt -r requirements/pyproject.txt
8282

8383
- run: make test
8484

@@ -104,15 +104,16 @@ jobs:
104104
python-version: '3.10'
105105

106106
- name: install
107-
run: |
108-
make install
109-
pip install -U wheel twine
107+
run: pip install -U twine build packaging
110108

111-
- name: set version
112-
run: VERSION_PATH='arq/version.py' python <(curl -Ls https://git.io/JT3rm)
109+
- name: check version
110+
id: check-version
111+
run: python <(curl -Ls https://gist.githubusercontent.com/samuelcolvin/4e1ad439c5489e8d6478cdee3eb952ef/raw/check_version.py)
112+
env:
113+
VERSION_PATH: 'arq/version.py'
113114

114115
- name: build
115-
run: python setup.py sdist bdist_wheel
116+
run: python -m build
116117

117118
- run: twine check dist/*
118119

@@ -123,6 +124,7 @@ jobs:
123124
TWINE_PASSWORD: ${{ secrets.pypi_token }}
124125

125126
- name: publish docs
127+
if: '!fromJSON(steps.check-version.outputs.IS_PRERELEASE)'
126128
run: make publish-docs
127129
env:
128130
NETLIFY: ${{ secrets.netlify_token }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017, 2018, 2019, 2020 Samuel Colvin and other contributors
3+
Copyright (c) 2017 - 2022 Samuel Colvin and other contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ black = black arq tests
44

55
.PHONY: install
66
install:
7-
pip install -U pip setuptools pre-commit
7+
pip install -U pip pre-commit
88
pip install -r requirements/all.txt
99
pip install -e .[watch]
1010
pre-commit install
@@ -51,7 +51,6 @@ clean:
5151
rm -f .coverage.*
5252
rm -rf build
5353
make -C docs clean
54-
python setup.py clean
5554

5655
.PHONY: docs
5756
docs:

arq/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .cli import cli
2+
3+
if __name__ == '__main__':
4+
cli()

arq/version.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
__all__ = ['VERSION']
2-
3-
# version is set automatically in CI before release,
4-
# see https://gist.github.com/samuelcolvin/da2f521da5d2195fbfd65da3b8f58589
5-
VERSION = '0.0.dev0'
1+
# Version here is used for the package version via the `[tool.hatch.version]` section of `pyproject.toml`.
2+
VERSION = '0.24.0'

pyproject.toml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,60 @@
1+
[build-system]
2+
requires = ['hatchling']
3+
build-backend = 'hatchling.build'
4+
5+
[tool.hatch.version]
6+
path = 'arq/version.py'
7+
8+
[project]
9+
name = 'arq'
10+
description = 'Job queues in python with asyncio and redis'
11+
authors = [{name = 'Samuel Colvin', email = 's@muelcolvin.com'}]
12+
license = {file = 'LICENSE'}
13+
readme = 'README.md'
14+
classifiers = [
15+
'Development Status :: 5 - Production/Stable',
16+
'Environment :: Console',
17+
'Framework :: AsyncIO',
18+
'Intended Audience :: Developers',
19+
'Intended Audience :: Information Technology',
20+
'Intended Audience :: System Administrators',
21+
'License :: OSI Approved :: MIT License',
22+
'Operating System :: Unix',
23+
'Operating System :: POSIX :: Linux',
24+
'Programming Language :: Python',
25+
'Programming Language :: Python :: 3',
26+
'Programming Language :: Python :: 3 :: Only',
27+
'Programming Language :: Python :: 3.7',
28+
'Programming Language :: Python :: 3.8',
29+
'Programming Language :: Python :: 3.9',
30+
'Programming Language :: Python :: 3.10',
31+
'Programming Language :: Python :: 3.11',
32+
'Topic :: Internet',
33+
'Topic :: Software Development :: Libraries :: Python Modules',
34+
'Topic :: System :: Clustering',
35+
'Topic :: System :: Distributed Computing',
36+
'Topic :: System :: Monitoring',
37+
'Topic :: System :: Systems Administration',
38+
]
39+
requires-python = '>=3.7'
40+
dependencies = [
41+
'redis[hiredis]>=4.2.0',
42+
'click>=8.0',
43+
'typing-extensions>=4.1.0',
44+
]
45+
optional-dependencies = {watch = ['watchfiles>=0.16'] }
46+
dynamic = ['version']
47+
48+
[project.scripts]
49+
arq = 'arq.cli:cli'
50+
51+
[project.urls]
52+
Homepage = 'https://github.com/samuelcolvin/arq'
53+
Documentation = 'https://arq-docs.helpmanual.io'
54+
Funding = 'https://github.com/sponsors/samuelcolvin'
55+
Source = 'https://github.com/samuelcolvin/arq'
56+
Changelog = 'https://github.com/samuelcolvin/arq/releases'
57+
158
[tool.pytest.ini_options]
259
testpaths = 'tests'
360
filterwarnings = ['error']
@@ -7,6 +64,7 @@ timeout = 10
764
[tool.coverage.run]
865
source = ['arq']
966
branch = true
67+
omit = ['arq/__main__.py']
1068

1169
[tool.coverage.report]
1270
precision = 2

requirements/all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-r ./docs.txt
22
-r ./linting.txt
33
-r ./testing.txt
4-
-r ./setup.txt
4+
-r ./pyproject.txt
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# This file is autogenerated by pip-compile with python 3.9
33
# To update, run:
44
#
5-
# pip-compile --extra=watch --output-file=requirements/setup.txt setup.py
5+
# pip-compile --extra=watch --output-file=requirements/pyproject.txt pyproject.toml
66
#
77
anyio==3.6.1
88
# via watchfiles
99
async-timeout==4.0.2
1010
# via redis
1111
click==8.1.3
12-
# via arq (setup.py)
12+
# via arq (pyproject.toml)
1313
deprecated==1.2.13
1414
# via redis
1515
hiredis==2.0.0
@@ -20,13 +20,13 @@ packaging==21.3
2020
# via redis
2121
pyparsing==3.0.9
2222
# via packaging
23-
redis[hiredis]==4.2.2
24-
# via arq (setup.py)
23+
redis[hiredis]==4.3.4
24+
# via arq (pyproject.toml)
2525
sniffio==1.2.0
2626
# via anyio
2727
typing-extensions==4.3.0
28-
# via arq (setup.py)
28+
# via arq (pyproject.toml)
2929
watchfiles==0.16.1
30-
# via arq (setup.py)
30+
# via arq (pyproject.toml)
3131
wrapt==1.14.1
3232
# via deprecated

requirements/testing.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ pytz==2022.2.1
5252
# via
5353
# -r requirements/testing.in
5454
# dirty-equals
55-
redis==4.2.2
56-
# via redislite
55+
# manually removed to avoid conflict with redis version from pyproject.toml
56+
# redis==4.2.2
57+
# # via redislite
5758
redislite==6.2.805324
5859
# via -r requirements/testing.in
5960
termcolor==1.1.0

0 commit comments

Comments
 (0)