effectual 0.3.4__tar.gz → 0.4.0__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.3
2
2
  Name: effectual
3
- Version: 0.3.4
3
+ Version: 0.4.0
4
4
  Summary: A python package/script bundler
5
5
  Project-URL: Homepage, https://github.com/effectualpy/effectual
6
6
  Author-email: jake <jakewdr@proton.me>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "effectual"
3
- version = "0.3.4"
3
+ version = "0.4.0"
4
4
  description = "A python package/script bundler"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -42,6 +42,7 @@ build-backend = "hatchling.build"
42
42
 
43
43
  [dependency-groups]
44
44
  dev = [
45
+ "mypy>=1.13.0",
45
46
  "ruff>=0.8.1",
46
47
  ]
47
48
 
@@ -132,4 +133,24 @@ docstring-code-format = false
132
133
  #
133
134
  # This only has an effect when the `docstring-code-format` setting is
134
135
  # enabled.
135
- docstring-code-line-length = "dynamic"
136
+ docstring-code-line-length = "dynamic"
137
+
138
+ [tool.mypy]
139
+
140
+ disable_error_code = "name-defined"
141
+
142
+ warn_unused_configs = true
143
+ warn_redundant_casts = true
144
+ warn_unused_ignores = true
145
+
146
+ strict_equality = true
147
+
148
+ check_untyped_defs = true
149
+
150
+ disallow_subclassing_any = true
151
+ disallow_untyped_decorators = true
152
+ disallow_any_generics = true
153
+
154
+ disallow_untyped_calls = true
155
+ disallow_incomplete_defs = true
156
+ disallow_untyped_defs = true
@@ -1,8 +1,10 @@
1
+ import importlib
1
2
  import os
2
3
  import shutil
3
4
  import zipfile
4
5
  from pathlib import Path
5
6
  from time import perf_counter
7
+ from typing import Any
6
8
 
7
9
  import rtoml
8
10
 
@@ -19,14 +21,14 @@ def bundleFiles(
19
21
  compressionLevel: int,
20
22
  minification: bool,
21
23
  ) -> None:
22
- """Bundles dependencies and scripts into a single .py archive
24
+ """Bundles dependencies and scripts into a single .pyz archive
23
25
 
24
26
  Args:
25
27
  sourceDirectory (Path): Source directory which must contain a __main__.py script
26
28
  outputDirectory (Path): Output directory for the bundle
27
29
  outputFileName (str): Name of the output bundle
28
30
  compressionLevel (int): Compression level for the bundle from 0-9
29
- minification (bool): If the dependencies and scripts should be minified
31
+ minification (bool): If the scripts should be minified
30
32
  """
31
33
  outputDirectory.mkdir(parents=True, exist_ok=True)
32
34
  outputPath: Path = outputDirectory / outputFileName
@@ -65,7 +67,7 @@ def bundleFiles(
65
67
 
66
68
  def dependencies(minify: bool) -> None:
67
69
  with open("./pyproject.toml", "r", encoding="utf-8") as file:
68
- packages: list[str] = dict(rtoml.load(file)).get("project").get("dependencies")
70
+ packages: list[str] = dict(rtoml.load(file)).get("project").get("dependencies") # type: ignore
69
71
 
70
72
  arguments: list[str] = ["--no-compile", "--quiet", "--no-binary=none", "--no-cache"]
71
73
 
@@ -81,18 +83,19 @@ def dependencies(minify: bool) -> None:
81
83
 
82
84
  print(f"{tagColor('optimizing')} || {', '.join(packages)}")
83
85
 
84
- import multiprocessing
86
+ multiprocessing = importlib.import_module("multiprocessing")
85
87
 
86
88
  with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
87
89
  pool.map(optimizeDependencies, Path(pathToInstallTo).rglob("*"))
88
90
 
89
91
 
90
92
  def optimizeDependencies(file: Path) -> None:
93
+ stringFile: str = str(file)
91
94
  if (
92
95
  file.suffix in (".pyc", ".pyd", ".exe", ".typed")
93
- or "__pycache__" in str(file)
94
- or ".dist-info" in str(file)
95
- or ".lock" in str(file)
96
+ or "__pycache__" in stringFile
97
+ or ".dist-info" in stringFile
98
+ or ".lock" in stringFile
96
99
  ):
97
100
  try:
98
101
  file.unlink()
@@ -109,7 +112,7 @@ def main() -> None:
109
112
  RuntimeError: In the event there is no source directory
110
113
  """
