diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 225df7f..57b4ffe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,8 +42,8 @@ jobs: - name: Code linting run: | source .venv/bin/activate - ruff check src/zconcurrent tests - ruff format --check src/zconcurrent tests + ruff check src/loamy tests + ruff format --check src/loamy tests - name: Test with pytest run: | source .venv/bin/activate diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a4ca2a..40ce4b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: runs-on: ubuntu-latest environment: name: pypi - url: https://pypi.org/p/zconcurrent # Replace with your PyPI project name + url: https://pypi.org/p/loamy # Replace with your PyPI project name permissions: id-token: write # IMPORTANT: mandatory for trusted publishing @@ -114,7 +114,7 @@ jobs: environment: name: testpypi - url: https://test.pypi.org/p/zconcurrent + url: https://test.pypi.org/p/loamy permissions: id-token: write # IMPORTANT: mandatory for trusted publishing diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f5cefee..5b0254e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,4 +18,4 @@ repos: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - args: [src/zconcurrent/] + args: [src/loamy/] diff --git a/README.md b/README.md index e2a985d..6805d51 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,13 @@ It does not care whether you should do this. It simply allows you to do so if yo The package is available via pip. ```bash -pip install zconcurrent +pip install loamy ``` If you're not on Windows, install the uvloop extra to increase performance. ```bash -pip install "zconcurrent[uvloop]" +pip install "loamy[uvloop]" ``` ## Usage @@ -27,12 +27,12 @@ pip install "zconcurrent[uvloop]" The package can be imported as shown: ```python -from zconcurrent.zsession import zSession, RequestMap, RequestResults +from loamy.session import Clump, RequestMap, RequestResults ``` | Class | Description| | ----- | -----------| -| `zSession` | Session object containing collection of requests to send | +| `Clump` | Container object that stores collection of requests (type RequestMap) to send | | `RequestMap` | Container object that stores all info about an individual request to send | | `RequestResults` | Container object that stores the request responses and any exceptions raised | @@ -57,8 +57,8 @@ req3 = RequestMap( queryParams={"type": "meat-and-filler", "format": "json"}, ) -# Create zSession and call sendRequests() -session = zSession(requestMaps=[req1, req2, req3]) +# Create Clump and call sendRequests() +session = Clump(requests=[req1, req2, req3]) reqResps: RequestResults = session.sendRequests(return_exceptions=True) # Handle exceptions raised for individual requests diff --git a/poetry.lock b/poetry.lock index 7133c50..ead72be 100644 --- a/poetry.lock +++ b/poetry.lock @@ -477,13 +477,13 @@ license = ["ukkonen"] [[package]] name = "idna" -version = "3.5" +version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.5" files = [ - {file = "idna-3.5-py3-none-any.whl", hash = "sha256:79b8f0ac92d2351be5f6122356c9a592c96d81c9a79e4b488bf2a6a15f88057a"}, - {file = "idna-3.5.tar.gz", hash = "sha256:27009fe2735bf8723353582d48575b23c533cc2c2de7b5a68908d91b5eb18d08"}, + {file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"}, + {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 04c1184..527f641 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] -name = "zconcurrent" +name = "loamy" version = "0.0.2.alpha" description = "" authors = ["Zach Fuller "] readme = "README.md" license = "MIT" repository = "https://github.com/fullerzz/zConcurrent" -packages = [{include = "zconcurrent", from = "src"}] +packages = [{include = "loamy", from = "src"}] [tool.poetry.dependencies] python = "^3.10" diff --git a/requirements.txt b/requirements.txt index 53189b4..bd05c3e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -304,9 +304,9 @@ frozenlist==1.4.0 ; python_version >= "3.10" and python_version < "4.0" \ --hash=sha256:f0ed05f5079c708fe74bf9027e95125334b6978bf07fd5ab923e9e55e5fbb9d3 \ --hash=sha256:f61e2dc5ad442c52b4887f1fdc112f97caeff4d9e6ebe78879364ac59f1663e1 \ --hash=sha256:fec520865f42e5c7f050c2a79038897b1c7d1595e907a9e08e3353293ffc948e -idna==3.5 ; python_version >= "3.10" and python_version < "4.0" \ - --hash=sha256:27009fe2735bf8723353582d48575b23c533cc2c2de7b5a68908d91b5eb18d08 \ - --hash=sha256:79b8f0ac92d2351be5f6122356c9a592c96d81c9a79e4b488bf2a6a15f88057a +idna==3.6 ; python_version >= "3.10" and python_version < "4.0" \ + --hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \ + --hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f msgspec==0.18.4 ; python_version >= "3.10" and python_version < "4.0" \ --hash=sha256:227fee75a25080a8b3677cdd95b9c0c3652e27869004a084886c65eb558b3dd6 \ --hash=sha256:241277eed9fd91037372519fca62aecf823f7229c1d351030d0be5e3302580c1 \ diff --git a/src/zconcurrent/__init__.py b/src/loamy/__init__.py similarity index 100% rename from src/zconcurrent/__init__.py rename to src/loamy/__init__.py diff --git a/src/zconcurrent/zsession.py b/src/loamy/session.py similarity index 97% rename from src/zconcurrent/zsession.py rename to src/loamy/session.py index 8eea74d..fd29f77 100644 --- a/src/zconcurrent/zsession.py +++ b/src/loamy/session.py @@ -33,9 +33,9 @@ class RequestResults: taskExceptions: list[BaseException] -class zSession: - def __init__(self, requestMaps: list[RequestMap]) -> None: - self._requestMaps: list[RequestMap] = requestMaps +class Clump: + def __init__(self, requests: list[RequestMap]) -> None: + self._requestMaps: list[RequestMap] = requests def sendRequests(self, return_exceptions: bool = False) -> RequestResults: return asyncRun(self._sendRequests(rtn_exc=return_exceptions)) diff --git a/tests/test_model_validation.py b/tests/test_model_validation.py index f53549d..31ff267 100644 --- a/tests/test_model_validation.py +++ b/tests/test_model_validation.py @@ -1,6 +1,6 @@ from typing import Any -from src.zconcurrent.zsession import RequestMap +from src.loamy.session import RequestMap def test_valid_RequestMap(base_config: dict[str, Any]): diff --git a/tests/test_performance.py b/tests/test_performance.py index 03d4584..c07e15d 100644 --- a/tests/test_performance.py +++ b/tests/test_performance.py @@ -1,4 +1,4 @@ -# from zconcurrent.zsession import zSession, RequestMap +# from loamy.session import Clump, RequestMap # from typing import List # import time # import httpx @@ -15,7 +15,7 @@ # def test_async_requests(): -# session = zSession(requestMaps=sampleRequests) +# session = Clump(requestMaps=sampleRequests) # startTime = time.time() # responses = session.sendRequests() # endTime = time.time()