Skip to content

Commit

Permalink
fix: fix url lib and bump requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail.gubenko committed Nov 26, 2024
1 parent 90069f0 commit d4f751c
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 19 deletions.
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Run a command:
# [...args] - command arguments

# Run unit tests
docker run -t -v $(pwd):/sdk emnify/python-sdk pytest --cov=emnify --cov-fail-under=90
docker run -ti -v $(pwd):/sdk emnify/python-sdk pytest --cov=emnify --cov-fail-under=90
```
For end-to-end testing, make use of the other Dockerfile provided (it uses our package from [PyPI](https://pypi.org/project/emnify-sdk/)):
```shell
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ RUN pip install pipenv

WORKDIR /sdk

COPY Pipfile Pipfile.lock ./
COPY Pipfile ./

RUN pipenv install --deploy --ignore-pipfile --dev
RUN pipenv install --deploy --dev

COPY . .

Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "pypi"
[packages]
requests = ">=2.27.0,<2.33.0"
pydantic = ">=1.9.0,<2.0"
urllib3 = ">=1.26.0,<1.27"

[dev-packages]
vcrpy = "*"
Expand Down
158 changes: 145 additions & 13 deletions Pipfile.lock

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

3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from setuptools import setup, find_packages
import os


NAME = os.getenv("PYPI_PACKAGE_NAME") or "emnify-sdk"
VERSION = "0.4.2"
# To install the library, run the following
Expand All @@ -12,7 +11,7 @@
# prerequisite: build
# https://pypi.org/project/build/

REQUIRES = ["requests>=2.27.0,<2.30.0", "pydantic>=1.9.0,<2.0.0"]
REQUIRES = ["requests>=2.27.0,<2.33.0", "urllib3>=1.21.1,<1.27", "pydantic>=1.9.0,<2.0.0"]
if __name__ == "__main__":
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_emnify.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def vcr_cassette_dir(request):
def scrub_response_string():
def before_record_response(response):
try:
decoded_response = json.loads(response["body"]["string"])
decoded_response = json.loads(response["body"]["string"]).decode('utf-8')
if "auth_token" in decoded_response:
anonymized_response = decoded_response | {"auth_token": "test"}
response["body"]["string"] = json.dumps(anonymized_response).encode(
Expand Down

0 comments on commit d4f751c

Please sign in to comment.