blizzardapi2 2.1.21__tar.gz → 3.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {blizzardapi2-2.1.21/blizzardapi2.egg-info → blizzardapi2-3.0.1}/PKG-INFO +3 -1
  2. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/types.py +3 -3
  3. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1/blizzardapi2.egg-info}/PKG-INFO +3 -1
  4. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2.egg-info/SOURCES.txt +1 -0
  5. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2.egg-info/requires.txt +2 -0
  6. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/package.json +1 -1
  7. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/pyproject.toml +3 -1
  8. blizzardapi2-3.0.1/tests/test_types.py +52 -0
  9. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  10. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  11. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/.github/dependabot.yml +0 -0
  12. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/.github/workflows/README.md +0 -0
  13. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/.github/workflows/black-check.yml +0 -0
  14. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/.github/workflows/python-package.yml +0 -0
  15. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/.gitignore +0 -0
  16. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/.pre-commit-config.yaml +0 -0
  17. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/.release-it.json +0 -0
  18. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/CLAUDE.md +0 -0
  19. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/CODE_OF_CONDUCT.md +0 -0
  20. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/CONTRIBUTING.md +0 -0
  21. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/LICENSE +0 -0
  22. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/README.md +0 -0
  23. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/SECURITY.md +0 -0
  24. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/__init__.py +0 -0
  25. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/api.py +0 -0
  26. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/battlenet/__init__.py +0 -0
  27. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/battlenet/battlenet_api.py +0 -0
  28. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/battlenet/battlenet_oauth_api.py +0 -0
  29. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/blizzard_api.py +0 -0
  30. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/diablo3/__init__.py +0 -0
  31. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/diablo3/diablo3_api.py +0 -0
  32. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/diablo3/diablo3_community_api.py +0 -0
  33. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/diablo3/diablo3_game_data_api.py +0 -0
  34. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/hearthstone/__init__.py +0 -0
  35. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/hearthstone/hearthstone_api.py +0 -0
  36. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/hearthstone/hearthstone_game_data_api.py +0 -0
  37. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/starcraft2/__init__.py +0 -0
  38. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/starcraft2/starcraft2_api.py +0 -0
  39. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/starcraft2/starcraft2_community_api.py +0 -0
  40. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/starcraft2/starcraft2_game_data_api.py +0 -0
  41. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/wow/__init__.py +0 -0
  42. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/wow/wow_api.py +0 -0
  43. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/wow/wow_game_data_api.py +0 -0
  44. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2/wow/wow_profile_api.py +0 -0
  45. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2.egg-info/dependency_links.txt +0 -0
  46. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/blizzardapi2.egg-info/top_level.txt +0 -0
  47. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/docs/battlenet/README.md +0 -0
  48. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/docs/diablo3/README.md +0 -0
  49. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/docs/hearthstone/README.md +0 -0
  50. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/docs/pull_request_template.md +0 -0
  51. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/docs/starcraft2/README.md +0 -0
  52. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/docs/wow/README.md +0 -0
  53. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/poetry.lock +0 -0
  54. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/setup.cfg +0 -0
  55. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/tests/__init__.py +0 -0
  56. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/tests/conftest.py +0 -0
  57. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/tests/test_base_api.py +0 -0
  58. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/tests/test_battlenet.py +0 -0
  59. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/tests/test_diablo3.py +0 -0
  60. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/tests/test_hearthstone.py +0 -0
  61. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/tests/test_starcraft2.py +0 -0
  62. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/tests/test_wow.py +0 -0
  63. {blizzardapi2-2.1.21 → blizzardapi2-3.0.1}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blizzardapi2
3
- Version: 2.1.21
3
+ Version: 3.0.1
4
4
  Summary: A Python wrapper for Blizzard API
5
5
  Author-email: lostcol0ny <c098os0k@4wrd.cc>
6
6
  License-Expression: MIT
@@ -19,6 +19,8 @@ Requires-Dist: pytest-mock<4.0.0,>=3.14.0; extra == "dev"
19
19
  Requires-Dist: pytest-asyncio<2.0.0,>=0.23.5; extra == "dev"
20
20
  Requires-Dist: black<27.0.0,>=26.3.1; extra == "dev"
21
21
  Requires-Dist: ruff<1.0.0,>=0.3.0; extra == "dev"
22
+ Requires-Dist: build<2.0.0,>=1.2.0; extra == "dev"
23
+ Requires-Dist: twine<7.0.0,>=5.0.0; extra == "dev"
22
24
  Dynamic: license-file
23
25
 
24
26
  # Blizzard API 2
@@ -1,7 +1,7 @@
1
- from enum import Enum
1
+ from enum import StrEnum
2
2
 
3
3
 
4
- class Region(str, Enum):
4
+ class Region(StrEnum):
5
5
  """Region enum for Blizzard API endpoints."""
6
6
 
7
7
  US = "us"
@@ -11,7 +11,7 @@ class Region(str, Enum):
11
11
  CN = "cn"
12
12
 
13
13
 
14
- class Locale(str, Enum):
14
+ class Locale(StrEnum):
15
15
  """Locale enum for Blizzard API responses."""
16
16
 
17
17
  EN_US = "en_US"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blizzardapi2
