Skip to content

Commit

Permalink
Drop Python 3.6 and nose, test on 3.10 and 3.11 (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra authored May 4, 2023
1 parent c5dc852 commit 7c41a1d
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v1
Expand Down
10 changes: 5 additions & 5 deletions asynq/batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ def _try_switch_active_batch(self):
def __str__(self):
return "%s (%s, %i items)" % (
core_inspection.get_full_name(type(self)),
"cancelled"
if self.is_cancelled()
else "flushed"
if self.is_flushed()
else "pending",
(
"cancelled"
if self.is_cancelled()
else "flushed" if self.is_flushed() else "pending"
),
len(self.items),
)

Expand Down
2 changes: 1 addition & 1 deletion asynq/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def filter_traceback(tb_list):
did_replacement = False
# for each replacement, try checking if all lines match
# if so, replace with the given replacement
for (text_to_match, replacement) in REPLACEMENTS:
for text_to_match, replacement in REPLACEMENTS:
matches = True
j = 0
while j < len(text_to_match) and (i + j) < len(tb_list):
Expand Down
2 changes: 1 addition & 1 deletion asynq/tests/test_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def test_start_stop():


class TestPatchMethodWithMethod(object):
def setup(self):
def setup_method(self):
self.calls = []

def mock_method(self, foo):
Expand Down
1 change: 0 additions & 1 deletion asynq/tests/test_scoped_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def async_scoped_value_caller():


def test_async_scoped_value():

async_scoped_value_caller()

val = AsyncScopedValue("capybara")
Expand Down
4 changes: 1 addition & 3 deletions asynq/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,7 @@ def fn(foo, bar, baz=None, **kwargs):

decorated = aretry(Exception)(fn)

assert_eq(
inspect.getargspec(fn), inspect.getargspec(get_original_fn(decorated))
)
assert_eq(inspect.signature(fn), inspect.signature(get_original_fn(decorated)))


class Ctx(AsyncContext):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
target_version = ['py36', 'py37', 'py38', 'py39']
include = '\.pyi?$'
skip-magic-trailing-comma = true
experimental-string-processing = true
preview = true

exclude = '''
/(
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
nose==1.3.7
pytest
Cython>=0.27.1
qcore
pygments
black==22.8.0; python_version >= "3.6"
mypy==0.971
black==23.3.0
mypy==1.2.0
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"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",
],
keywords="quora asynq common utility",
packages=["asynq", "asynq.tests"],
Expand Down
11 changes: 6 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
minversion=2.3.1
envlist =
py36,py37,py38,py39
py37,py38,py39,py310,py311
mypy
black
skip_missing_interpreters = True
Expand All @@ -11,10 +11,10 @@ deps =
-rrequirements.txt

commands =
nosetests asynq
pytest asynq

[testenv:mypy]
basepython = python3.6
basepython = python3.7
deps =
-rrequirements.txt

Expand All @@ -27,7 +27,8 @@ commands =

[gh-actions]
python =
3.6: py36, mypy
3.7: py37
3.7: py37, mypy
3.8: py38
3.9: py39, black
3.10: py310
3.11: py311

0 comments on commit 7c41a1d

Please sign in to comment.