Skip to content

Commit 5e03762

Browse files
committed
Add circleci build, change version.
1 parent 085f330 commit 5e03762

File tree

3 files changed

+82
-3
lines changed

3 files changed

+82
-3
lines changed

.circleci/config.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
version: 2.1
2+
3+
orbs:
4+
python: circleci/[email protected]
5+
gcp-cli: circleci/[email protected]
6+
7+
parameters:
8+
google-project-id:
9+
type: string
10+
default: "ce-builder"
11+
ar-repo-name:
12+
type: string
13+
default: "python"
14+
ar-repo-region:
15+
type: string
16+
default: "us"
17+
18+
commands:
19+
trunk-check:
20+
steps:
21+
- restore_cache:
22+
key: v1-trunk-check-{{ checksum ".trunk/trunk.yaml" }}
23+
- run:
24+
name: trunk check
25+
command: tools/trunk check --ci
26+
- save_cache:
27+
key: v1-trunk-check-{{ checksum ".trunk/trunk.yaml" }}
28+
paths:
29+
- "~/.cache/trunk"
30+
31+
jobs:
32+
build-test-and-publish:
33+
docker:
34+
- image: cimg/python:3.8
35+
environment:
36+
GOOGLE_PROJECT_ID: << pipeline.parameters.google-project-id >>
37+
AR_REPO_NAME: << pipeline.parameters.ar-repo-name >>
38+
AR_REPO_REGION: << pipeline.parameters.ar-repo-region >>
39+
steps:
40+
- checkout
41+
# - trunk-check
42+
- run:
43+
name: Merge requirements
44+
command: cat requirements.txt requirements-dev.txt > requirements-merged.txt
45+
- python/install-packages:
46+
pkg-manager: pip
47+
pip-dependency-file: requirements-merged.txt
48+
- run:
49+
name: Install package for tests
50+
command: pip install .
51+
- run:
52+
name: Run tests
53+
command: |
54+
mkdir test-results
55+
pytest --junitxml=test-results/junit.xml
56+
- store_test_results:
57+
path: test-results
58+
- run:
59+
name: Build package
60+
# command: python -m build
61+
command: python setup.py sdist bdist_wheel
62+
- gcp-cli/install:
63+
version: 382.0.0
64+
- gcp-cli/initialize
65+
- run:
66+
name: Upload package to AR
67+
command: >-
68+
twine upload
69+
--repository-url "https://$AR_REPO_REGION-python.pkg.dev/$GOOGLE_PROJECT_ID/$AR_REPO_NAME/"
70+
--skip-existing
71+
dist/*
72+
73+
workflows:
74+
build-and-publish:
75+
jobs:
76+
- build-test-and-publish:
77+
filters:
78+
tags:
79+
only: /((v\d+(\.\d+){0,2}[^\+]*)|(0.0))(\+.*)?/

src/fastapi_redis_cache/cache.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def standard_wrapper(func):
8787
async def inner_wrapper_async(*args, **kwargs):
8888
"""Return cached value if one exists, otherwise evaluate the wrapped function and cache the result."""
8989

90-
func_kwargs = kwargs.copy()
9190
redis_cache = FastApiRedisCache()
9291
if redis_cache.not_connected:
9392
# if the redis client is not connected or request is not cacheable, no caching behavior is performed.
@@ -106,7 +105,6 @@ async def inner_wrapper_async(*args, **kwargs):
106105
def inner_wrapper_sync(*args, **kwargs):
107106
"""Return cached value if one exists, otherwise evaluate the wrapped function and cache the result."""
108107

109-
func_kwargs = kwargs.copy()
110108
redis_cache = FastApiRedisCache()
111109
if redis_cache.not_connected:
112110
# if the redis client is not connected or request is not cacheable, no caching behavior is performed.

src/fastapi_redis_cache/version.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# flake8: noqa
2-
__version_info__ = ("0", "2", "5") # pragma: no cover
2+
# note: appended "00" to the upstream version so that we can keep updating version in tandem with upstream, but can add
3+
# our updates as well
4+
__version_info__ = ("0", "2", "500") # pragma: no cover
35
__version__ = ".".join(__version_info__) # pragma: no cover

0 commit comments

Comments
 (0)