keboola.component 1.6.13__tar.gz → 1.8.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.
Files changed (24) hide show
  1. {keboola.component-1.6.13 → keboola_component-1.8.2}/LICENSE +1 -1
  2. {keboola.component-1.6.13/src/keboola.component.egg-info → keboola_component-1.8.2}/PKG-INFO +19 -6
  3. keboola_component-1.8.2/pyproject.toml +53 -0
  4. {keboola.component-1.6.13 → keboola_component-1.8.2/src/keboola.component.egg-info}/PKG-INFO +19 -6
  5. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola.component.egg-info/SOURCES.txt +7 -3
  6. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola.component.egg-info/requires.txt +1 -1
  7. keboola_component-1.8.2/tests/test_base.py +107 -0
  8. keboola_component-1.8.2/tests/test_dao.py +853 -0
  9. keboola_component-1.8.2/tests/test_interface.py +1052 -0
  10. keboola_component-1.8.2/tests/test_schema.py +118 -0
  11. keboola_component-1.8.2/tests/test_sync_actions.py +28 -0
  12. keboola.component-1.6.13/setup.py +0 -51
  13. keboola.component-1.6.13/src/keboola.component.egg-info/not-zip-safe +0 -1
  14. {keboola.component-1.6.13 → keboola_component-1.8.2}/README.md +0 -0
  15. {keboola.component-1.6.13 → keboola_component-1.8.2}/setup.cfg +0 -0
  16. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola/component/__init__.py +0 -0
  17. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola/component/base.py +0 -0
  18. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola/component/dao.py +0 -0
  19. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola/component/exceptions.py +0 -0
  20. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola/component/interface.py +0 -0
  21. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola/component/sync_actions.py +0 -0
  22. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola/component/table_schema.py +0 -0
  23. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola.component.egg-info/dependency_links.txt +0 -0
  24. {keboola.component-1.6.13 → keboola_component-1.8.2}/src/keboola.component.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) Keboola :(){:|:&};: s.r.o.
3
+ Copyright (c) 2025 Keboola
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,14 +1,20 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: keboola.component
3
- Version: 1.6.13
3
+ Version: 1.8.2
4
4
  Summary: General library for Python applications running in Keboola Connection environment
5
- Home-page: https://github.com/keboola/python-component
6
- Author: Keboola KDS Team
7
- Author-email: support@keboola.com
5
+ Author-email: Keboola KDS Team <support@keboola.com>
6
+ License-Expression: MIT
8
7
  Project-URL: Documentation, https://keboola.github.io/python-component/interface.html
8
+ Project-URL: Repository, https://github.com/keboola/python-component
9
9
  Project-URL: Component Template project, https://github.com/keboola/cookiecutter-python-component
10
10
  Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
12
18
  Classifier: Operating System :: OS Independent
13
19
  Classifier: Intended Audience :: Developers
14
20
  Classifier: Intended Audience :: Information Technology
@@ -19,7 +25,14 @@ Classifier: Development Status :: 5 - Production/Stable
19
25
  Requires-Python: >=3.8
20
26
  Description-Content-Type: text/markdown
21
27
  License-File: LICENSE
28
+ Requires-Dist: pygelf
29
+ Requires-Dist: pytz<2021.0
30
+ Requires-Dist: deprecated
31
+ Dynamic: license-file
22
32
 
33
+ # Keboola Python Component library
34
+
35
+ ## Introduction
23
36
 
