rtecommon 2.2.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.
@@ -0,0 +1,17 @@
1
+ COPYRIGHT NOTICE
2
+
3
+ Copyright (c) 2023, Bright Edge eServices. All rights reserved.
4
+
5
+ Unauthorized copying, distribution, modification, public display, or public
6
+ performance of this software, or any portion of it, is strictly prohibited. This
7
+ software is proprietary to Bright Edge eServices and is protected by South
8
+ African copyright laws and international treaty provisions.
9
+
10
+ No part of this software may be reproduced or transmitted in any form or by any
11
+ means, electronic or mechanical, including photocopying, recording, or by any
12
+ information storage and retrieval system, without the express written permission
13
+ of Bright Edge eServices.
14
+
15
+ Any use, copying, or distribution of this software not in accordance with this
16
+ notice is expressly prohibited and may result in severe civil and criminal
17
+ penalties.
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.4
2
+ Name: rtecommon
3
+ Version: 2.2.2
4
+ Summary: Common tools/utilities/configurations used in the RealTime Events echo system.
5
+ License: Proprietary
6
+ License-File: LICENSE.txt
7
+ Author: Hendrik du Toit
8
+ Author-email: hendrik@brightedge.co.za
9
+ Maintainer: Hendrik du Toit
10
+ Maintainer-email: hendrikdt@citiqprepaid.co.za
11
+ Requires-Python: >=3.10
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: System Administrators
15
+ Classifier: Topic :: Internet :: WWW/HTTP
16
+ Classifier: Topic :: Office/Business
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Dist: pydantic (>=2.11.5,<3.0.0)
23
+ Requires-Dist: pydantic-settings (>=2.9.1,<3.0.0)
24
+ Project-URL: Homepage, https://github.com/RealTimeEvents/rtecommon
25
+ Project-URL: Repository, https://github.com/RealTimeEvents/rtecommon.git
26
+ Project-URL: changelog, https://github.com/RealTimeEvents/rtecommon/blob/master/ReleaseNotes.md
27
+ Project-URL: issues, https://github.com/RealTimeEvents/rtecommon/issues
28
+ Description-Content-Type: text/markdown
29
+
30
+ # RealTimeEvents Common
31
+
32
+ | **Category** | **Status' and Links** |
33
+ | ------------ | ---------------------------------------------------------------------------------------------------------- |
34
+ | General | [![][general_maintenance_y_img]][general_maintenance_y_lnk] [![][general_semver_pic]][general_semver_link] |
35
+ | CD/CI | [![][cicd_codestyle_img]][cicd_codestyle_lnk] |
36
+
37
+ Common tools/utilities/configurations used in the RealTime Events echo system.
38
+
39
+ ______________________________________________________________________
40
+
41
+ ## Overview
42
+
43
+ Add any common tools/utilities/configurations to be used in the RealTime Events ecosystem to this module.
44
+
45
+ ______________________________________________________________________
46
+
47
+ ## Usage
48
+
49
+ ```python
50
+ import rtecommon
51
+ ```
52
+
53
+ ______________________________________________________________________
54
+
55
+ ## Updating ReleaseNotes Instructions
56
+
57
+ 1. Run the `pushpy.ps1` script or manually commit the current changes.
58
+ 1. Generate the release notes
59
+ 1. Use one of the following AI propmpts in Notion to generate the release notes.
60
+
61
+ - [Release - Update - General](https://www.notion.so/Release-Update-General-2c0bc8e6c6f38076b4cee82e3cf243fa?v=2c0bc8e6c6f3806e85db000c395f94ce&source=copy_link)
62
+ - [Release - Update - VenvIt](https://www.notion.so/Release-Update-VenvIt-2c0bc8e6c6f380de84a0f3fbb8b5dda5?v=2c0bc8e6c6f3806e85db000c395f94ce&source=copy_link)
63
+
64
+ or
65
+
66
+ 1. Use the following template and manually update the ReleaseNotes.md file.
67
+
68
+ ```
69
+ # Release ?.?.?
70
+ ## Summary of Changes
71
+ - bla, bla, bla
72
+ ## Next Heading
73
+ - bla, bla, bla
74
+ ---
75
+ ```
76
+ 1. You can repeat step 1 multiple times.
77
+ 1. You can repeat step 2 multiple times but update the ReleaseNotes that has not been published.
78
+ 1. Run the `pushpr.ps1` script once you are ready to create the PR to publish the release. TOy can also manually create the tag, touch a file, commit and push the changes.
79
+ 1. Merge the PR in GitHub.
80
+ 1. Confirm the following:
81
+ 1. The release update reflects in GitHub
82
+ 1. The release update notification was sent
83
+
84
+ ______________________________________________________________________
85
+
86
+ ## Good to Know's
87
+
88
+ - None
89
+
90
+ ______________________________________________________________________
91
+
92
+ ## Further Development
93
+
94
+ - None
95
+
96
+ ______________________________________________________________________
97
+
98
+ ## Updating ReleaseNotes Instructions
99
+
100
+ 1. Run the `pushpy.ps1` script or manually commit the current changes.
101
+ 1. Generate the release notes
102
+ 1. Use one of the following AI propmpts in Notion to generate the release notes.
103
+
104
+ - [Release - Update - General](https://www.notion.so/Release-Update-General-2c0bc8e6c6f38076b4cee82e3cf243fa?v=2c0bc8e6c6f3806e85db000c395f94ce&source=copy_link)
105
+ - [Release - Update - VenvIt](https://www.notion.so/Release-Update-VenvIt-2c0bc8e6c6f380de84a0f3fbb8b5dda5?v=2c0bc8e6c6f3806e85db000c395f94ce&source=copy_link)
106
+
107
+ or
108
+
109
+ 1. Use the following template and manually update the ReleaseNotes.md file.
110
+
111
+ ```
112
+ # Release ?.?.?
113
+ ## Summary of Changes
114
+ - bla, bla, bla
115
+ ## Next Heading
116
+ - bla, bla, bla
117
+ ---
118
+ ```
119
+ 1. You can repeat step 1 multiple times.
120
+ 1. You can repeat step 2 multiple times but update the ReleaseNotes that has not been published.
121
+ 1. Run the `pushpr.ps1` script once you are ready to create the PR to publish the release. TOy can also manually create
122
+ the tag, touch a file, commit and push the changes.
123
+ 1. Merge the PR in GitHub.
124
+ 1. Confirm the following:
125
+ 1. The release update reflects in GitHub
126
+ 1. The release update notification was sent
127
+
128
+ ______________________________________________________________________
129
+
130
+ [cicd_codestyle_img]: https://img.shields.io/badge/code%20style-black-000000.svg "Black"
131
+ [cicd_codestyle_lnk]: https://github.com/psf/black "Black"
132
+ [general_maintenance_y_img]: https://img.shields.io/badge/Maintenance%20Intended-%E2%9C%94-green.svg?style=flat-square "Maintenance - intended"
133
+ [general_maintenance_y_lnk]: http://unmaintained.tech/ "Maintenance - intended"
134
+ [general_semver_link]: https://semver.org/ "Sentic Versioning - 2.0.0"
135
+ [general_semver_pic]: https://img.shields.io/badge/Semantic%20Versioning-2.0.0-brightgreen.svg?style=flat-square "Sentic Versioning - 2.0.0"
136
+
@@ -0,0 +1,106 @@
1
+ # RealTimeEvents Common
2
+
3
+ | **Category** | **Status' and Links** |
4
+ | ------------ | ---------------------------------------------------------------------------------------------------------- |
5
+ | General | [![][general_maintenance_y_img]][general_maintenance_y_lnk] [![][general_semver_pic]][general_semver_link] |
6
+ | CD/CI | [![][cicd_codestyle_img]][cicd_codestyle_lnk] |
7
+
8
+ Common tools/utilities/configurations used in the RealTime Events echo system.
9
+
10
+ ______________________________________________________________________
11
+
12
+ ## Overview
13
+
14
+ Add any common tools/utilities/configurations to be used in the RealTime Events ecosystem to this module.
15
+
16
+ ______________________________________________________________________
17
+
18
+ ## Usage
19
+
20
+ ```python
21
+ import rtecommon
22
+ ```
23
+
24
+ ______________________________________________________________________
25
+
26
+ ## Updating ReleaseNotes Instructions
27
+
28
+ 1. Run the `pushpy.ps1` script or manually commit the current changes.
29
+ 1. Generate the release notes
30
+ 1. Use one of the following AI propmpts in Notion to generate the release notes.
31
+
32
+ - [Release - Update - General](https://www.notion.so/Release-Update-General-2c0bc8e6c6f38076b4cee82e3cf243fa?v=2c0bc8e6c6f3806e85db000c395f94ce&source=copy_link)
33
+ - [Release - Update - VenvIt](https://www.notion.so/Release-Update-VenvIt-2c0bc8e6c6f380de84a0f3fbb8b5dda5?v=2c0bc8e6c6f3806e85db000c395f94ce&source=copy_link)
34
+
35
+ or
36
+
37
+ 1. Use the following template and manually update the ReleaseNotes.md file.
38
+
39
+ ```
40
+ # Release ?.?.?
41
+ ## Summary of Changes
42
+ - bla, bla, bla
43
+ ## Next Heading
44
+ - bla, bla, bla
45
+ ---
46
+ ```
47
+ 1. You can repeat step 1 multiple times.
48
+ 1. You can repeat step 2 multiple times but update the ReleaseNotes that has not been published.
49
+ 1. Run the `pushpr.ps1` script once you are ready to create the PR to publish the release. TOy can also manually create the tag, touch a file, commit and push the changes.
50
+ 1. Merge the PR in GitHub.
51
+ 1. Confirm the following:
52
+ 1. The release update reflects in GitHub
53
+ 1. The release update notification was sent
54
+
55
+ ______________________________________________________________________
56
+
57
+ ## Good to Know's
58
+
59
+ - None
60
+
61
+ ______________________________________________________________________
62
+
63
+ ## Further Development
64
+
65
+ - None
66
+
67
+ ______________________________________________________________________
68
+
69
+ ## Updating ReleaseNotes Instructions
70
+
71
+ 1. Run the `pushpy.ps1` script or manually commit the current changes.
72
+ 1. Generate the release notes
73
+ 1. Use one of the following AI propmpts in Notion to generate the release notes.
74
+
75
+ - [Release - Update - General](https://www.notion.so/Release-Update-General-2c0bc8e6c6f38076b4cee82e3cf243fa?v=2c0bc8e6c6f3806e85db000c395f94ce&source=copy_link)
76
+ - [Release - Update - VenvIt](https://www.notion.so/Release-Update-VenvIt-2c0bc8e6c6f380de84a0f3fbb8b5dda5?v=2c0bc8e6c6f3806e85db000c395f94ce&source=copy_link)
77
+
78
+ or
79
+
80
+ 1. Use the following template and manually update the ReleaseNotes.md file.
81
+
82
+ ```
83
+ # Release ?.?.?
84
+ ## Summary of Changes
85
+ - bla, bla, bla
86
+ ## Next Heading
87
+ - bla, bla, bla
88
+ ---
89
+ ```
90
+ 1. You can repeat step 1 multiple times.
91
+ 1. You can repeat step 2 multiple times but update the ReleaseNotes that has not been published.
92
+ 1. Run the `pushpr.ps1` script once you are ready to create the PR to publish the release. TOy can also manually create
93
+ the tag, touch a file, commit and push the changes.
94
+ 1. Merge the PR in GitHub.
95
+ 1. Confirm the following:
96
+ 1. The release update reflects in GitHub
97
+ 1. The release update notification was sent
98
+
99
+ ______________________________________________________________________
100
+
101
+ [cicd_codestyle_img]: https://img.shields.io/badge/code%20style-black-000000.svg "Black"
102
+ [cicd_codestyle_lnk]: https://github.com/psf/black "Black"
103
+ [general_maintenance_y_img]: https://img.shields.io/badge/Maintenance%20Intended-%E2%9C%94-green.svg?style=flat-square "Maintenance - intended"
104
+ [general_maintenance_y_lnk]: http://unmaintained.tech/ "Maintenance - intended"
105
+ [general_semver_link]: https://semver.org/ "Sentic Versioning - 2.0.0"
106
+ [general_semver_pic]: https://img.shields.io/badge/Semantic%20Versioning-2.0.0-brightgreen.svg?style=flat-square "Sentic Versioning - 2.0.0"
@@ -0,0 +1,115 @@
1
+ [build-system]
2
+ requires = [
3
+ "poetry-core>=2.0.0,<3.0.0",
4
+ ]
5
+ build-backend = "poetry.core.masonry.api"
6
+
7
+ [project]
8
+ name = 'rtecommon'
9
+ version = '2.2.2'
10
+ description = 'Common tools/utilities/configurations used in the RealTime Events echo system.'
11
+ authors = [
12
+ { name = "Hendrik du Toit", email = "hendrik@brightedge.co.za" }
13
+ ]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Developers",
17
+ "Intended Audience :: System Administrators",
18
+ "Topic :: Internet :: WWW/HTTP",
19
+ "Topic :: Office/Business",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Topic :: Software Development :: Libraries :: Python Modules",
25
+ ]
26
+ dependencies = [
27
+ "pydantic-settings (>=2.9.1,<3.0.0)",
28
+ "pydantic (>=2.11.5,<3.0.0)",
29
+ ]
30
+ #license = "MIT"
31
+ license = "Proprietary"
32
+ license-files = ["LICENSE.txt"]
33
+ maintainers = [
34
+ { name = "Hendrik du Toit", email = "hendrikdt@citiqprepaid.co.za" },
35
+ { name = "Henru du Toit", email = "henru@brightedge.co.za" },
36
+ { name = "Dirk du Toit", email = "dirk@brightedge.co.za" },
37
+ ]
38
+ readme = { file = "README.md", content-type = "text/markdown" }
39
+ requires-python = ">=3.10"
40
+
41
+ [project.urls]
42
+ # documentation = "https://readthedocs.org"
43
+ issues = "https://github.com/RealTimeEvents/rtecommon/issues"
44
+ changelog = "https://github.com/RealTimeEvents/rtecommon/blob/master/ReleaseNotes.md"
45
+ homepage = 'https://github.com/RealTimeEvents/rtecommon'
46
+ repository = "https://github.com/RealTimeEvents/rtecommon.git"
47
+
48
+ [tool.black]
49
+ line-length = 120
50
+ target-version = [
51
+ "py313",
52
+ ]
53
+ extend-exclude = """
54
+ (
55
+ ^tests/testdata.py
56
+ )
57
+ """
58
+
59
+ [tool.codespell]
60
+ count = ""
61
+ quiet-level = 2
62
+ skip = "working/*"
63
+ ignore-words-list = "space-holder"
64
+ write-changes = ""
65
+
66
+ [tool.coverage.run]
67
+ source = [
68
+ "src",
69
+ "tests"
70
+ ]
71
+
72
+ [tool.isort]
73
+ profile = "black"
74
+
75
+ [tool.poetry.group.dev]
76
+ optional = true
77
+
78
+ [tool.poetry.group.dev.dependencies]
79
+ black = ">=25.1.0"
80
+ codecov = ">=2.1.13"
81
+ flake8 = ">=7.1.1"
82
+ isort = "^5.13.2"
83
+ mdformat-gfm = ">=0.4.1"
84
+ mdformat-frontmatter = ">=2.0.8"
85
+ mdformat-footnote = ">=0.1.1"
86
+ pre-commit = ">=4.0.1"
87
+ pygments = "^2.19.1"
88
+ pytest = ">=8.3.4"
89
+ pytest-cov = ">=6.0.0"
90
+ rstcheck = { extras = [
91
+ "sphinx",
92
+ ], version = ">=6.2.4" }
93
+ sphinx = ">=8.1.3"
94
+ twine = ">=6.1.0"
95
+
96
+
97
+ [tool.poetry.dependencies]
98
+
99
+ [tool.pytest.ini_options]
100
+ addopts = [
101
+ "-vv",
102
+ "--ignore-glob=*\\Archive",
103
+ ]
104
+ filterwarnings = [
105
+ # "ignore::DeprecationWarning",
106
+ ]
107
+ pythonpath = [
108
+ "src",
109
+ "tests",
110
+ ]
111
+ testpaths = "tests"
112
+ markers = [
113
+ "select: Run a selection of tests",
114
+ "config: Run test cconfig.py"
115
+ ]
File without changes
@@ -0,0 +1,63 @@
1
+ import warnings
2
+ from os import environ
3
+
4
+ from pydantic import AliasChoices
5
+ from pydantic import Field
6
+ from pydantic_settings import BaseSettings
7
+ from pydantic_settings import SettingsConfigDict
8
+
9
+
10
+ class Settings(BaseSettings):
11
+ # Read env names as-is
12
+ model_config = SettingsConfigDict(env_prefix="", extra="ignore")
13
+
14
+ # Canonical new names; accept legacy via validation aliases
15
+ INSTALLER_USERID: str = Field(
16
+ default=environ.get("INSTALLER_USERID", None),
17
+ validation_alias=AliasChoices("INSTALLER_USERID", "INSTALLER_USER_ID"),
18
+ )
19
+ INSTALLER_PWD: str = Field(
20
+ default=environ.get("INSTALLER_PWD", None),
21
+ validation_alias=AliasChoices("INSTALLER_PWD", "INSTALLER_USER_PWD"),
22
+ )
23
+
24
+ MYSQL_DATABASE: str = (environ.get("MYSQL_DATABASE", None),)
25
+ MYSQL_HOST: str = (environ.get("MYSQL_HOST", None),)
26
+ MYSQL_PASSWORD: str = (environ.get("MYSQL_PASSWORD", None),)
27
+ MYSQL_ROOT_PASSWORD: str = (environ.get("MYSQL_ROOT_PASSWORD", None),)
28
+ MYSQL_TCP_PORT: int = (environ.get("MYSQL_TCP_PORT", None),)
29
+ MYSQL_USER: str = (environ.get("MYSQL_USER", None),)
30
+ VENV_ENVIRONMENT: str = (environ.get("VENV_ENVIRONMENT", None),)
31
+
32
+
33
+ def _warn_on_legacy_env_usage() -> None:
34
+ """Emit clear deprecation warnings when legacy env vars are present.
35
+
36
+ - If both legacy and new are set, warn that legacy is ignored and new is used.
37
+ - If only legacy is set, warn that it is deprecated and to switch to the new name.
38
+ """
39
+ messages: list[str] = []
40
+
41
+ if "INSTALLER_USER_ID" in environ:
42
+ if "INSTALLER_USERID" in environ:
43
+ messages.append(
44
+ "Both INSTALLER_USERID and legacy INSTALLER_USER_ID are set; the new name is used and legacy is ignored."
45
+ )
46
+ else:
47
+ messages.append("Environment variable INSTALLER_USER_ID is deprecated; use INSTALLER_USERID instead.")
48
+
49
+ if "INSTALLER_USER_PWD" in environ:
50
+ if "INSTALLER_PWD" in environ:
51
+ messages.append(
52
+ "Both INSTALLER_PWD and legacy INSTALLER_USER_PWD are set; the new name is used and legacy is ignored."
53
+ )
54
+ else:
55
+ messages.append("Environment variable INSTALLER_USER_PWD is deprecated; use INSTALLER_PWD instead.")
56
+
57
+ for msg in messages:
58
+ warnings.warn(msg, DeprecationWarning, stacklevel=2)
59
+
60
+
61
+ def get_settings() -> Settings:
62
+ _warn_on_legacy_env_usage()
63
+ return Settings()