From 03aa5bd1382f323203913e94e091bbe1787e29d1 Mon Sep 17 00:00:00 2001 From: wkpn Date: Mon, 14 Dec 2020 14:56:19 +0300 Subject: [PATCH] 3.2.0 --- CHANGELOG-ru.rst | 8 ++++++++ CHANGELOG.rst | 7 +++++++ LICENSE | 2 +- README-ru.rst | 1 + README.rst | 1 + aio2ch/__version__.py | 2 +- examples/basic_usage.py | 2 +- requirements.txt | 2 +- setup.py | 3 ++- tests/conftest.py | 10 +++++----- tests/test_exceptions.py | 2 +- tests/test_helpers.py | 4 ++-- tests/test_posts.py | 2 +- 13 files changed, 32 insertions(+), 14 deletions(-) diff --git a/CHANGELOG-ru.rst b/CHANGELOG-ru.rst index 2df6092..3c08e6a 100644 --- a/CHANGELOG-ru.rst +++ b/CHANGELOG-ru.rst @@ -1,6 +1,14 @@ Изменения ========= +`3.2.0` +------- + +* апдейт версии `httpx` +* апдейт тестов + + + `3.1.2` ------- diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 06bbba3..f08153a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ Changelog ========= +`3.2.0` +------- + +* bump `httpx` version +* update tests + + `3.1.2` ------- diff --git a/LICENSE b/LICENSE index 98a8175..72e4b42 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2020 https://github.com/wkpn +Copyright (c) 2018-present https://github.com/wkpn Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README-ru.rst b/README-ru.rst index 1e5f4a6..66fdeb4 100644 --- a/README-ru.rst +++ b/README-ru.rst @@ -48,6 +48,7 @@ >>> async with Api() as client: ... boards = await client.get_boards() + >>> ... Получить все доски diff --git a/README.rst b/README.rst index c511184..de66949 100644 --- a/README.rst +++ b/README.rst @@ -48,6 +48,7 @@ Or you can use it as a context manager >>> async with Api() as client: ... boards = await client.get_boards() + >>> ... Get all boards diff --git a/aio2ch/__version__.py b/aio2ch/__version__.py index 911557b..1173108 100644 --- a/aio2ch/__version__.py +++ b/aio2ch/__version__.py @@ -1 +1 @@ -__version__ = "3.1.2" +__version__ = "3.2.0" diff --git a/examples/basic_usage.py b/examples/basic_usage.py index d3ebcad..d97f83a 100644 --- a/examples/basic_usage.py +++ b/examples/basic_usage.py @@ -17,7 +17,7 @@ async def main(): keywords_threads = await client.get_board_threads(board="test", keywords=("keywords", "to", "search", "for")) # ok, we know for sure that this thread (https://2ch.hk/test/res/30972.html) has some media in it, lets get it - thread_media = await client.get_thread_media(30972, "test") + thread_media = await client.get_thread_media(31814, "test") # thread_media is a list of Files, lets save them to our folder (make sure it exists first) await client.download_thread_media(thread_media, save_to="./downloads") diff --git a/requirements.txt b/requirements.txt index dbac9ff..d22b422 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -httpx==0.13.* +httpx[http2]==0.16.* aiofiles click \ No newline at end of file diff --git a/setup.py b/setup.py index a3eb1ab..c083ca7 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,8 @@ def get_packages(package): "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8" + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9" ], entry_points={ "console_scripts": [ diff --git a/tests/conftest.py b/tests/conftest.py index bc31095..419c0b7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -48,10 +48,10 @@ def board(): @pytest.fixture -def thread(): +def thread(thread_as_number): test_thread_data = { "comment": "", - "num": 30972, + "num": thread_as_number, "posts_count": "", "score": "", "subject": "", @@ -65,12 +65,12 @@ def thread(): @pytest.fixture def thread_as_number(): - return 30972 + return 31814 @pytest.fixture -def thread_url(): - return "https://2ch.hk/test/res/30972.html" +def thread_url(thread_as_number): + return f"https://2ch.hk/test/res/{thread_as_number}.html" @pytest.fixture diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index e2f5341..90855cc 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -21,7 +21,7 @@ async def test_get_top_board_threads_invalid_board(client, invalid_board): @pytest.mark.asyncio -async def test_get_top_board_threads_str_wrong_sort_method(client): +async def test_get_top_board_threads_str_wrong_sort_method(client, board): with pytest.raises(WrongSortMethodException): await client.get_top_board_threads(board="test", method="WrongSortMethod") diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 77ed4a4..046f681 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -7,8 +7,8 @@ def test_clean_html_tags(raw_text, clean_text): assert clean == clean_text -def test_get_board_and_thread_from_url(thread_url): +def test_get_board_and_thread_from_url(thread_url, thread_as_number): board, thread = get_board_and_thread_from_url(thread_url) assert board == "test" - assert thread == "30972" + assert thread == f"{thread_as_number}" diff --git a/tests/test_posts.py b/tests/test_posts.py index 50dadb4..da091b1 100644 --- a/tests/test_posts.py +++ b/tests/test_posts.py @@ -35,7 +35,7 @@ async def test_get_thread_posts_with_status_by_url(client, thread_url): @pytest.mark.asyncio async def test_get_thread_posts_with_board_instance(client, thread_as_number, board): - posts = await client.get_thread_posts(30972, board=board) + posts = await client.get_thread_posts(thread_as_number, board=board) assert all(isinstance(post, Post) for post in posts)