24
37
  ![Build & Test](https://github.com/keboola/python-component/workflows/Build%20&%20Test/badge.svg?branch=main)
25
38
  [![Code Climate](https://codeclimate.com/github/keboola/python-component/badges/gpa.svg)](https://codeclimate.com/github/keboola/python-component)
@@ -0,0 +1,53 @@
1
+ [project]
2
+ name = "keboola.component"
3
+ version = "1.8.2" # replaced by the actual version based on the release tag in github actions
4
+ dependencies = [
5
+ "pygelf",
6
+ "pytz<2021.0",
7
+ "deprecated",
8
+ ]
9
+ requires-python = ">=3.8"
10
+
11
+ authors = [
12
+ { name = "Keboola KDS Team", email = "support@keboola.com" }
13
+ ]
14
+ description = "General library for Python applications running in Keboola Connection environment"
15
+ readme = "README.md"
16
+ license = "MIT"
17
+ license-files = [ "LICENSE" ]
18
+ classifiers = [
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.8",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Programming Language :: Python :: 3.14",
27
+ "Operating System :: OS Independent",
28
+ "Intended Audience :: Developers",
29
+ "Intended Audience :: Information Technology",
30
+ "Intended Audience :: Education",
31
+ "Topic :: Software Development :: Libraries",
32
+ "Topic :: Software Development :: Libraries :: Python Modules",
33
+ "Development Status :: 5 - Production/Stable",
34
+ ]
35
+
36
+ [project.urls]
37
+ Documentation = "https://keboola.github.io/python-component/interface.html"
38
+ Repository = "https://github.com/keboola/python-component"
39
+ "Component Template project" = "https://github.com/keboola/cookiecutter-python-component"
40
+
41
+ [dependency-groups]
42
+ dev = [
43
+ "flake8>=5.0.4",
44
+ "pytest>=8.3.5",
45
+ "ruff>=0.13.2",
46
+ "pdoc3",
47
+ ]
48
+
49
+ [[tool.uv.index]]
50
+ name = "testpypi"
51
+ url = "https://test.pypi.org/simple/"
52
+ publish-url = "https://test.pypi.org/legacy/"
53
+ explicit = true
@@ -1,14 +1,20 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: keboola.component
3
- Version: 1.6.13
3
+ Version: 1.8.2
4
4
  Summary: General library for Python applications running in Keboola Connection environment
5
- Home-page: https://github.com/keboola/python-component
6
- Author: Keboola KDS Team
7
- Author-email: support@keboola.com
5
+ Author-email: Keboola KDS Team <support@keboola.com>
6
+ License-Expression: MIT
8
7
  Project-URL: Documentation, https://keboola.github.io/python-component/interface.html
8
+ Project-URL: Repository, https://github.com/keboola/python-component
9
9
  Project-URL: Component Template project, https://github.com/keboola/cookiecutter-python-component
10
10
  Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
12
18
  Classifier: Operating System :: OS Independent
13
19
  Classifier: Intended Audience :: Developers
14
20
  Classifier: Intended Audience :: Information Technology
@@ -19,7 +25,14 @@ Classifier: Development Status :: 5 - Production/Stable
19
25
  Requires-Python: >=3.8
20
26
  Description-Content-Type: text/markdown
21
27
  License-File: LICENSE
28
+ Requires-Dist: pygelf
29
+ Requires-Dist: pytz<2021.0
30
+ Requires-Dist: deprecated
31
+ Dynamic: license-file
22
32
 
33
+ # Keboola Python Component library
34
+
35
+ ## Introduction
23
36
 
24
37
  ![Build & Test](https://github.com/keboola/python-component/workflows/Build%20&%20Test/badge.svg?branch=main)
25
38
  [![Code Climate](https://codeclimate.com/github/keboola/python-component/badges/gpa.svg)](https://codeclimate.com/github/keboola/python-component)
@@ -1,10 +1,9 @@
1
1
  LICENSE
2
2
  README.md
3
- setup.py
3
+ pyproject.toml
4
4
  src/keboola.component.egg-info/PKG-INFO
5
5
  src/keboola.component.egg-info/SOURCES.txt
6
6
  src/keboola.component.egg-info/dependency_links.txt
7
- src/keboola.component.egg-info/not-zip-safe
8
7
  src/keboola.component.egg-info/requires.txt
9
8
  src/keboola.component.egg-info/top_level.txt
10
9
  src/keboola/component/__init__.py
@@ -13,4 +12,9 @@ src/keboola/component/dao.py
13
12
  src/keboola/component/exceptions.py
14
13
  src/keboola/component/interface.py
15
14
  src/keboola/component/sync_actions.py
16
- src/keboola/component/table_schema.py
15
+ src/keboola/component/table_schema.py
16
+ tests/test_base.py
17
+ tests/test_dao.py
18
+ tests/test_interface.py
19
+ tests/test_schema.py
20
+ tests/test_sync_actions.py
@@ -1,3 +1,3 @@
1
1
  pygelf
2
- pytz
2
+ pytz<2021.0
3
3
  deprecated
@@ -0,0 +1,107 @@
1
+ import os
2
+ import unittest
3
+ from io import StringIO
4
+ from unittest.mock import patch
5
+
6
+ from keboola.component import UserException
7
+ from keboola.component.base import ComponentBase, sync_action
8
+ from keboola.component.sync_actions import SelectElement
9
+
10
+
11
+ class MockComponent(ComponentBase):
12
+ def run(self):
13
+ return 'run_executed'
14
+
15
+
16
+ class MockComponentFail(ComponentBase):
17
+ def run(self):
18
+ raise UserException("Failed")
19
+
20
+
21
+ class TestCommonInterface(unittest.TestCase):
22
+
23
+ def setUp(self):
24
+ path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
25
+ 'data_examples', 'data1')
26
+ os.environ["KBC_DATADIR"] = path
27
+
28
+ def test_default_arguments_pass(self):
29
+ MockComponent()
30
+
31
+ def test_missing_config_parameters_fail(self):
32
+ with self.assertRaises(UserException):
33
+ MockComponent(required_parameters=['missing'])
34
+
35
+ def test_missing_image_parameters_fail(self):
36
+ with self.assertRaises(UserException):
37
+ c = MockComponent(required_image_parameters=['missing'])
38
+ c.execute_action()
39
+
40
+ def test_missing_action_fail(self):
41
+ path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
42
+ 'data_examples', 'data_custom_action')
43
+ os.environ["KBC_DATADIR"] = path
44
+ with self.assertRaises(AttributeError):
45
+ MockComponent().execute_action()
46
+
47
+ def test_run_action_passes(self):
48
+ self.assertEqual(MockComponent().execute_action(), 'run_executed')
49
+
50
+ def test_custom_action_passes(self):
51
+ path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
52
+ 'data_examples', 'data_custom_action')
53
+ os.environ["KBC_DATADIR"] = path
54
+
55
+ class CustomActionComponent(ComponentBase):
56
+ def run(self):
57
+ pass
58
+
59
+ @sync_action('custom_action')
60
+ def test_action(self):
61
+ return [SelectElement("test")]
62
+
63
+ self.assertEqual(CustomActionComponent().execute_action(), [SelectElement("test")])
64
+
65
+ def test_run_action_fails_with_user_error(self):
66
+ with self.assertRaises(UserException):
67
+ MockComponentFail().execute_action()
68
+
69
+ def test_system_action_name_fail(self):
70
+ with self.assertRaises(ValueError):
71
+ class ComponentInvalidActionName(ComponentBase):
72
+ def run(self):
73
+ pass
74
+
75
+ @sync_action('run')
76
+ def test_action(self):
77
+ pass
78
+
79
+ path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
80
+ 'data_examples', 'data_custom_action')
81
+ os.environ["KBC_DATADIR"] = path
82
+
83
+ ComponentInvalidActionName().execute_action()
84
+
85
+ @patch('sys.stdout', new_callable=StringIO)
86
+ def test_sync_action_prints_valid_message(self, stdout):
87
+ path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
88
+ 'data_examples', 'data_custom_action')
89
+ os.environ["KBC_DATADIR"] = path
90
+
91
+ class CustomActionComponent(ComponentBase):
92
+ def run(self):
93
+ pass
94
+
95
+ @sync_action('custom_action')
96
+ def get_columns(self):
97
+ return [SelectElement("value_a", "label_a"),
98
+ SelectElement("value_b")
99
+ ]
100
+
101
+ CustomActionComponent().execute_action()
102
+ expected = '[{"value": "value_a", "label": "label_a"}, {"value": "value_b", "label": "value_b"}]'
103
+ self.assertEqual(stdout.getvalue(), expected)
104
+
105
+
106
+ if __name__ == '__main__':
107
+ unittest.main()