111
114
 
112
- configData: dict = loadConfig("./pyproject.toml")
115
+ configData: dict[Any, Any] = loadConfig("./pyproject.toml")
113
116
 
114
117
  sourceDirectory: Path = Path(configData.get("sourceDirectory", "src/"))
115
118
  outputDirectory: Path = Path(configData.get("outputDirectory", "out/"))
@@ -126,18 +129,18 @@ def main() -> None:
126
129
  )
127
130
 
128
131
  uvHashPath: Path = Path("./.effectual_cache/pyprojectHash.toml")
129
- currentHash: dict[str] = dict()
132
+ currentHash: dict[str, dict[str, str]] = dict()
130
133
 
131
134
  startTime = perf_counter()
132
135
 
133
136
  Path("./.effectual_cache/").mkdir(parents=True, exist_ok=True)
134
- currentHash["hashes"]: dict[dict] = dict()
135
- currentHash["hashes"]["pyproject"] = getFilehash("./pyproject.toml")
136
- currentHash["hashes"]["lock"] = getFilehash("./uv.lock")
137
+ currentHash["hashes"] = dict()
138
+ currentHash["hashes"]["pyproject"] = getFilehash(Path("./pyproject.toml"))
139
+ currentHash["hashes"]["lock"] = getFilehash(Path("./uv.lock"))
137
140
 
138
141
  if uvHashPath.exists():
139
142
  with open(uvHashPath, "r") as file:
140
- lastHash: dict = dict(rtoml.load(file)).get("hashes")
143
+ lastHash: dict[Any, Any] = dict(rtoml.load(file)).get("hashes")
141
144
  if currentHash["hashes"] != lastHash:
142
145
  with open(uvHashPath, "w") as file:
143
146
  rtoml.dump(currentHash, file)
@@ -0,0 +1,38 @@
1
+ from typing import Any
2
+
3
+ import rtoml
4
+
5
+
6
+ def loadConfig(configPath: str) -> dict[Any, Any]:
7
+ """Loads effectual config from a file
8
+
9
+ Args:
10
+ configPath (str): Path to the config file
11
+
12
+ Raises:
13
+ RuntimeError: Invalid TOML format
14
+ RuntimeError: No configuration file found
15
+
16
+ Returns:
17
+ dict: _description_
18
+ """
19
+ try:
20
+ with open(configPath, "r", encoding="utf-8") as file:
21
+ configData: dict[Any, Any] = dict(rtoml.load(file))
22
+ if configData is None:
23
+ configData = {
24
+ "sourceDirectory": "./src/",
25
+ "outputDirectory": "./dist/",
26
+ "outputFileName": "bundle.pyz",
27
+ "minification": True,
28
+ "compressionLevel": 5,
29
+ }
30
+ else:
31
+ configData = configData.get("tool").get("effectual") # type: ignore
32
+
33
+ except ValueError as e:
34
+ raise RuntimeError(f"Invalid TOML in {configPath}: {e}")
35
+ except FileNotFoundError:
36
+ raise RuntimeError(f"Configuration file {configPath} not found.")
37
+
38
+ return configData
@@ -2,6 +2,7 @@ import subprocess
2
2
  import time
3
3
  import zipfile
4
4
  from pathlib import Path
5
+ from typing import Any
5
6
 
6
7
  from .colors import completeColor, fileColor, tagColor
7
8
  from .config import loadConfig
@@ -27,10 +28,9 @@ def bundle(sourceDirectory: Path, outputFile: Path) -> None:
27
28
 
28
29
  def main() -> None:
29
30
  """Super fast bundling for the 'task dev' command"""
30
-
31
- configData: dict = loadConfig("./pyproject.toml")
31
+ configData: dict[Any, Any] = loadConfig("./pyproject.toml")
32
32
  sourceDirectory: Path = Path(configData.get("sourceDirectory", "src/"))
33
- outputFileName: str = Path(configData.get("outputFileName", "bundle.pyz"))
33
+ outputFileName: Path = Path(configData.get("outputFileName", "bundle.pyz"))
34
34
  devBundlePath: Path = Path("./.effectual_cache/dev/")
35
35
  devBundlePath.mkdir(parents=True, exist_ok=True)
36
36
 
