httprest 0.4.1__tar.gz → 0.4.3__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.
@@ -1,30 +1,29 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: httprest
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: A library for making simple REST-like HTTP requests
5
5
  License: MIT
6
6
  License-File: LICENSE
7
7
  Author: Andrii Nechaiev
8
8
  Author-email: andrewnech@gmail.com
9
- Requires-Python: >=3.9,<4.0
9
+ Requires-Python: >=3.11,<4.0
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Operating System :: POSIX :: Linux
14
14
  Classifier: Programming Language :: Python
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
16
  Classifier: Programming Language :: Python :: 3.11
19
17
  Classifier: Programming Language :: Python :: 3.12
20
18
  Classifier: Programming Language :: Python :: 3.13
21
19
  Classifier: Programming Language :: Python :: 3.14
22
20
  Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Programming Language :: Python :: 3.9
23
22
  Classifier: Programming Language :: Python :: Implementation :: CPython
24
23
  Classifier: Topic :: Software Development :: Libraries
25
24
  Classifier: Topic :: Utilities
26
25
  Provides-Extra: requests-client
27
- Requires-Dist: requests (>=2.32.3,<3.0.0) ; extra == "requests-client"
26
+ Requires-Dist: requests (>=2,<3) ; extra == "requests-client"
28
27
  Project-URL: Repository, https://github.com/litteratum/httprest
29
28
  Description-Content-Type: text/markdown
30
29
 
@@ -26,7 +26,7 @@ class API:
26
26
  :param http_client: HTTP client to use for making HTTP requests.
27
27
  If not provided, the default one will be used
28
28
  """
29
- self._base_url = base_url.rstrip("/")
29
+ self._base_url = base_url.rstrip("/") + "/"
30
30
  self._http_client = http_client or _UrllibHTTPClient()
31
31
 
32
32
  def _request(
@@ -59,7 +59,9 @@ class API:
59
59
  )
60
60
 
61
61
  def _build_url(self, endpoint: _Optional[str]) -> str:
62
- return urllib.parse.urljoin(self._base_url, endpoint)
62
+ return urllib.parse.urljoin(
63
+ self._base_url, endpoint.lstrip("/") if endpoint else ""
64
+ )
63
65
 
64
66
  def __str__(self) -> str:
65
67
  return f"{self.__class__.__name__}(base_url='{self._base_url}')"
@@ -33,7 +33,7 @@ class UrllibHTTPClient(HTTPClient):
33
33
  data = urllib.parse.urlencode(data).encode() # type: ignore
34
34
  headers["Content-Type"] = "application/x-www-form-urlencoded"
35
35
 
36
- if json:
36
+ if json is not None:
37
37
  headers["Content-Type"] = "application/json"
38
38
  data = _jsonlib.dumps(json).encode()
39
39
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "httprest"
3
- version = "0.4.1"
3
+ version = "0.4.3"
4
4
  description = "A library for making simple REST-like HTTP requests"
5
5
  authors = ["Andrii Nechaiev <andrewnech@gmail.com>"]
6
6
  readme = "README.md"
@@ -26,19 +26,19 @@ classifiers=[
26
26
 
27
27
 
28
28
  [tool.poetry.dependencies]
29
- python = "^3.9"
30
- requests = {version = "^2.32.3", optional = true}
29
+ python = "^3.11"
30
+ requests = {version = "^2", optional = true}
31
31
 
32
32
  [tool.poetry.extras]
33
33
  requests-client = ["requests"]
34
34
 
35
35
  [tool.poetry.group.test.dependencies]
36
- pytest = "^8.3.2"
37
- pytest-cov = "^5.0.0"
38
- responses = "^0.25.3"
36
+ pytest = "^9"
37
+ pytest-cov = "^7"
38
+ responses = "^0.26"
39
39
 
40
40
  [tool.poetry.group.lint.dependencies]
41
- black = {version = "^25", python = "3.11"}
41
+ black = {version = "^26", python = "3.11"}
42
42
  pylint = {version = "^4", python = "3.11"}
43
43
  flake8 = {version = "^7.1.1", python = "3.11"}
44
44
  flake8-bugbear = {version = "^25", python = "3.11"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes