Skip to content

Commit

Permalink
Merge pull request #191 from lumapps/chore/update-python3.8
Browse files Browse the repository at this point in the history
chore(python): update minimum version to Python3.8
  • Loading branch information
noirbee committed Nov 28, 2023
2 parents a056b86 + 4577b13 commit c40e47f
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Python 🐍
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8

- name: Install Poetry
uses: snok/install-poetry@5e4414407e59f94f2148bcb253917dfc22dee7d9
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10"]

steps:
- name: Checkout branch
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
run: POETRY=poetry make test

- name: Upload coverage to Codecov
if: matrix.python-version == 3.7
if: matrix.python-version == 3.8
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Python 🐍
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8

- name: Install Poetry
uses: snok/install-poetry@5e4414407e59f94f2148bcb253917dfc22dee7d9
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Python 🐍
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8

- name: Install Poetry
uses: snok/install-poetry@5e4414407e59f94f2148bcb253917dfc22dee7d9
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python 3.7.12
python 3.8.18
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
PY_SRC := lumapps/
CI ?= false
TESTING ?= false
PYTHON ?= python3.7
PYTHON ?= python3.8
PIP = .venv/bin/pip
POETRY ?= .venv/bin/poetry

Expand Down Expand Up @@ -65,5 +65,4 @@ test: ## Run the test suite and report coverage. 2>/dev/null

.venv: ## Install the virtual env directory
$(PYTHON) -m venv .venv
$(PIP) install --quiet --upgrade pip
$(PIP) install poetry
$(PIP) install --quiet --upgrade pip poetry
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href="https://pypi.org/project/lumapps-sdk/"><img alt="Pypi" src="https://img.shields.io/pypi/v/lumapps-sdk"></a>
<a href="https://codecov.io/gh/lumapps/lumapps-sdk/branch/master"><img alt="Coverage" src="https://codecov.io/gh/lumapps/lumapps-sdk/branch/master/graph/badge.svg"></a>
<a href="https://github.com/ambv/black"><img alt="Black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<a href="#"><img alt="Black" src="https://img.shields.io/badge/python-3.6%7C3.7%7C3.8-blue"></a>
<a href="#"><img alt="Black" src="https://img.shields.io/badge/python-3.8%7C3.9-blue"></a>
</p>


Expand All @@ -25,7 +25,7 @@ pip install lumapps-sdk

## Requirements

Python >= 3.7
Python >= 3.8

## Getting started

Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href="https://pypi.org/project/lumapps-sdk/"><img alt="Pypi" src="https://img.shields.io/pypi/v/lumapps-sdk"></a>
<a href="https://codecov.io/gh/lumapps/lumapps-sdk/branch/master"><img alt="Coverage" src="https://codecov.io/gh/lumapps/lumapps-sdk/branch/master/graph/badge.svg"></a>
<a href="https://github.com/ambv/black"><img alt="Black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<a href="#"><img alt="Black" src="https://img.shields.io/badge/python-3.6%7C3.7%7C3.8-blue"></a>
<a href="#"><img alt="Black" src="https://img.shields.io/badge/python-3.8%7C3.9-blue"></a>
</p>


Expand All @@ -25,7 +25,7 @@ pip install lumapps-sdk

## Requirements

Python >= 3.7
Python >= 3.8

## Getting started

Expand Down
2 changes: 1 addition & 1 deletion lumapps/api/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
LUMAPPS_VERSION = "v1"
LUMAPPS_NAME = "lumsites"
LUMAPPS_BASE_URL = "https://lumsites.appspot.com"
FileContent = Union[IO[str], IO[bytes], str, bytes]
FileContent = Union[IO[bytes], str, bytes]


class BaseClient(AbstractContextManager):
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ include = [
]

[tool.poetry.dependencies]
python = ">=3.7,<4.0"
python = ">=3.8,<4.0"
Authlib = "<=0.15.3"
python-slugify = "^4.0.1"
httpx = "^0.15.5"
httpx = "^0.23"
PyJWT = "^2.1.0"
pre-commit = "^2.13.0"
requests-oauthlib = "^1.3.0"
Expand All @@ -27,23 +27,23 @@ requests-oauthlib = "^1.3.0"
flake8 = "^3.8.3"
importlib-metadata = "<5.0"
coverage = "^5.1"
pytest = "^6.0.2"
pytest = "^7"
pytest-mock = "^3.3.1"
bandit = "^1.6.2"
mkdocs-material = "^8.2.10"
mkdocstrings = { version = "0.19.0", extras = ["python"] }
pre-commit = "^2.5.0"
pre-commit-hooks = "^3.1.0"
pylint = "^2.5.3"
mypy = "^0.780"
mypy = "^1.6"
jinja2 = "^2.11.2"
git-changelog = "^0.4.0"
failprint = "^0.3.0"
black = "22.3.0"
isort = { version = "^4.3", extras = ["pyproject"] }
safety = "^1.9.0"
pytest-cov = "^2.9.0"
pytest-httpx = "^0.9.0"
pytest-httpx = "*"
requests-mock = "^1.9.3"
livereload = "^2.6.3"
vcrpy = "^4.1.1"
Expand Down
4 changes: 2 additions & 2 deletions tests/legacy/test_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def test_with_proxy_1():
proxy_info={"scheme": "http", "host": "foo.bar.com", "port": 12345},
)
s = c.client
assert len(s._proxies) == 2
assert len(s._mounts) == 2


