identityfunction 1.0.1__tar.gz → 1.0.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.
- {identityfunction-1.0.1/src/identityfunction.egg-info → identityfunction-1.0.3}/PKG-INFO +10 -5
- {identityfunction-1.0.1 → identityfunction-1.0.3}/pyproject.toml +10 -5
- {identityfunction-1.0.1 → identityfunction-1.0.3}/src/identityfunction/__init__.py +3 -0
- identityfunction-1.0.3/src/identityfunction/__main__.py +4 -0
- identityfunction-1.0.3/src/identityfunction/core/__init__.py +21 -0
- identityfunction-1.0.3/src/identityfunction/tests/__init__.py +12 -0
- {identityfunction-1.0.1 → identityfunction-1.0.3}/src/identityfunction/tests/test_0.py +17 -16
- {identityfunction-1.0.1 → identityfunction-1.0.3/src/identityfunction.egg-info}/PKG-INFO +10 -5
- {identityfunction-1.0.1 → identityfunction-1.0.3}/src/identityfunction.egg-info/SOURCES.txt +2 -0
- identityfunction-1.0.3/src/identityfunction.egg-info/requires.txt +2 -0
- identityfunction-1.0.1/src/identityfunction/core/__init__.py +0 -8
- identityfunction-1.0.1/src/identityfunction/tests/__init__.py +0 -12
- {identityfunction-1.0.1 → identityfunction-1.0.3}/LICENSE.txt +0 -0
- {identityfunction-1.0.1 → identityfunction-1.0.3}/MANIFEST.in +0 -0
- {identityfunction-1.0.1 → identityfunction-1.0.3}/README.rst +0 -0
- {identityfunction-1.0.1 → identityfunction-1.0.3}/setup.cfg +0 -0
- {identityfunction-1.0.1 → identityfunction-1.0.3}/src/identityfunction.egg-info/dependency_links.txt +0 -0
- {identityfunction-1.0.1 → identityfunction-1.0.3}/src/identityfunction.egg-info/top_level.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: identityfunction
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
5
|
-
Author-email: Johannes <johannes
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Summary: This project provides the identity function.
|
|
5
|
+
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
7
7
|
|
|
8
8
|
Copyright (c) 2025 Johannes
|
|
@@ -29,15 +29,20 @@ Project-URL: Index, https://pypi.org/project/identityfunction/
|
|
|
29
29
|
Project-URL: Source, https://github.com/johannes-programming/identityfunction/
|
|
30
30
|
Project-URL: Website, https://identityfunction.johannes-programming.online/
|
|
31
31
|
Classifier: Development Status :: 5 - Production/Stable
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
32
33
|
Classifier: License :: OSI Approved :: MIT License
|
|
33
34
|
Classifier: Natural Language :: English
|
|
34
35
|
Classifier: Operating System :: OS Independent
|
|
35
36
|
Classifier: Programming Language :: Python
|
|
36
37
|
Classifier: Programming Language :: Python :: 3
|
|
37
38
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
38
|
-
|
|
39
|
+
Classifier: Typing :: Typed
|
|
40
|
+
Requires-Python: >=3.11
|
|
39
41
|
Description-Content-Type: text/x-rst
|
|
40
42
|
License-File: LICENSE.txt
|
|
43
|
+
Requires-Dist: click<9,>=8.2
|
|
44
|
+
Requires-Dist: preparse<2,>=0.1.6
|
|
45
|
+
Dynamic: license-file
|
|
41
46
|
|
|
42
47
|
================
|
|
43
48
|
identityfunction
|
|
@@ -6,24 +6,29 @@ requires = [
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
authors = [
|
|
9
|
-
{ email = "johannes
|
|
9
|
+
{ email = "johannes.programming@gmail.com", name = "Johannes" },
|
|
10
10
|
]
|
|
11
11
|
classifiers = [
|
|
12
12
|
"Development Status :: 5 - Production/Stable",
|
|
13
|
+
"Intended Audience :: Developers",
|
|
13
14
|
"License :: OSI Approved :: MIT License",
|
|
14
15
|
"Natural Language :: English",
|
|
15
16
|
"Operating System :: OS Independent",
|
|
16
17
|
"Programming Language :: Python",
|
|
17
18
|
"Programming Language :: Python :: 3",
|
|
18
19
|
"Programming Language :: Python :: 3 :: Only",
|
|
20
|
+
"Typing :: Typed",
|
|
19
21
|
]
|
|
20
|
-
dependencies = [
|
|
21
|
-
|
|
22
|
+
dependencies = [
|
|
23
|
+
"click>=8.2,<9",
|
|
24
|
+
"preparse>=0.1.6,<2",
|
|
25
|
+
]
|
|
26
|
+
description = "This project provides the identity function."
|
|
22
27
|
keywords = []
|
|
23
28
|
name = "identityfunction"
|
|
24
29
|
readme = "README.rst"
|
|
25
|
-
requires-python = ">=3.
|
|
26
|
-
version = "1.0.
|
|
30
|
+
requires-python = ">=3.11"
|
|
31
|
+
version = "1.0.3"
|
|
27
32
|
|
|
28
33
|
[project.license]
|
|
29
34
|
file = "LICENSE.txt"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from typing import *
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
import preparse
|
|
5
|
+
|
|
6
|
+
__all__ = ["identityfunction", "main"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def identityfunction(value: Any, /) -> Any:
|
|
10
|
+
"This function returns the value given to it."
|
|
11
|
+
return value
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@preparse.PreParser().click()
|
|
15
|
+
@click.command(add_help_option=False)
|
|
16
|
+
@click.help_option("-h", "--help")
|
|
17
|
+
@click.version_option(None, "-V", "--version")
|
|
18
|
+
@click.argument("value", type=str)
|
|
19
|
+
def main(value: str) -> None:
|
|
20
|
+
"This command applies the identity function to value."
|
|
21
|
+
click.echo(identityfunction(value))
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
|
|
3
|
+
__all__ = ["test"]
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test() -> unittest.TextTestRunner:
|
|
7
|
+
"This function runs all the tests."
|
|
8
|
+
loader: unittest.TestLoader = unittest.TestLoader()
|
|
9
|
+
tests: unittest.TestSuite = loader.discover(start_dir="identityfunction.tests")
|
|
10
|
+
runner: unittest.TextTestRunner = unittest.TextTestRunner()
|
|
11
|
+
result: unittest.TextTestResult = runner.run(tests)
|
|
12
|
+
return result
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
import unittest
|
|
2
|
+
from typing import *
|
|
2
3
|
|
|
3
4
|
from identityfunction.core import identityfunction
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class TestIdentityFunction(unittest.TestCase):
|
|
7
|
-
def test_with_integers(self):
|
|
8
|
-
"
|
|
8
|
+
def test_with_integers(self: Self) -> None:
|
|
9
|
+
"Test the identity function with integer values."
|
|
9
10
|
self.assertEqual(identityfunction(42), 42)
|
|
10
11
|
self.assertEqual(identityfunction(-1), -1)
|
|
11
12
|
self.assertEqual(identityfunction(0), 0)
|
|
12
13
|
|
|
13
|
-
def test_with_strings(self):
|
|
14
|
-
"
|
|
14
|
+
def test_with_strings(self: Self) -> None:
|
|
15
|
+
"Test the identity function with string values."
|
|
15
16
|
self.assertEqual(identityfunction("hello"), "hello")
|
|
16
17
|
self.assertEqual(identityfunction(""), "") # Empty string
|
|
17
18
|
|
|
18
|
-
def test_with_lists(self):
|
|
19
|
-
"
|
|
19
|
+
def test_with_lists(self: Self) -> None:
|
|
20
|
+
"Test the identity function with list values."
|
|
20
21
|
self.assertEqual(identityfunction([1, 2, 3]), [1, 2, 3])
|
|
21
22
|
self.assertEqual(identityfunction([]), []) # Empty list
|
|
22
23
|
|
|
23
|
-
def test_with_dictionaries(self):
|
|
24
|
-
"
|
|
24
|
+
def test_with_dictionaries(self: Self) -> None:
|
|
25
|
+
"Test the identity function with dictionary values."
|
|
25
26
|
self.assertEqual(identityfunction({"key": "value"}), {"key": "value"})
|
|
26
27
|
self.assertEqual(identityfunction({}), {}) # Empty dictionary
|
|
27
28
|
|
|
28
|
-
def test_with_none(self):
|
|
29
|
-
"
|
|
29
|
+
def test_with_none(self: Self) -> None:
|
|
30
|
+
"Test the identity function with None."
|
|
30
31
|
self.assertIs(identityfunction(None), None)
|
|
31
32
|
|
|
32
|
-
def test_with_custom_objects(self):
|
|
33
|
-
"
|
|
33
|
+
def test_with_custom_objects(self: Self) -> None:
|
|
34
|
+
"Test the identity function with custom objects."
|
|
34
35
|
|
|
35
36
|
class CustomObject:
|
|
36
37
|
pass
|
|
@@ -38,13 +39,13 @@ class TestIdentityFunction(unittest.TestCase):
|
|
|
38
39
|
obj = CustomObject()
|
|
39
40
|
self.assertIs(identityfunction(obj), obj)
|
|
40
41
|
|
|
41
|
-
def test_with_booleans(self):
|
|
42
|
-
"
|
|
42
|
+
def test_with_booleans(self: Self) -> None:
|
|
43
|
+
"Test the identity function with boolean values."
|
|
43
44
|
self.assertIs(identityfunction(True), True)
|
|
44
45
|
self.assertIs(identityfunction(False), False)
|
|
45
46
|
|
|
46
|
-
def test_with_floats(self):
|
|
47
|
-
"
|
|
47
|
+
def test_with_floats(self: Self) -> None:
|
|
48
|
+
"Test the identity function with float values."
|
|
48
49
|
self.assertEqual(identityfunction(3.14), 3.14)
|
|
49
50
|
self.assertEqual(identityfunction(-2.718), -2.718)
|
|
50
51
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: identityfunction
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
5
|
-
Author-email: Johannes <johannes
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Summary: This project provides the identity function.
|
|
5
|
+
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
7
7
|
|
|
8
8
|
Copyright (c) 2025 Johannes
|
|
@@ -29,15 +29,20 @@ Project-URL: Index, https://pypi.org/project/identityfunction/
|
|
|
29
29
|
Project-URL: Source, https://github.com/johannes-programming/identityfunction/
|
|
30
30
|
Project-URL: Website, https://identityfunction.johannes-programming.online/
|
|
31
31
|
Classifier: Development Status :: 5 - Production/Stable
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
32
33
|
Classifier: License :: OSI Approved :: MIT License
|
|
33
34
|
Classifier: Natural Language :: English
|
|
34
35
|
Classifier: Operating System :: OS Independent
|
|
35
36
|
Classifier: Programming Language :: Python
|
|
36
37
|
Classifier: Programming Language :: Python :: 3
|
|
37
38
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
38
|
-
|
|
39
|
+
Classifier: Typing :: Typed
|
|
40
|
+
Requires-Python: >=3.11
|
|
39
41
|
Description-Content-Type: text/x-rst
|
|
40
42
|
License-File: LICENSE.txt
|
|
43
|
+
Requires-Dist: click<9,>=8.2
|
|
44
|
+
Requires-Dist: preparse<2,>=0.1.6
|
|
45
|
+
Dynamic: license-file
|
|
41
46
|
|
|
42
47
|
================
|
|
43
48
|
identityfunction
|
|
@@ -4,9 +4,11 @@ README.rst
|
|
|
4
4
|
pyproject.toml
|
|
5
5
|
setup.cfg
|
|
6
6
|
src/identityfunction/__init__.py
|
|
7
|
+
src/identityfunction/__main__.py
|
|
7
8
|
src/identityfunction.egg-info/PKG-INFO
|
|
8
9
|
src/identityfunction.egg-info/SOURCES.txt
|
|
9
10
|
src/identityfunction.egg-info/dependency_links.txt
|
|
11
|
+
src/identityfunction.egg-info/requires.txt
|
|
10
12
|
src/identityfunction.egg-info/top_level.txt
|
|
11
13
|
src/identityfunction/core/__init__.py
|
|
12
14
|
src/identityfunction/tests/__init__.py
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import unittest
|
|
2
|
-
|
|
3
|
-
__all__ = ["test"]
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def test() -> unittest.TextTestRunner:
|
|
7
|
-
"This function runs all the tests."
|
|
8
|
-
loader = unittest.TestLoader()
|
|
9
|
-
tests = loader.discover(start_dir="identityfunction.tests")
|
|
10
|
-
runner = unittest.TextTestRunner()
|
|
11
|
-
result = runner.run(tests)
|
|
12
|
-
return result
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{identityfunction-1.0.1 → identityfunction-1.0.3}/src/identityfunction.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{identityfunction-1.0.1 → identityfunction-1.0.3}/src/identityfunction.egg-info/top_level.txt
RENAMED
|
File without changes
|