@@ -40,12 +40,12 @@ def main() -> None:
40
40
 
41
41
  runCommand = subprocess.Popen(["uv", "run", outputFile], shell=True)
42
42
 
43
- lastHashList: list[str] = getAllHashes(sourceDirectory)
43
+ lastHashSet: set[str] = getAllHashes(sourceDirectory, ".py")
44
44
 
45
45
  while True:
46
- currentHashList: list[str] = getAllHashes(sourceDirectory)
47
- if currentHashList != lastHashList:
48
- lastHashList = currentHashList
46
+ currentHashSet: set[str] = getAllHashes(sourceDirectory, ".py")
47
+ if currentHashSet != lastHashSet:
48
+ lastHashSet = currentHashSet
49
49
  runCommand.kill()
50
50
  runCommand.wait()
51
51
  outputFile.unlink()
@@ -0,0 +1,34 @@
1
+ import hashlib
2
+ from multiprocessing import Pool
3
+ from pathlib import Path
4
+
5
+
6
+ def getFilehash(filePath: Path) -> str:
7
+ """Gets the file hash of a single python script
8
+
9
+ Args:
10
+ filePath (Path): Path to a file
11
+
12
+ Returns:
13
+ str: Hash of the file
14
+ """
15
+ with open(filePath, "rb") as file:
16
+ fileHash = hashlib.sha1(file.read()).hexdigest()
17
+ return fileHash
18
+
19
+
20
+ def getAllHashes(sourceDirectory: Path, fileExtension: str) -> set[str]:
21
+ """Gets all hashes in directory
22
+
23
+ Args:
24
+ sourceDirectory (Path): Path to a folder containing files
25
+
26
+ Returns:
27
+ set[str]: Set containing paths and hashes
28
+ """
29
+
30
+ with Pool() as pool:
31
+ hashList: set[str] = set(
32
+ pool.map(getFilehash, sourceDirectory.glob(f"*.{fileExtension}"))
33
+ )
34
+ return hashList
@@ -38,7 +38,7 @@ def minifyToString(filePath: Path) -> str:
38
38
  Returns:
39
39
  str: Minified string