def test_with_proxy_2():
Expand All @@ -343,7 +343,7 @@ def test_with_proxy_2():
},
)
s = c.client
assert len(s._proxies) == 2
assert len(s._mounts) == 2


def test_discovery_doc(mocker):
Expand Down
20 changes: 10 additions & 10 deletions tests/legacy/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,23 @@ def fake_request_with_none_on_code_and_message():


def test_none_on_code_and_message_1(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=403, data=b"message")
httpx_mock.add_response(status_code=403, content=b"message")

res = fake_request_with_none_on_code_and_message()

assert httpx_mock.get_requests()
assert res is None

def test_none_on_code_and_message_2(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=402, data=b"message")
httpx_mock.add_response(status_code=402, content=b"message")

with pytest.raises(httpx.HTTPStatusError):
fake_request_with_none_on_code_and_message()

assert httpx_mock.get_requests()

def test_none_on_code_and_message_3(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=403, data=b"pas le mot dedans")
httpx_mock.add_response(status_code=403, content=b"pas le mot dedans")

with pytest.raises(httpx.HTTPStatusError):
fake_request_with_none_on_code_and_message()
Expand All @@ -149,15 +149,15 @@ def fake_request_with_none_on_400_ALREADY_ARCHIVED():


def test_none_on_400_ALREADY_ARCHIVED_1(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=400, data=b"ALREADY_ARCHIVED")
httpx_mock.add_response(status_code=400, content=b"ALREADY_ARCHIVED")

res = fake_request_with_none_on_400_ALREADY_ARCHIVED()

assert httpx_mock.get_requests()
assert res is None

def test_none_on_400_ALREADY_ARCHIVED_2(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=401, data=b"ALREADY_ARCHIVED")
httpx_mock.add_response(status_code=401, content=b"ALREADY_ARCHIVED")

with pytest.raises(httpx.HTTPStatusError):
fake_request_with_none_on_400_ALREADY_ARCHIVED()
Expand All @@ -174,7 +174,7 @@ def fake_request_with_none_on_400_SUBSCRIPTION_ALREADY_EXISTS_OR_PINNED():


def test_none_on_400_SUBSCRIPTION_ALREADY_EXISTS_OR_PINNED_1(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=400, data=b"SUBSCRIPTION_ALREADY_EXISTS")
httpx_mock.add_response(status_code=400, content=b"SUBSCRIPTION_ALREADY_EXISTS")

res = fake_request_with_none_on_400_SUBSCRIPTION_ALREADY_EXISTS_OR_PINNED()

Expand All @@ -183,15 +183,15 @@ def test_none_on_400_SUBSCRIPTION_ALREADY_EXISTS_OR_PINNED_1(httpx_mock: HTTPXMo


def test_none_on_400_SUBSCRIPTION_ALREADY_EXISTS_OR_PINNED_2(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=400, data=b"Already pinned")
httpx_mock.add_response(status_code=400, content=b"Already pinned")

res = fake_request_with_none_on_400_SUBSCRIPTION_ALREADY_EXISTS_OR_PINNED()

assert httpx_mock.get_requests()
assert res is None

def test_none_on_400_SUBSCRIPTION_ALREADY_EXISTS_OR_PINNED_3(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=401, data=b"Already pinned")
httpx_mock.add_response(status_code=401, content=b"Already pinned")

with pytest.raises(httpx.HTTPStatusError):
fake_request_with_none_on_400_SUBSCRIPTION_ALREADY_EXISTS_OR_PINNED()
Expand All @@ -209,7 +209,7 @@ def fake_request_with_raise_known_save_errors():


def test_raise_known_save_errors_1(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=400, data=b"URL_ALREADY_EXISTS")
httpx_mock.add_response(status_code=400, content=b"URL_ALREADY_EXISTS")

with pytest.raises(UrlAlreadyExistsError):
fake_request_with_raise_known_save_errors()
Expand All @@ -218,7 +218,7 @@ def test_raise_known_save_errors_1(httpx_mock: HTTPXMock):


def test_raise_known_save_errors_2(httpx_mock: HTTPXMock):
httpx_mock.add_response(status_code=400, data=b"Feeds are required")
httpx_mock.add_response(status_code=400, content=b"Feeds are required")

with pytest.raises(FeedsRequiredError):
fake_request_with_raise_known_save_errors()
Expand Down

0 comments on commit c40e47f

Please sign in to comment.