Skip to content

Commit

Permalink
✨ Support 3.9 (#35)
Browse files Browse the repository at this point in the history
* ✨ add support for python 3.9

* ✅ update tests to support multiple versions of python

* 📝 update docs for references to the proper version

* 📌 update lockfile
  • Loading branch information
itsthejoker committed May 18, 2023
1 parent 88069a4 commit 5e13c2d
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 239 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,24 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
# By default, GitHub will maximize the number of jobs run in parallel
# depending on the available runners on GitHub-hosted virtual machines.
# max-parallel: 8
fail-fast: false
matrix:
include:
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"

steps:
- name: Checkout current branch
uses: actions/checkout@v2
- name: Set up Python 3.11
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.11.x'
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ An easy way to mock Snowflake connections in Python!

## What is this?

`asbestos` is a library to allow easy mocking of Snowflake calls during local development or testing to save on costs and time. The docs have more information, but here's a quick example:
`asbestos` is a library for Python 3.9+ to allow easy mocking of Snowflake calls during local development or testing to save on costs and time. The docs have more information, but here's a quick example:

```python
from asbestos import asbestos_cursor, config as asbestos_config
Expand Down
6 changes: 3 additions & 3 deletions asbestos/asbestos.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import random
from typing import Any, Optional
from typing import Any, Optional, Union

from asbestos.exceptions import AsbestosDuplicateQuery, AsbestosMissingConfig

Expand Down Expand Up @@ -44,7 +44,7 @@ def __init__(
) -> None:
self.query: str = query
self.data: Optional[tuple[Any]] = data
self.response: dict[Any] | list[dict[Any]] = response
self.response: Union[dict[Any], list[dict[Any]]] = response
self.ephemeral: bool = ephemeral
self.sfqid: int = 0
self.force_pagination_size = force_pagination_size
Expand Down Expand Up @@ -323,7 +323,7 @@ def execute_async(self, *args, **kwargs) -> None:
"""Functions the same as `.execute()`."""
self.execute(*args, **kwargs)

def _get(self, remove_ephemeral: bool = True) -> dict | list[dict]:
def _get(self, remove_ephemeral: bool = True) -> Union[dict, list[dict]]:
resp = self.config.lookup_query(self.query, self.data)
if remove_ephemeral:
self.config.remove_ephemeral_response(resp)
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A mock data system for [Snowflake](https://www.snowflake.com/en/). Test your cod

## Installation

Grab it from PyPI with `pip install asbestos-snow` or `poetry add asbestos-snow`. This is a pure Python package and has no required dependencies of its own. Asbestos takes advantage of modern language features and only supports Python 3.10+.
Grab it from PyPI with `pip install asbestos-snow` or `poetry add asbestos-snow`. This is a pure Python package and has no required dependencies of its own. Asbestos takes advantage of modern language features and only supports Python 3.9+.

!!! note

Expand Down
Loading

0 comments on commit 5e13c2d

Please sign in to comment.