Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Project to loamy #13

Merged
merged 3 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/zconcurrent # Replace <package-name> with your PyPI project name
url: https://pypi.org/p/loamy # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ repos:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
args: [src/zconcurrent/]
args: [src/loamy/]
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ 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

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 |

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.poetry]
name = "zconcurrent"
name = "loamy"
version = "0.0.2.alpha"
description = ""
authors = ["Zach Fuller <[email protected]>"]
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"
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/zconcurrent/zsession.py → src/loamy/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_validation.py
Original file line number Diff line number Diff line change
@@ -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]):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_performance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# from zconcurrent.zsession import zSession, RequestMap
# from loamy.session import Clump, RequestMap
# from typing import List
# import time
# import httpx
Expand All @@ -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()
Expand Down