pathlibutil 0.3.3__tar.gz → 0.3.4__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pathlibutil
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: inherits from pathlib.Path with methods for hashing, copying, deleting and more
5
5
  License: MIT
6
6
  Keywords: pathlib,hashlib,shutil,urllib.parse,json,urlpath
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Programming Language :: Python :: 3.8
19
19
  Provides-Extra: 7z
20
- Requires-Dist: py7zr (>=0.20.2,<0.21.0) ; extra == "7z"
20
+ Requires-Dist: py7zr (>=0.20.2) ; extra == "7z"
21
21
  Project-URL: documentation, https://d-chris.github.io/pathlibutil
22
22
  Project-URL: repository, https://github.com/d-chris/pathlibutil
23
23
  Description-Content-Type: text/markdown
@@ -5,4 +5,11 @@
5
5
  from pathlibutil.path import Path, Register7zFormat
6
6
  from pathlibutil.types import ByteInt, StatResult, TimeInt, byteint
7
7
 
8
- __all__ = ["Path", "Register7zFormat", "ByteInt", "byteint", "TimeInt", "StatResult"]
8
+ __all__ = [
9
+ "Path",
10
+ "Register7zFormat",
11
+ "ByteInt",
12
+ "byteint",
13
+ "TimeInt",
14
+ "StatResult",
15
+ ]
@@ -6,6 +6,7 @@ import urllib.request
6
6
  from dataclasses import asdict, dataclass, field
7
7
  from functools import cached_property, wraps
8
8
  from typing import Any, Dict, Optional, Tuple, TypeVar, Union
9
+ from urllib.error import HTTPError
9
10
 
10
11
 
11
12
  @dataclass
@@ -612,7 +613,14 @@ class UrlPath(up.ParseResult):
612
613
 
613
614
  try:
614
615
  with urllib.request.urlopen(url, **kwargs) as response:
615
- return response.status == 200
616
+ if response.status == 200:
617
+ return True
618
+
619
+ raise HTTPError(
620
+ url=url,
621
+ code=response.status,
622
+ message=response.reason,
623
+ )
616
624
  except Exception as e:
617
625
  if errors is not False:
618
626
  raise FileNotFoundError(url) from e
@@ -5,7 +5,7 @@ requires = [ "poetry-core" ]
5
5
 
6
6
  [tool.poetry]
7
7
  name = "pathlibutil"
8
- version = "v0.3.3"
8
+ version = "v0.3.4"
9
9
  description = "inherits from pathlib.Path with methods for hashing, copying, deleting and more"
10
10
  authors = [ "Christoph Dörrer <d-chris@web.de>" ]
11
11
  readme = "README.md"
@@ -28,7 +28,7 @@ documentation = "https://d-chris.github.io/pathlibutil"
28
28
 
29
29
  [tool.poetry.dependencies]
30
30
  python = "^3.8.1"
31
- py7zr = { version = "^0.20.2", optional = true }
31
+ py7zr = { version = ">=0.20.2", optional = true }
32
32
 
33
33
  [tool.poetry.extras]
34
34
  7z = [ "py7zr" ]
@@ -76,3 +76,10 @@ addopts = [
76
76
  exclude_lines = [
77
77
  "^def normalize_url",
78
78
  ]
79
+
80
+ [tool.coverage.run]
81
+ omit = [
82
+ "*/tests/*",
83
+ "*/docs/*",
84
+ "*/examples/*",
85
+ ]
File without changes
File without changes