40
40
  """
41
- with filePath.open("r", encoding="utf-8") as fileR:
41
+ with filePath.open("r") as fileR:
42
42
  minifiedCode: str = str(
43
43
  minify(
44
44
  fileR.read(),
@@ -46,6 +46,6 @@ def minifyToString(filePath: Path) -> str:
46
46
  remove_literal_statements=True,
47
47
  remove_debug=True,
48
48
  )
49
- ).encode("utf-8")
49
+ )
50
50
 
51
51
  return minifiedCode
@@ -1,22 +1,27 @@
1
- version: "3.17"
2
-
3
- tasks:
4
-
5
- dist:
6
- cmds:
7
- - uv sync
8
- - uv lock
9
- - task: check
10
- - uv build
11
- - uv publish
12
-
13
- check:
14
- deps: [lint, format]
15
-
16
- format:
17
- cmds:
18
- - uv run ruff format --config pyproject.toml
19
-
20
- lint:
21
- cmds:
22
- - uv run ruff check --config pyproject.toml
1
+ version: "3.17"
2
+
3
+ tasks:
4
+
5
+ dist:
6
+ cmds:
7
+ - uv sync
8
+ - uv lock
9
+ - task: check
10
+ - uv build
11
+ - uv publish
12
+
13
+ check:
14
+ deps: [lint, format]
15
+
16
+ format:
17
+ cmds:
18
+ - uv run ruff format --config pyproject.toml
19
+
20
+ lint:
21
+ cmds:
22
+ - uv run ruff check --config pyproject.toml
23
+
24
+
25
+ type:
26
+ cmds:
27
+ - uv run mypy src/effectual/*.py
@@ -24,7 +24,7 @@ wheels = [
24
24
 
25
25
  [[package]]
26
26
  name = "effectual"
27
- version = "0.3.4"
27
+ version = "0.4.0"
28
28
  source = { editable = "." }
29
29
  dependencies = [
30
30
  { name = "click" },
@@ -36,6 +36,7 @@ dependencies = [
36
36
 
37
37
  [package.dev-dependencies]
38
38
  dev = [
39
+ { name = "mypy" },
39
40
  { name = "ruff" },
40
41
  ]
41
42
 
@@ -49,7 +50,63 @@ requires-dist = [
49
50
  ]
50
51
 
51
52
  [package.metadata.requires-dev]
52
- dev = [{ name = "ruff", specifier = ">=0.8.1" }]
53
+ dev = [
54
+ { name = "mypy", specifier = ">=1.13.0" },
55
+ { name = "ruff", specifier = ">=0.8.1" },
56
+ ]
57
+
58
+ [[package]]
59
+ name = "mypy"
60
+ version = "1.13.0"
61
+ source = { registry = "https://pypi.org/simple" }
62
+ dependencies = [
63
+ { name = "mypy-extensions" },
64
+ { name = "tomli", marker = "python_full_version < '3.11'" },
65
+ { name = "typing-extensions" },
66
+ ]
67
+ sdist = { url = "https://files.pythonhosted.org/packages/e8/21/7e9e523537991d145ab8a0a2fd98548d67646dc2aaaf6091c31ad883e7c1/mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e", size = 3152532 }
68
+ wheels = [
69
+ { url = "https://files.pythonhosted.org/packages/5e/8c/206de95a27722b5b5a8c85ba3100467bd86299d92a4f71c6b9aa448bfa2f/mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a", size = 11020731 },
70
+ { url = "https://files.pythonhosted.org/packages/ab/bb/b31695a29eea76b1569fd28b4ab141a1adc9842edde080d1e8e1776862c7/mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80", size = 10184276 },
71
+ { url = "https://files.pythonhosted.org/packages/a5/2d/4a23849729bb27934a0e079c9c1aad912167d875c7b070382a408d459651/mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7", size = 12587706 },
72
+ { url = "https://files.pythonhosted.org/packages/5c/c3/d318e38ada50255e22e23353a469c791379825240e71b0ad03e76ca07ae6/mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f", size = 13105586 },
73
+ { url = "https://files.pythonhosted.org/packages/4a/25/3918bc64952370c3dbdbd8c82c363804678127815febd2925b7273d9482c/mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372", size = 9632318 },
74
+ { url = "https://files.pythonhosted.org/packages/d0/19/de0822609e5b93d02579075248c7aa6ceaddcea92f00bf4ea8e4c22e3598/mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d", size = 10939027 },
75
+ { url = "https://files.pythonhosted.org/packages/c8/71/6950fcc6ca84179137e4cbf7cf41e6b68b4a339a1f5d3e954f8c34e02d66/mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d", size = 10108699 },
76
+ { url = "https://files.pythonhosted.org/packages/26/50/29d3e7dd166e74dc13d46050b23f7d6d7533acf48f5217663a3719db024e/mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b", size = 12506263 },
77
+ { url = "https://files.pythonhosted.org/packages/3f/1d/676e76f07f7d5ddcd4227af3938a9c9640f293b7d8a44dd4ff41d4db25c1/mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73", size = 12984688 },
78
+ { url = "https://files.pythonhosted.org/packages/9c/03/5a85a30ae5407b1d28fab51bd3e2103e52ad0918d1e68f02a7778669a307/mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca", size = 9626811 },
79
+ { url = "https://files.pythonhosted.org/packages/fb/31/c526a7bd2e5c710ae47717c7a5f53f616db6d9097caf48ad650581e81748/mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5", size = 11077900 },
80
+ { url = "https://files.pythonhosted.org/packages/83/67/b7419c6b503679d10bd26fc67529bc6a1f7a5f220bbb9f292dc10d33352f/mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e", size = 10074818 },
81
+ { url = "https://files.pythonhosted.org/packages/ba/07/37d67048786ae84e6612575e173d713c9a05d0ae495dde1e68d972207d98/mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2", size = 12589275 },
82
+ { url = "https://files.pythonhosted.org/packages/1f/17/b1018c6bb3e9f1ce3956722b3bf91bff86c1cefccca71cec05eae49d6d41/mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0", size = 13037783 },
83
+ { url = "https://files.pythonhosted.org/packages/cb/32/cd540755579e54a88099aee0287086d996f5a24281a673f78a0e14dba150/mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2", size = 9726197 },
84
+ { url = "https://files.pythonhosted.org/packages/11/bb/ab4cfdc562cad80418f077d8be9b4491ee4fb257440da951b85cbb0a639e/mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7", size = 11069721 },
85
+ { url = "https://files.pythonhosted.org/packages/59/3b/a393b1607cb749ea2c621def5ba8c58308ff05e30d9dbdc7c15028bca111/mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62", size = 10063996 },
86
+ { url = "https://files.pythonhosted.org/packages/d1/1f/6b76be289a5a521bb1caedc1f08e76ff17ab59061007f201a8a18cc514d1/mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8", size = 12584043 },
87
+ { url = "https://files.pythonhosted.org/packages/a6/83/5a85c9a5976c6f96e3a5a7591aa28b4a6ca3a07e9e5ba0cec090c8b596d6/mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7", size = 13036996 },
88
+ { url = "https://files.pythonhosted.org/packages/b4/59/c39a6f752f1f893fccbcf1bdd2aca67c79c842402b5283563d006a67cf76/mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc", size = 9737709 },
89
+ { url = "https://files.pythonhosted.org/packages/5e/2a/13e9ad339131c0fba5c70584f639005a47088f5eed77081a3d00479df0ca/mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a", size = 10955147 },
90
+ { url = "https://files.pythonhosted.org/packages/94/39/02929067dc16b72d78109195cfed349ac4ec85f3d52517ac62b9a5263685/mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb", size = 10138373 },
91
+ { url = "https://files.pythonhosted.org/packages/4a/cc/066709bb01734e3dbbd1375749f8789bf9693f8b842344fc0cf52109694f/mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b", size = 12543621 },
92
+ { url = "https://files.pythonhosted.org/packages/f5/a2/124df839025348c7b9877d0ce134832a9249968e3ab36bb826bab0e9a1cf/mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74", size = 13050348 },
93
+ { url = "https://files.pythonhosted.org/packages/45/86/cc94b1e7f7e756a63043cf425c24fb7470013ee1c032180282db75b1b335/mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6", size = 9615311 },
94
+ { url = "https://files.pythonhosted.org/packages/5f/d4/b33ddd40dad230efb317898a2d1c267c04edba73bc5086bf77edeb410fb2/mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc", size = 11013906 },
95
+ { url = "https://files.pythonhosted.org/packages/f4/e6/f414bca465b44d01cd5f4a82761e15044bedd1bf8025c5af3cc64518fac5/mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732", size = 10180657 },
96
+ { url = "https://files.pythonhosted.org/packages/38/e9/fc3865e417722f98d58409770be01afb961e2c1f99930659ff4ae7ca8b7e/mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc", size = 12586394 },
97
+ { url = "https://files.pythonhosted.org/packages/2e/35/f4d8b6d2cb0b3dad63e96caf159419dda023f45a358c6c9ac582ccaee354/mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d", size = 13103591 },
98
+ { url = "https://files.pythonhosted.org/packages/22/1d/80594aef135f921dd52e142fa0acd19df197690bd0cde42cea7b88cf5aa2/mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24", size = 9634690 },
99
+ { url = "https://files.pythonhosted.org/packages/3b/86/72ce7f57431d87a7ff17d442f521146a6585019eb8f4f31b7c02801f78ad/mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a", size = 2647043 },
100
+ ]
101
+
102
+ [[package]]
103
+ name = "mypy-extensions"
104
+ version = "1.0.0"
105
+ source = { registry = "https://pypi.org/simple" }
106
+ sdist = { url = "https://files.pythonhosted.org/packages/98/a4/1ab47638b92648243faf97a5aeb6ea83059cc3624972ab6b8d2316078d3f/mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782", size = 4433 }
107
+ wheels = [
108
+ { url = "https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", size = 4695 },
109
+ ]
53
110
 
54
111
  [[package]]
55
112
  name = "python-minifier"
@@ -163,3 +220,51 @@ sdist = { url = "https://files.pythonhosted.org/packages/10/56/d7d66a84f96d80415
163
220
  wheels = [
164
221
  { url = "https://files.pythonhosted.org/packages/d9/5f/8c716e47b3a50cbd7c146f45881e11d9414def768b7cd9c5e6650ec2a80a/termcolor-2.4.0-py3-none-any.whl", hash = "sha256:9297c0df9c99445c2412e832e882a7884038a25617c60cea2ad69488d4040d63", size = 7719 },
165
222
  ]
223
+
224
+ [[package]]
225
+ name = "tomli"
226
+ version = "2.2.1"
227
+ source = { registry = "https://pypi.org/simple" }
228
+ sdist = { url = "https://files.pythonhosted.org/packages/18/87/302344fed471e44a87289cf4967697d07e532f2421fdaf868a303cbae4ff/tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff", size = 17175 }
229
+ wheels = [
230
+ { url = "https://files.pythonhosted.org/packages/43/ca/75707e6efa2b37c77dadb324ae7d9571cb424e61ea73fad7c56c2d14527f/tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249", size = 131077 },
231
+ { url = "https://files.pythonhosted.org/packages/c7/16/51ae563a8615d472fdbffc43a3f3d46588c264ac4f024f63f01283becfbb/tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6", size = 123429 },
232
+ { url = "https://files.pythonhosted.org/packages/f1/dd/4f6cd1e7b160041db83c694abc78e100473c15d54620083dbd5aae7b990e/tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a", size = 226067 },
233
+ { url = "https://files.pythonhosted.org/packages/a9/6b/c54ede5dc70d648cc6361eaf429304b02f2871a345bbdd51e993d6cdf550/tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee", size = 236030 },
234
+ { url = "https://files.pythonhosted.org/packages/1f/47/999514fa49cfaf7a92c805a86c3c43f4215621855d151b61c602abb38091/tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e", size = 240898 },
235
+ { url = "https://files.pythonhosted.org/packages/73/41/0a01279a7ae09ee1573b423318e7934674ce06eb33f50936655071d81a24/tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4", size = 229894 },
236
+ { url = "https://files.pythonhosted.org/packages/55/18/5d8bc5b0a0362311ce4d18830a5d28943667599a60d20118074ea1b01bb7/tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106", size = 245319 },
237
+ { url = "https://files.pythonhosted.org/packages/92/a3/7ade0576d17f3cdf5ff44d61390d4b3febb8a9fc2b480c75c47ea048c646/tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8", size = 238273 },
238
+ { url = "https://files.pythonhosted.org/packages/72/6f/fa64ef058ac1446a1e51110c375339b3ec6be245af9d14c87c4a6412dd32/tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff", size = 98310 },
239
+ { url = "https://files.pythonhosted.org/packages/6a/1c/4a2dcde4a51b81be3530565e92eda625d94dafb46dbeb15069df4caffc34/tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b", size = 108309 },
240
+ { url = "https://files.pythonhosted.org/packages/52/e1/f8af4c2fcde17500422858155aeb0d7e93477a0d59a98e56cbfe75070fd0/tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea", size = 132762 },
241
+ { url = "https://files.pythonhosted.org/packages/03/b8/152c68bb84fc00396b83e7bbddd5ec0bd3dd409db4195e2a9b3e398ad2e3/tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8", size = 123453 },
242
+ { url = "https://files.pythonhosted.org/packages/c8/d6/fc9267af9166f79ac528ff7e8c55c8181ded34eb4b0e93daa767b8841573/tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192", size = 233486 },
243
+ { url = "https://files.pythonhosted.org/packages/5c/51/51c3f2884d7bab89af25f678447ea7d297b53b5a3b5730a7cb2ef6069f07/tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222", size = 242349 },
244
+ { url = "https://files.pythonhosted.org/packages/ab/df/bfa89627d13a5cc22402e441e8a931ef2108403db390ff3345c05253935e/tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77", size = 252159 },
245
+ { url = "https://files.pythonhosted.org/packages/9e/6e/fa2b916dced65763a5168c6ccb91066f7639bdc88b48adda990db10c8c0b/tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6", size = 237243 },
246
+ { url = "https://files.pythonhosted.org/packages/b4/04/885d3b1f650e1153cbb93a6a9782c58a972b94ea4483ae4ac5cedd5e4a09/tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd", size = 259645 },
247
+ { url = "https://files.pythonhosted.org/packages/9c/de/6b432d66e986e501586da298e28ebeefd3edc2c780f3ad73d22566034239/tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e", size = 244584 },
248
+ { url = "https://files.pythonhosted.org/packages/1c/9a/47c0449b98e6e7d1be6cbac02f93dd79003234ddc4aaab6ba07a9a7482e2/tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98", size = 98875 },
249
+ { url = "https://files.pythonhosted.org/packages/ef/60/9b9638f081c6f1261e2688bd487625cd1e660d0a85bd469e91d8db969734/tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4", size = 109418 },
250
+ { url = "https://files.pythonhosted.org/packages/04/90/2ee5f2e0362cb8a0b6499dc44f4d7d48f8fff06d28ba46e6f1eaa61a1388/tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7", size = 132708 },
251
+ { url = "https://files.pythonhosted.org/packages/c0/ec/46b4108816de6b385141f082ba99e315501ccd0a2ea23db4a100dd3990ea/tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c", size = 123582 },
252
+ { url = "https://files.pythonhosted.org/packages/a0/bd/b470466d0137b37b68d24556c38a0cc819e8febe392d5b199dcd7f578365/tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13", size = 232543 },
253
+ { url = "https://files.pythonhosted.org/packages/d9/e5/82e80ff3b751373f7cead2815bcbe2d51c895b3c990686741a8e56ec42ab/tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281", size = 241691 },
254
+ { url = "https://files.pythonhosted.org/packages/05/7e/2a110bc2713557d6a1bfb06af23dd01e7dde52b6ee7dadc589868f9abfac/tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272", size = 251170 },
255
+ { url = "https://files.pythonhosted.org/packages/64/7b/22d713946efe00e0adbcdfd6d1aa119ae03fd0b60ebed51ebb3fa9f5a2e5/tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140", size = 236530 },
256
+ { url = "https://files.pythonhosted.org/packages/38/31/3a76f67da4b0cf37b742ca76beaf819dca0ebef26d78fc794a576e08accf/tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2", size = 258666 },
257
+ { url = "https://files.pythonhosted.org/packages/07/10/5af1293da642aded87e8a988753945d0cf7e00a9452d3911dd3bb354c9e2/tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744", size = 243954 },
258
+ { url = "https://files.pythonhosted.org/packages/5b/b9/1ed31d167be802da0fc95020d04cd27b7d7065cc6fbefdd2f9186f60d7bd/tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec", size = 98724 },
259
+ { url = "https://files.pythonhosted.org/packages/c7/32/b0963458706accd9afcfeb867c0f9175a741bf7b19cd424230714d722198/tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69", size = 109383 },
260
+ { url = "https://files.pythonhosted.org/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", size = 14257 },
261
+ ]
262
+
263
+ [[package]]
264
+ name = "typing-extensions"
265
+ version = "4.12.2"
266
+ source = { registry = "https://pypi.org/simple" }
267
+ sdist = { url = "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8", size = 85321 }
268
+ wheels = [
269
+ { url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438 },
270
+ ]
@@ -1,27 +0,0 @@
1
- import rtoml
2
-
3
-
4
- def loadConfig(configPath: str) -> dict:
5
- """Loads effectual config from a file
6
-
7
- Args:
8
- configPath (str): Path to the config file
9
-
10
- Raises:
11
- RuntimeError: Invalid TOML format
12
- RuntimeError: No configuration file found
13
-
14
- Returns:
15
- dict: _description_
16
- """
17
- try:
18
- with open(configPath, "r", encoding="utf-8") as file:
19
- tomlFile: dict = dict(rtoml.load(file))
20
- configData: dict = tomlFile.get("tool").get("effectual")
21
-
22
- except ValueError as e:
23
- raise RuntimeError(f"Invalid TOML in {configPath}: {e}")
24
- except FileNotFoundError:
25
- raise RuntimeError(f"Configuration file {configPath} not found.")
26
-
27
- return configData
@@ -1,32 +0,0 @@
1
- import hashlib
2
- from multiprocessing import Pool
3
- from pathlib import Path
4
-
5
-
6
- def getFilehash(filePath: Path) -> str:
7
- """Gets the file hash of a single python script
8
-
9
- Args:
10
- filePath (Path): Path to the python script
11
-
12
- Returns:
13
- str: Hash of the python script
14
- """
15
- with open(filePath, "rb") as file:
16
- fileHash = hashlib.sha256(file.read()).hexdigest()
17
- return fileHash
18
-
19
-
20
- def getAllHashes(sourceDirectory: Path) -> list[str]:
21
- """Gets all hashes in directory
22
-
23
- Args:
24
- sourceDirectory (Path): Path to the python scripts
25
-
26
- Returns:
27
- dict[str]: Dictionary containing paths and hashes
28
- """
29
-
30
- with Pool() as pool:
31
- hashList: list[str] = pool.map(getFilehash, sourceDirectory.glob("*.py"))
32
- return hashList
File without changes
File without changes
File without changes
File without changes