3
- Version: 2.1.21
3
+ Version: 3.0.1
4
4
  Summary: A Python wrapper for Blizzard API
5
5
  Author-email: lostcol0ny <c098os0k@4wrd.cc>
6
6
  License-Expression: MIT
@@ -19,6 +19,8 @@ Requires-Dist: pytest-mock<4.0.0,>=3.14.0; extra == "dev"
19
19
  Requires-Dist: pytest-asyncio<2.0.0,>=0.23.5; extra == "dev"
20
20
  Requires-Dist: black<27.0.0,>=26.3.1; extra == "dev"
21
21
  Requires-Dist: ruff<1.0.0,>=0.3.0; extra == "dev"
22
+ Requires-Dist: build<2.0.0,>=1.2.0; extra == "dev"
23
+ Requires-Dist: twine<7.0.0,>=5.0.0; extra == "dev"
22
24
  Dynamic: license-file
23
25
 
24
26
  # Blizzard API 2
@@ -57,4 +57,5 @@ tests/test_battlenet.py
57
57
  tests/test_diablo3.py
58
58
  tests/test_hearthstone.py
59
59
  tests/test_starcraft2.py
60
+ tests/test_types.py
60
61
  tests/test_wow.py
@@ -6,3 +6,5 @@ pytest-mock<4.0.0,>=3.14.0
6
6
  pytest-asyncio<2.0.0,>=0.23.5
7
7
  black<27.0.0,>=26.3.1
8
8
  ruff<1.0.0,>=0.3.0
9
+ build<2.0.0,>=1.2.0
10
+ twine<7.0.0,>=5.0.0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blizzardapi2",
3
- "version": "2.1.21",
3
+ "version": "3.0.1",
4
4
  "scripts": {
5
5
  "release": "release-it"
6
6
  },
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "blizzardapi2"
3
- version = "2.1.21"
3
+ version = "3.0.1"
4
4
  description = "A Python wrapper for Blizzard API"
5
5
  authors = [{ name = "lostcol0ny", email = "c098os0k@4wrd.cc" }]
6
6
  license = "MIT"
@@ -40,6 +40,8 @@ dev = [
40
40
  "pytest-asyncio>=0.23.5,<2.0.0",
41
41
  "black>=26.3.1,<27.0.0",
42
42
  "ruff>=0.3.0,<1.0.0",
43
+ "build>=1.2.0,<2.0.0",
44
+ "twine>=5.0.0,<7.0.0",
43
45
  ]
44
46
 
45
47
  [tool.ruff]
@@ -0,0 +1,52 @@
1
+ """Regression tests for `Region` and `Locale` string formatting.
2
+
3
+ Python 3.11 changed how `(str, Enum)` subclasses render in f-strings and
4
+ `str.format()` — `f"{Region.US}"` produces `"Region.US"` instead of `"us"`.
5
+ That broke every endpoint method that interpolates these enums into URLs
6
+ or query parameters. Inheriting from `enum.StrEnum` (3.11+) restores the
7
+ expected value-formatting behavior. These tests pin that contract so the
8
+ regression cannot recur silently.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ from blizzardapi2.api import BaseApi
14
+ from blizzardapi2.types import Locale, Region
15
+ from tests.conftest import CLIENT_ID, CLIENT_SECRET
16
+
17
+
18
+ def test_region_fstring_yields_value() -> None:
19
+ """`f"{Region.US}"` must produce the string value, not the member name."""
20
+ assert f"{Region.US}" == "us"
21
+
22
+
23
+ def test_locale_fstring_yields_value() -> None:
24
+ """`f"{Locale.EN_US}"` must produce the string value, not the member name."""
25
+ assert f"{Locale.EN_US}" == "en_US"
26
+
27
+
28
+ def test_region_str_yields_value() -> None:
29
+ """`str(Region.EU)` must produce the value — `requests` relies on this when
30
+ the enum is passed directly into URL params."""
31
+ assert str(Region.EU) == "eu"
32
+
33
+
34
+ def test_namespace_interpolation_yields_value() -> None:
35
+ """The `static-{region}` pattern used across game-data endpoints must
36
+ render the region value, not the member repr."""
37
+ assert f"static-{Region.US}" == "static-us"
38
+
39
+
40
+ def test_build_api_url_accepts_region_enum() -> None:
41
+ """`BaseApi._build_api_url` must produce a clean host when handed a
42
+ `Region` enum — this is the exact path that broke in issue #50."""
43
+ api = BaseApi(CLIENT_ID, CLIENT_SECRET)
44
+ url = api._build_api_url("/data/wow/achievement-category/index", Region.US)
45
+ assert url == "https://us.api.blizzard.com/data/wow/achievement-category/index"
46
+
47
+
48
+ def test_build_api_url_cn_region_enum_routes_to_gateway() -> None:
49
+ """`Region.CN` must take the China gateway branch in `_build_api_url`."""
50
+ api = BaseApi(CLIENT_ID, CLIENT_SECRET)
51
+ url = api._build_api_url("/data/wow/realm/index", Region.CN)
52
+ assert url == "https://gateway.battlenet.com.cn/data/wow/realm/index"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes