aletk 0.1.7__tar.gz → 0.1.8__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.
- {aletk-0.1.7/src/aletk.egg-info → aletk-0.1.8}/PKG-INFO +2 -1
- aletk-0.1.8/format +3 -0
- {aletk-0.1.7 → aletk-0.1.8}/prototypes/MaybeMonad.py +0 -2
- {aletk-0.1.7 → aletk-0.1.8}/pyproject.toml +10 -0
- aletk-0.1.8/scripts/format.py +29 -0
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk/_version.py +3 -3
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk/utils.py +0 -4
- {aletk-0.1.7 → aletk-0.1.8/src/aletk.egg-info}/PKG-INFO +2 -1
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk.egg-info/SOURCES.txt +3 -1
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk.egg-info/requires.txt +1 -0
- aletk-0.1.8/tests/test_utils.py +19 -0
- aletk-0.1.7/tests/.gitkeep +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/.gitignore +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/.gitlab-ci.yml +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/.python-version +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/LICENSE +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/README.md +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/docs/generic_style_guide.md +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/prototypes/pipe.ipynb +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/prototypes/pipe.py +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/setup.cfg +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk/ResultMonad.py +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk/__init__.py +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk/adapters.py +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk/py.typed +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk.egg-info/dependency_links.txt +0 -0
- {aletk-0.1.7 → aletk-0.1.8}/src/aletk.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aletk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: Collection of general purpose tools to work with Python
|
|
5
5
|
Author-email: Luis Alejandro Bordo García <bgluiszz@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -20,6 +20,7 @@ Provides-Extra: dev
|
|
|
20
20
|
Requires-Dist: mypy; extra == "dev"
|
|
21
21
|
Requires-Dist: black; extra == "dev"
|
|
22
22
|
Requires-Dist: pytest; extra == "dev"
|
|
23
|
+
Requires-Dist: autoflake; extra == "dev"
|
|
23
24
|
Requires-Dist: jupyter; extra == "dev"
|
|
24
25
|
Dynamic: license-file
|
|
25
26
|
|
aletk-0.1.8/format
ADDED
|
@@ -38,6 +38,7 @@ dev = [
|
|
|
38
38
|
"mypy", # for static type checking
|
|
39
39
|
"black", # for code formatting
|
|
40
40
|
"pytest", # for testing
|
|
41
|
+
"autoflake", # for removing unused imports and variables
|
|
41
42
|
"jupyter" # for prototyping in notebooks
|
|
42
43
|
]
|
|
43
44
|
|
|
@@ -76,6 +77,15 @@ module = [
|
|
|
76
77
|
]
|
|
77
78
|
ignore_missing_imports = true
|
|
78
79
|
|
|
80
|
+
[tool.pytest.ini_options]
|
|
81
|
+
minversion = "6.0"
|
|
82
|
+
addopts = "-ras -m 'not external'"
|
|
83
|
+
markers = [
|
|
84
|
+
"external: mark tests that require external API calls",
|
|
85
|
+
]
|
|
86
|
+
testpaths = ["tests"]
|
|
87
|
+
pythonpath = ["."]
|
|
88
|
+
|
|
79
89
|
[tool.black]
|
|
80
90
|
line-length = 120
|
|
81
91
|
target-version = ['py313']
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
from src.aletk.utils import get_logger
|
|
5
|
+
|
|
6
|
+
lgr = get_logger(__name__)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def main() -> None:
|
|
10
|
+
try:
|
|
11
|
+
# Run autoflake to remove unused imports
|
|
12
|
+
lgr.info("Running autoflake to remove unused imports...")
|
|
13
|
+
subprocess.run(
|
|
14
|
+
["autoflake", "--in-place", "--remove-all-unused-imports", "--recursive", "--verbose", "."], check=True
|
|
15
|
+
)
|
|
16
|
+
lgr.info("Successfully removed unused imports.")
|
|
17
|
+
|
|
18
|
+
lgr.info("Running black to format the code...")
|
|
19
|
+
# Run black to format the code
|
|
20
|
+
subprocess.run(["black", "."], check=True)
|
|
21
|
+
lgr.info("Successfully formatted the code with black.")
|
|
22
|
+
|
|
23
|
+
except subprocess.CalledProcessError as e:
|
|
24
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
25
|
+
sys.exit(e.returncode)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main()
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.1.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 1,
|
|
31
|
+
__version__ = version = '0.1.8'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 8)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'gf2bd05a80'
|
|
@@ -39,11 +39,7 @@ def get_logger(name: str) -> logging.Logger:
|
|
|
39
39
|
def remove_extra_whitespace(string: str) -> str:
|
|
40
40
|
"""
|
|
41
41
|
Remove extra whitespace from a string. This version removes all newlines, tabs, carriage returns, trailing and leading whitespace, and multiple spaces in a row.
|
|
42
|
-
|
|
43
|
-
If the input is None or not a string, a ValueError is raised.
|
|
44
42
|
"""
|
|
45
|
-
if not string:
|
|
46
|
-
raise ValueError("Utils::RemoveExtraWhiteSpace::Argument string has to be a non-empty string.")
|
|
47
43
|
|
|
48
44
|
cleaned_string = " ".join(string.split()).strip()
|
|
49
45
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aletk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: Collection of general purpose tools to work with Python
|
|
5
5
|
Author-email: Luis Alejandro Bordo García <bgluiszz@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -20,6 +20,7 @@ Provides-Extra: dev
|
|
|
20
20
|
Requires-Dist: mypy; extra == "dev"
|
|
21
21
|
Requires-Dist: black; extra == "dev"
|
|
22
22
|
Requires-Dist: pytest; extra == "dev"
|
|
23
|
+
Requires-Dist: autoflake; extra == "dev"
|
|
23
24
|
Requires-Dist: jupyter; extra == "dev"
|
|
24
25
|
Dynamic: license-file
|
|
25
26
|
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
.python-version
|
|
4
4
|
LICENSE
|
|
5
5
|
README.md
|
|
6
|
+
format
|
|
6
7
|
pyproject.toml
|
|
7
8
|
docs/generic_style_guide.md
|
|
8
9
|
prototypes/MaybeMonad.py
|
|
9
10
|
prototypes/pipe.ipynb
|
|
10
11
|
prototypes/pipe.py
|
|
12
|
+
scripts/format.py
|
|
11
13
|
src/aletk/ResultMonad.py
|
|
12
14
|
src/aletk/__init__.py
|
|
13
15
|
src/aletk/_version.py
|
|
@@ -19,4 +21,4 @@ src/aletk.egg-info/SOURCES.txt
|
|
|
19
21
|
src/aletk.egg-info/dependency_links.txt
|
|
20
22
|
src/aletk.egg-info/requires.txt
|
|
21
23
|
src/aletk.egg-info/top_level.txt
|
|
22
|
-
tests
|
|
24
|
+
tests/test_utils.py
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from src.aletk.utils import remove_extra_whitespace
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_remove_extra_whitespace() -> None:
|
|
5
|
+
|
|
6
|
+
# Test normal case
|
|
7
|
+
input_str = " This is a test string. \n With extra \t whitespace. "
|
|
8
|
+
expected_output = "This is a test string. With extra whitespace."
|
|
9
|
+
assert remove_extra_whitespace(input_str) == expected_output
|
|
10
|
+
|
|
11
|
+
# Test empty string
|
|
12
|
+
input_str = ""
|
|
13
|
+
expected_output = ""
|
|
14
|
+
assert remove_extra_whitespace(input_str) == expected_output
|
|
15
|
+
|
|
16
|
+
# Test string with only whitespace
|
|
17
|
+
input_str = " \n\t "
|
|
18
|
+
expected_output = ""
|
|
19
|
+
assert remove_extra_whitespace(input_str) == expected_output
|
aletk-0.1.7/tests/.gitkeep
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|