Skip to content

Commit

Permalink
Merge pull request #160 from maxmind/greg/no-py37-env
Browse files Browse the repository at this point in the history
Remove py37 tox environment as we no longer use it
  • Loading branch information
horgh authored Dec 6, 2023
2 parents 61d848e + dd46219 commit 6d5b6bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion geoip2/webservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
f"GeoIP2-Python-Client/{geoip2.__version__} {requests.utils.default_user_agent()}"
)

# We have this so that we can avoid a mocket issue:
# https://github.com/mindflayer/python-mocket/issues/209
_SCHEME = "https"


class BaseClient: # pylint: disable=missing-class-docstring, too-few-public-methods
_account_id: str
Expand Down Expand Up @@ -84,7 +88,7 @@ def __init__(
account_id if isinstance(account_id, bytes) else str(account_id)
)
self._license_key = license_key
self._base_uri = f"https://{host}/geoip/v2.1"
self._base_uri = f"{_SCHEME}://{host}/geoip/v2.1"
self._timeout = timeout

def _uri(self, path: str, ip_address: IPAddress) -> str:
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ universal = 1
disable = duplicate-code

[tox:tox]
envlist = {py37,py38,py39,py310,py311,py312}-test,py312-{black,lint,flake8,mypy}
envlist = {py38,py39,py310,py311,py312}-test,py312-{black,lint,flake8,mypy}

[gh-actions]
python =
Expand All @@ -22,7 +22,7 @@ python =
3.11: py311
3.12: py312,black,lint,flake8,mypy

[testenv:{py37,py38,py39,py310}-test]
[testenv:{py38,py39,py310,py311,py312}-test]
deps =
mocket
pytest
Expand Down
7 changes: 6 additions & 1 deletion tests/webservice_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@
OutOfQueriesError,
PermissionRequiredError,
)
import geoip2.webservice
from geoip2.webservice import AsyncClient, Client

# We have this so that we can avoid a mocket issue:
# https://github.com/mindflayer/python-mocket/issues/209
geoip2.webservice._SCHEME = "http"


class TestBaseClient(unittest.TestCase):
base_uri = "https://geoip.maxmind.com/geoip/v2.1/"
base_uri = "http://geoip.maxmind.com/geoip/v2.1/"
country = {
"continent": {"code": "NA", "geoname_id": 42, "names": {"en": "North America"}},
"country": {
Expand Down

0 comments on commit 6d5b6bc

Please sign in to comment.