identityfunction 1.0.1__tar.gz → 1.0.2__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,8 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: identityfunction
3
- Version: 1.0.1
4
- Summary: identityfunction
5
- Author-email: Johannes <johannes-programming@mailfence.com>
3
+ Version: 1.0.2
4
+ Summary: This project provides the identity function.
5
+ Author-email: Johannes <johannes.programming@gmail.com>, Johannes <johannes-programming@mailfence.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
- Requires-Python: >=3.8
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>=8.2.1
44
+ Requires-Dist: preparse>=0.1.6
45
+ Dynamic: license-file
41
46
 
42
47
  ================
43
48
  identityfunction
@@ -6,24 +6,30 @@ requires = [
6
6
 
7
7
  [project]
8
8
  authors = [
9
+ { email = "johannes.programming@gmail.com", name = "Johannes" },
9
10
  { email = "johannes-programming@mailfence.com", name = "Johannes" },
10
11
  ]
11
12
  classifiers = [
12
13
  "Development Status :: 5 - Production/Stable",
14
+ "Intended Audience :: Developers",
13
15
  "License :: OSI Approved :: MIT License",
14
16
  "Natural Language :: English",
15
17
  "Operating System :: OS Independent",
16
18
  "Programming Language :: Python",
17
19
  "Programming Language :: Python :: 3",
18
20
  "Programming Language :: Python :: 3 :: Only",
21
+ "Typing :: Typed",
19
22
  ]
20
- dependencies = []
21
- description = "identityfunction"
23
+ dependencies = [
24
+ "click>=8.2.1",
25
+ "preparse>=0.1.6",
26
+ ]
27
+ description = "This project provides the identity function."
22
28
  keywords = []
23
29
  name = "identityfunction"
24
30
  readme = "README.rst"
25
- requires-python = ">=3.8"
26
- version = "1.0.1"
31
+ requires-python = ">=3.11"
32
+ version = "1.0.2"
27
33
 
28
34
  [project.license]
29
35
  file = "LICENSE.txt"
@@ -1,2 +1,5 @@
1
1
  from identityfunction.core import *
2
2
  from identityfunction.tests import *
3
+
4
+ if __name__ == "__main__":
5
+ main()
@@ -0,0 +1,4 @@
1
+ from identityfunction import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
@@ -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
- """Test the identity function with integer values."""
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
- """Test the identity function with string values."""
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
- """Test the identity function with list values."""
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
- """Test the identity function with dictionary values."""
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
- """Test the identity function with None."""
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
- """Test the identity function with custom objects."""
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
- """Test the identity function with boolean values."""
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
- """Test the identity function with float values."""
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.2
1
+ Metadata-Version: 2.4
2
2
  Name: identityfunction
3
- Version: 1.0.1
4
- Summary: identityfunction
5
- Author-email: Johannes <johannes-programming@mailfence.com>
3
+ Version: 1.0.2
4
+ Summary: This project provides the identity function.
5
+ Author-email: Johannes <johannes.programming@gmail.com>, Johannes <johannes-programming@mailfence.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
- Requires-Python: >=3.8
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>=8.2.1
44
+ Requires-Dist: preparse>=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
@@ -0,0 +1,2 @@
1
+ click>=8.2.1
2
+ preparse>=0.1.6
@@ -1,8 +0,0 @@
1
- from typing import *
2
-
3
- __all__ = ["identityfunction"]
4
-
5
-
6
- def identityfunction(value: object, /) -> object:
7
- "This function returns the value given to it."
8
- return value
@@ -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