webcode-tk 1.2.3__tar.gz → 1.2.6__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,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: webcode-tk
3
- Version: 1.2.3
3
+ Version: 1.2.6
4
4
  Summary:
5
5
  License: MIT
6
+ License-File: LICENSE.rst
6
7
  Keywords: html,validation,css
7
8
  Author: hundredvisionsguy
8
9
  Author-email: cwinikka@gmail.com
@@ -15,14 +16,17 @@ Classifier: Programming Language :: Python :: 3.10
15
16
  Classifier: Programming Language :: Python :: 3.11
16
17
  Classifier: Programming Language :: Python :: 3.12
17
18
  Classifier: Programming Language :: Python :: 3.13
18
- Requires-Dist: MechanicalSoup (>=1.1.0,<2.0.0)
19
+ Classifier: Programming Language :: Python :: 3.14
19
20
  Requires-Dist: bs4 (>=0.0.1,<0.0.2)
20
21
  Requires-Dist: file-clerk (>=1.0.9,<2.0.0)
21
- Requires-Dist: lxml (>=4.9.1,<5.0.0)
22
+ Requires-Dist: lxml (>=6.0.0,<7.0.0)
23
+ Requires-Dist: mechanicalsoup (>=1.4.0,<2.0.0)
22
24
  Requires-Dist: nltk (>=3.8.1,<4.0.0)
23
25
  Requires-Dist: py-readability-metrics (>=1.4.5,<2.0.0)
26
+ Requires-Dist: pytest-mock (>=3.15.1,<4.0.0)
24
27
  Requires-Dist: requests (>=2.28.1,<3.0.0)
25
28
  Requires-Dist: textatistic (>=0.0.1,<0.0.2)
29
+ Requires-Dist: tinycss2 (>=1.4.0,<2.0.0)
26
30
  Project-URL: Documentation, https://hundredvisionsguy.github.io/webcode-tk/
27
31
  Project-URL: Homepage, https://github.com/HundredVisionsGuy/webcode-tk
28
32
  Project-URL: Repository, https://github.com/HundredVisionsGuy/webcode-tk
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "webcode-tk"
3
- version = "1.2.3"
3
+ version = "1.2.6"
4
4
  description = ""
5
5
  authors = ["hundredvisionsguy <cwinikka@gmail.com>"]
6
6
  keywords = ["html", "validation", "css", ]
@@ -19,12 +19,14 @@ classifiers = [
19
19
  python = ">=3.9.0,<4.0"
20
20
  bs4 = "^0.0.1"
21
21
  file-clerk = "^1.0.9"
22
- lxml = "^4.9.1"
23
22
  requests = "^2.28.1"
24
- MechanicalSoup = "^1.1.0"
25
23
  py-readability-metrics = "^1.4.5"
26
24
  textatistic = "^0.0.1"
27
25
  nltk = "^3.8.1"
26
+ tinycss2 = "^1.4.0"
27
+ lxml = "^6.0.0"
28
+ mechanicalsoup = "^1.4.0"
29
+ pytest-mock = "^3.15.1"
28
30
 
29
31
  [tool.poetry.dev-dependencies]
30
32
  pytest = "*"
@@ -35,4 +35,4 @@
35
35
  - **`validator_tools`**: sends HTML or CSS code to the W3C Validator to check
36
36
  for errors.
37
37
  """
38
- __version__ = "1.2.3"
38
+ __version__ = "1.2.6"
@@ -409,7 +409,7 @@ def hex_to_decimal(c: str) -> int:
409
409
  msg += "2 digits"
410
410
  raise ValueError(msg)
411
411
  if c[0].lower() not in hex_map.keys():
412
- raise ValueError(f"The value `{c}` is not a valid hex code.")
412
+ raise ValueError(f"The value {repr(c)} is not a valid hex code.")
413
413
  c = c.lower()
414
414
  ones = hex_map[c[1]]
415
415
  sixteens = hex_map[c[0]] * 16
@@ -613,11 +613,9 @@ def contrast_ratio(hex1: str, hex2: str) -> float:
613
613
  l1 = l2
614
614
  l2 = temp
615
615
  ratio = (l1 + 0.05) / (l2 + 0.05)
616
- # get the ratio to 2 decimal places without rounding
617
- ratio_string = str(ratio)
618
- dot_pos = ratio_string.index(".")
619
- ratio_string = ratio_string[: dot_pos + 3]
620
- return float(ratio_string)
616
+ # round to 1 decimal place
617
+ ratio = round(ratio, 1)
618
+ return ratio
621
619
 
622
620
 
623
621
  def get_color_type(code: str) -> str: