Skip to content

Commit 6d5b6bc

Browse files
authored
Merge pull request #160 from maxmind/greg/no-py37-env
Remove py37 tox environment as we no longer use it
2 parents 61d848e + dd46219 commit 6d5b6bc

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

geoip2/webservice.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
f"GeoIP2-Python-Client/{geoip2.__version__} {requests.utils.default_user_agent()}"
5757
)
5858

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

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

9094
def _uri(self, path: str, ip_address: IPAddress) -> str:

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ universal = 1
1212
disable = duplicate-code
1313

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

1717
[gh-actions]
1818
python =
@@ -22,7 +22,7 @@ python =
2222
3.11: py311
2323
3.12: py312,black,lint,flake8,mypy
2424

25-
[testenv:{py37,py38,py39,py310}-test]
25+
[testenv:{py38,py39,py310,py311,py312}-test]
2626
deps =
2727
mocket
2828
pytest

tests/webservice_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@
2525
OutOfQueriesError,
2626
PermissionRequiredError,
2727
)
28+
import geoip2.webservice
2829
from geoip2.webservice import AsyncClient, Client
2930

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

3136
class TestBaseClient(unittest.TestCase):
32-
base_uri = "https://geoip.maxmind.com/geoip/v2.1/"
37+
base_uri = "http://geoip.maxmind.com/geoip/v2.1/"
3338
country = {
3439
"continent": {"code": "NA", "geoname_id": 42, "names": {"en": "North America"}},
3540
"country": {

0 commit comments

Comments
 (0)