designkit 0.1.0__tar.gz → 0.1.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.
- designkit-0.1.2/.github/ISSUE_TEMPLATE/bug_report.yml +79 -0
- designkit-0.1.2/.github/ISSUE_TEMPLATE/config.yml +26 -0
- designkit-0.1.2/.github/PULL_REQUEST_TEMPLATE/new_pattern.md +112 -0
- designkit-0.1.2/.github/PULL_REQUEST_TEMPLATE/pattern_maintenance.md +94 -0
- designkit-0.1.2/.github/PULL_REQUEST_TEMPLATE/repo_maintenance.md +69 -0
- designkit-0.1.2/CONTRIBUTING.md +308 -0
- designkit-0.1.2/Cargo.lock +1077 -0
- {designkit-0.1.0 → designkit-0.1.2}/Cargo.toml +3 -2
- designkit-0.1.2/PKG-INFO +255 -0
- designkit-0.1.2/README.md +220 -0
- {designkit-0.1.0 → designkit-0.1.2}/TODO.md +1 -1
- {designkit-0.1.0 → designkit-0.1.2}/designkit/__init__.py +1 -1
- designkit-0.1.2/designkit/behavioral/cache/core.py +51 -0
- designkit-0.1.2/designkit/behavioral/cache/exceptions.py +11 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/cache/lru_cache.py +58 -10
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/cache/models.py +1 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/matcher/core.py +9 -8
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/typing/core.py +26 -3
- designkit-0.1.2/designkit/creational/types/__init__.py +19 -0
- designkit-0.1.2/designkit/creational/types/dtypes/blob.py +111 -0
- designkit-0.1.2/designkit/creational/types/dtypes/card.py +229 -0
- designkit-0.1.2/designkit/creational/types/dtypes/card_networks.py +430 -0
- designkit-0.1.2/designkit/creational/types/dtypes/currency.py +527 -0
- designkit-0.1.2/designkit/creational/types/dtypes/email.py +181 -0
- designkit-0.1.2/designkit/creational/types/dtypes/hostname.py +12 -0
- designkit-0.1.2/designkit/creational/types/dtypes/ident.py +78 -0
- designkit-0.1.2/designkit/creational/types/dtypes/ip.py +169 -0
- designkit-0.1.2/designkit/creational/types/dtypes/latitude.py +8 -0
- designkit-0.1.2/designkit/creational/types/dtypes/money.py +464 -0
- designkit-0.1.2/designkit/creational/types/dtypes/percentage.py +494 -0
- designkit-0.1.2/designkit/creational/types/dtypes/phone.py +84 -0
- designkit-0.1.2/designkit/creational/types/dtypes/port.py +229 -0
- designkit-0.1.2/designkit/creational/types/dtypes/quantity.py +317 -0
- designkit-0.1.2/designkit/creational/types/dtypes/temperature.py +242 -0
- designkit-0.1.2/designkit/creational/types/dtypes/url.py +28 -0
- designkit-0.1.2/designkit/creational/types/thrird_party_dtypes.py +3 -0
- designkit-0.1.2/designkit/creational/types/utils.py +38 -0
- designkit-0.1.2/designkit/structural/menu/__init__.py +5 -0
- designkit-0.1.2/designkit/structural/menu/core.py +174 -0
- designkit-0.1.2/designkit/structural/modal_driven/__init__.py +19 -0
- designkit-0.1.2/designkit/structural/modal_driven/core.py +17 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/can.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/could.py +19 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/have_to.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/may.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/might.py +15 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/must.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/need_to.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/ought_to.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/shall.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/should.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/used_to.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/will.py +11 -0
- designkit-0.1.2/designkit/structural/modal_driven/modals/would.py +15 -0
- designkit-0.1.2/designkit/structural/modal_driven/models.py +129 -0
- {designkit-0.1.0 → designkit-0.1.2}/pyproject.toml +4 -2
- designkit-0.1.2/requirements.txt +5 -0
- designkit-0.1.2/rust/designkit/behavioral/mod.rs +13 -0
- designkit-0.1.2/rust/designkit/behavioral/typing/core.rs +2025 -0
- designkit-0.1.2/rust/designkit/behavioral/typing/mod.rs +9 -0
- designkit-0.1.2/rust/designkit/mod.rs +12 -0
- designkit-0.1.2/rust/lib.rs +11 -0
- designkit-0.1.2/samples/structural/modal_driven/soft_case.py +45 -0
- designkit-0.1.0/Cargo.lock +0 -132
- designkit-0.1.0/PKG-INFO +0 -36
- designkit-0.1.0/README.md +0 -3
- designkit-0.1.0/designkit/behavioral/cache/core.py +0 -23
- designkit-0.1.0/designkit/structural/eventloop/core.py +0 -0
- designkit-0.1.0/requirements.txt +0 -3
- designkit-0.1.0/rust/lib.rs +0 -13
- {designkit-0.1.0 → designkit-0.1.2}/.gitattributes +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/.github/workflows/CI.yml +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/.gitignore +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/LICENSE +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/_designkit.pdb +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/cache/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/chain_of_responsibility/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/chain_of_responsibility/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/command/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/command/commands.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/command/exceptions.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/command/invokers.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/command/models.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/command/receivers.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/command/utils.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/control/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/control/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/control/http.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/control/mathematical.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/control/promises.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/control/result.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/control/validation.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/imperactive/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/imperactive/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/imperactive/exceptions.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/interpreter/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/interpreter/builtin_exprs.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/interpreter/builtin_stmts.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/interpreter/builtin_units.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/interpreter/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/iterator/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/iterator/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/iterator/exceptions.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/iterator/iter_types.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/iterator/specialized/hashful.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/iterator/specialized/safeful.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/matcher/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/matcher/exceptions.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/mediator/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/mediator/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/memorable/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/memorable/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/memorable/exceptions.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/policy/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/policy/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/policy/exceptions.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/policy/models.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/state/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/state/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/state/exceptions.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/state/flowchartlib.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/state/fsm_types.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/state/renderers.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/state/tools.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/state/utils.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/strategy/__int__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/strategy/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/strategy/exceptions.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/strategy/models.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/template/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/template/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/trie/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/trie/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/behavioral/typing/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/creational/prototype/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/creational/prototype/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/creational/singleton/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/creational/singleton/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/creational/singleton/exceptions.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/structural/decorador/__init__.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/structural/decorador/core.py +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/designkit/structural/decorador/utils.py +0 -0
- /designkit-0.1.0/designkit/structural/eventloop/__init__.py → /designkit-0.1.2/designkit/structural/modal_driven/modals/dare.py +0 -0
- {designkit-0.1.0/rust/designkit/behavional → designkit-0.1.2/rust/designkit/behavioral}/interpreter/core.rs +0 -0
- {designkit-0.1.0 → designkit-0.1.2}/rust/designkit/creational/singleton/null +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug in the library.
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug"]
|
|
5
|
+
projects: ["designkit"]
|
|
6
|
+
type: bug
|
|
7
|
+
|
|
8
|
+
body:
|
|
9
|
+
- type: markdown
|
|
10
|
+
attributes:
|
|
11
|
+
value: |
|
|
12
|
+
Thanks so much for taking the time to fill out this bug report...
|
|
13
|
+
|
|
14
|
+
- type: textarea
|
|
15
|
+
id: what-happened
|
|
16
|
+
attributes:
|
|
17
|
+
label: What happened?
|
|
18
|
+
description: Also tell us, what did you expect to happen?
|
|
19
|
+
placeholder: Tell us what you see!
|
|
20
|
+
value: "No description provided."
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
|
|
24
|
+
- type: dropdown
|
|
25
|
+
id: version
|
|
26
|
+
attributes:
|
|
27
|
+
label: DesignKit Version
|
|
28
|
+
description: What version of our library are you using?
|
|
29
|
+
options:
|
|
30
|
+
- v0.1.0 -- v0.1.1 (default)
|
|
31
|
+
default: 0
|
|
32
|
+
validations:
|
|
33
|
+
required: true
|
|
34
|
+
|
|
35
|
+
- type: dropdown
|
|
36
|
+
id: python-version
|
|
37
|
+
attributes:
|
|
38
|
+
label: Python Version
|
|
39
|
+
description: What version of Python are you using?
|
|
40
|
+
options:
|
|
41
|
+
- Python 3.14
|
|
42
|
+
validations:
|
|
43
|
+
required: true
|
|
44
|
+
|
|
45
|
+
- type: dropdown
|
|
46
|
+
id: devices
|
|
47
|
+
attributes:
|
|
48
|
+
label: What OS are you seeing the problem on?
|
|
49
|
+
multiple: true
|
|
50
|
+
options:
|
|
51
|
+
- Windows
|
|
52
|
+
- macOS
|
|
53
|
+
- Linux
|
|
54
|
+
- iOS
|
|
55
|
+
default: ["Windows"]
|
|
56
|
+
|
|
57
|
+
- type: textarea
|
|
58
|
+
id: logs
|
|
59
|
+
attributes:
|
|
60
|
+
label: Relevant log output
|
|
61
|
+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
|
62
|
+
render: shell
|
|
63
|
+
|
|
64
|
+
- type: upload
|
|
65
|
+
id: screenshots
|
|
66
|
+
attributes:
|
|
67
|
+
label: Upload screenshots
|
|
68
|
+
description: If applicable, add screenshots to help explain your problem.
|
|
69
|
+
validations:
|
|
70
|
+
required: false
|
|
71
|
+
|
|
72
|
+
- type: textarea
|
|
73
|
+
id: notes
|
|
74
|
+
attributes:
|
|
75
|
+
label: Additional Notes
|
|
76
|
+
description: Any additional information that might be helpful.
|
|
77
|
+
value: "No additional notes."
|
|
78
|
+
validations:
|
|
79
|
+
required: false
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
|
|
3
|
+
issue_templates:
|
|
4
|
+
- name: "Bug Report"
|
|
5
|
+
description: "Report a bug in the DesignKit."
|
|
6
|
+
title: "[Bug]: "
|
|
7
|
+
labels: ["bug"]
|
|
8
|
+
body: "./ISSUE_TEMPLATE/bug_report.md"
|
|
9
|
+
|
|
10
|
+
- name: "Design Pattern Request"
|
|
11
|
+
description: "Propose a new design pattern."
|
|
12
|
+
title: "[Design Pattern]: "
|
|
13
|
+
labels: ["enhancement"]
|
|
14
|
+
body: "./ISSUE_TEMPLATE/pattern_request.md"
|
|
15
|
+
|
|
16
|
+
- name: "Documentation"
|
|
17
|
+
description: "Suggest updates or additions to the documentation."
|
|
18
|
+
title: "[Docs]: "
|
|
19
|
+
labels: ["documentation"]
|
|
20
|
+
body: "./ISSUE_TEMPLATE/documentation.md"
|
|
21
|
+
|
|
22
|
+
- name: "General Report"
|
|
23
|
+
description: "Provide general feedback or inquiries."
|
|
24
|
+
title: "[General]: "
|
|
25
|
+
labels: ["general"]
|
|
26
|
+
body: "./ISSUE_TEMPLATE/general_report.md"
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
|
|
2
|
+
<!-- One PR, One Design Pattern ~ @Sheñey -->
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# DESIGN PATTERN -- PULL REQUEST
|
|
6
|
+
|
|
7
|
+
> **Purpose:** Implementation
|
|
8
|
+
>
|
|
9
|
+
> **Date:** <!-- YYYY-MM-DD -->
|
|
10
|
+
>
|
|
11
|
+
> **Authors:** <!-- @gh_username1, @gh_username2 -->
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1. Pattern Information
|
|
18
|
+
|
|
19
|
+
### What is your proposed name for the pattern?
|
|
20
|
+
<!-- Provide a name for your design pattern and the "scientific" definition -->
|
|
21
|
+
<!-- Example: State, an Automaton of Finite State Machine -->
|
|
22
|
+
|
|
23
|
+
### What is the category of the pattern?
|
|
24
|
+
<!-- Specify the category of your design pattern -->
|
|
25
|
+
<!-- Example: Behavioral, Structural, Creational -->
|
|
26
|
+
|
|
27
|
+
### What problem does this pattern solve?
|
|
28
|
+
<!-- Describe the problem that this design pattern addresses -->
|
|
29
|
+
<!-- Example: Managing state transitions in a finite state machine -->
|
|
30
|
+
|
|
31
|
+
### How does this pattern solve the problem?
|
|
32
|
+
<!-- Describe how this design pattern solves the problem -->
|
|
33
|
+
<!-- Example: This design pattern is implemented using a reusable state machine that includes support for transitions, hooks, decorators, metamethods, and enums as possible states. -->
|
|
34
|
+
|
|
35
|
+
### Sample Screenshots/Videos/GIFs: <!-- Optional -->
|
|
36
|
+
*`N/A`*
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 2. Implementation Checklist
|
|
43
|
+
<!-- Basically, check if the implementation contains *adequate documentation*, *unitary tests*, and *samples* -->
|
|
44
|
+
- [ ] I have documented my design pattern according to the specifications in [CONTRIBUTING.md](CONTRIBUTING.md) <!-- Important -->
|
|
45
|
+
- [ ] I have created unit tests that efficiently cover a large number of my functionalities in [tests/...](tests/...) <!-- Optional -->
|
|
46
|
+
- [ ] I have designed at least one example of its use in [samples/...](samples/...) <!-- Important -->
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## 3. Pattern Checklist
|
|
53
|
+
<!-- In summary... check or add the technologies, utilities, styles or paradigms that support your design pattern -->
|
|
54
|
+
- [ ] Pythonic Design. <!-- Almost fully compliant -->
|
|
55
|
+
- [ ] Implementation in Rust. <!-- At least the heavy/core parts -->
|
|
56
|
+
- [ ] Type Hints. <!-- Very Important -->
|
|
57
|
+
- [ ] OOP Paradigm.
|
|
58
|
+
- [ ] Functional Paradigm.
|
|
59
|
+
- [ ] Reusable Component.
|
|
60
|
+
- [ ] Asynchronous & Synchronous.
|
|
61
|
+
- [ ] Thread-safe.
|
|
62
|
+
- [ ] Hooks Support.
|
|
63
|
+
<!-- Add more as-needed -->
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### 4. Pull-Request Checklist
|
|
70
|
+
<!-- Check if you did what was asked of you. -->
|
|
71
|
+
- [ ] It works on `Python 3.14+`. <!-- Important -->
|
|
72
|
+
- [ ] Does NOT cause adverse effects like bugs in other design patterns. <!-- Important -->
|
|
73
|
+
- [ ] Only affects my own design pattern. <!-- Important -->
|
|
74
|
+
- [ ] Does NOT contain breaking changes that raise the major digit of the version. <!-- Important -->
|
|
75
|
+
- [ ] Does NOT have any bugs or errors.
|
|
76
|
+
- [ ] Does NOT depend on other design patterns.
|
|
77
|
+
- [ ] This is based on the latest version of the main branch. <!-- Important -->
|
|
78
|
+
- [ ] Does NOT have any merge conflicts. <!-- Important -->
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## 5. Developer Checklist
|
|
85
|
+
<!-- Check if you did what was asked of you. -->
|
|
86
|
+
- [ ] My design pattern is unique in functionality and the problem it solves.
|
|
87
|
+
- [ ] I designed an API with *developer experience*, education, and ***type annotations*** in mind, prioritizing this over performance. <!-- Optional, but recommended -->
|
|
88
|
+
- [ ] I agree with what can and cannot be done with my design pattern according to the [LICENSE](LICENSE) <!-- Important -->
|
|
89
|
+
- [ ] I have read, understand and apply the contribution regulations in [CONTRIBUTING.md](CONTRIBUTING.md) <!-- Important -->
|
|
90
|
+
- [ ] I have modified the [TODO.md](TODO.md) file to add my design pattern in its respective state (`[~] building`, `[X] complete` or `[ ] incomplete`) and incremented the patterns number in the [README.md](README.md) file. <!-- Important -->
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
<!-- If you want to leave a note about complications, suggestions, future implementations, or anything else... this is where you can do it. -->
|
|
97
|
+
> [!NOTE]
|
|
98
|
+
> No note was left by the developer. :D
|
|
99
|
+
|
|
100
|
+
<!-- If you have marked that there are bugs... this is the section to specify them. -->
|
|
101
|
+
<!-- Example:
|
|
102
|
+
|
|
103
|
+
> [!CAUTION]
|
|
104
|
+
> **designkit/behavioral/state/core.py**#L23-L30: The transition method does not handle invalid states correctly, which can lead to unexpected behavior. A fix is needed to validate state transitions before applying them.
|
|
105
|
+
|
|
106
|
+
> [!WARNING]
|
|
107
|
+
> **tests/structural/singleton/test_singleton.py** (test_new_metamethod): The test for the metamethod `__new__` in the Singleton pattern is failing intermittently due to a race condition. This needs to be addressed to ensure consistent test results.
|
|
108
|
+
|
|
109
|
+
-->
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
---
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
|
|
2
|
+
<!-- One PR, One Design Pattern ~ @Sheñey -->
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# DESIGN PATTERN -- PULL REQUEST
|
|
6
|
+
|
|
7
|
+
> **Purpose:** Maintenance
|
|
8
|
+
>
|
|
9
|
+
> **Date:** <!-- YYYY-MM-DD -->
|
|
10
|
+
>
|
|
11
|
+
> **Authors:** <!-- @gh_username1, @gh_username2 -->
|
|
12
|
+
<!--
|
|
13
|
+
>
|
|
14
|
+
> **Issue:** #ISSUE_NUMBER -->
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## 1. PR Information
|
|
21
|
+
|
|
22
|
+
### What pattern are you maintaining?
|
|
23
|
+
<!-- Provide the category and name like tree of the design pattern you are maintaining -->
|
|
24
|
+
<!-- Example: `designkit/behavioral/strategy` -->
|
|
25
|
+
|
|
26
|
+
### What does this PR do?
|
|
27
|
+
<!-- Describe the issue that this pull request addresses -->
|
|
28
|
+
<!-- Example: Add about 12 unit tests for the strategy pattern. -->
|
|
29
|
+
|
|
30
|
+
### Sample Screenshots/Videos/GIFs: <!-- Optional -->
|
|
31
|
+
*`N/A`*
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## 2. Change Checklist
|
|
38
|
+
<!-- Select the type of changes included in this PR -->
|
|
39
|
+
- [ ] Refactoring
|
|
40
|
+
- [ ] Performance Optimization (on `python`/`rust` <!-- Specify the language -->)
|
|
41
|
+
- [ ] API Improvement <!-- Like adding new methods -->
|
|
42
|
+
- [ ] Renaming <!-- Only renaming of existing elements -->
|
|
43
|
+
- [ ] Documentation
|
|
44
|
+
- [ ] Bug Fixing
|
|
45
|
+
- [ ] Testing
|
|
46
|
+
- [ ] Sampling
|
|
47
|
+
- [ ] Other... <!-- Specify the type of changes included in this PR -->
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## 3. Pull-Request Checklist
|
|
54
|
+
<!-- Check if you did what was asked of you. -->
|
|
55
|
+
- [ ] It works on `Python 3.14+`. <!-- Important -->
|
|
56
|
+
- [ ] Does NOT depend on other design patterns.
|
|
57
|
+
- [ ] Only affects one design pattern. <!-- Important -->
|
|
58
|
+
- [ ] Only includes relevant changes.
|
|
59
|
+
- [ ] This is based on the latest version of the main branch. <!-- Important -->
|
|
60
|
+
- [ ] Does NOT have any merge conflicts. <!-- Important -->
|
|
61
|
+
- [ ] Does NOT contain any commented-out code. <!-- Important -->
|
|
62
|
+
- [ ] Does NOT contain breaking changes that raise the major digit of the version. <!-- Important -->
|
|
63
|
+
- [ ] Does NOT have any bugs or errors.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 4. Developer Checklist
|
|
69
|
+
<!-- Check if you did what was asked of you. -->
|
|
70
|
+
- [ ] I agree with what can and cannot be done with my design pattern according to the [LICENSE](LICENSE) <!-- Important -->.
|
|
71
|
+
- [ ] I have read, understand and apply the contribution regulations in [CONTRIBUTING.md](CONTRIBUTING.md) <!-- Important -->
|
|
72
|
+
- [ ] I have modified the [TODO.md](TODO.md) file to update the respective design pattern in its state (`[~] building`, `[X] complete`). <!-- Important -->
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
<!-- If you want to leave a note about complications, suggestions, future implementations, or anything else... this is where you can do it. -->
|
|
79
|
+
> [!NOTE]
|
|
80
|
+
> No note was left by the developer. :D
|
|
81
|
+
|
|
82
|
+
<!-- If you have marked that there are bugs... this is the section to specify them. -->
|
|
83
|
+
<!-- Example:
|
|
84
|
+
|
|
85
|
+
> [!CAUTION]
|
|
86
|
+
> **designkit/behavioral/state/core.py**#L23-L30: The transition method does not handle invalid states correctly, which can lead to unexpected behavior. A fix is needed to validate state transitions before applying them.
|
|
87
|
+
|
|
88
|
+
> [!WARNING]
|
|
89
|
+
> **tests/structural/singleton/test_singleton.py** (test_new_metamethod): The test for the metamethod `__new__` in the Singleton pattern is failing intermittently due to a race condition. This needs to be addressed to ensure consistent test results.
|
|
90
|
+
|
|
91
|
+
-->
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
---
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# GENERAL -- PULL REQUEST
|
|
4
|
+
|
|
5
|
+
> **Purpose:** Repository Maintenance
|
|
6
|
+
>
|
|
7
|
+
> **Date:** <!-- YYYY-MM-DD -->
|
|
8
|
+
>
|
|
9
|
+
> **Authors:** <!-- @gh_username1, @gh_username2 -->
|
|
10
|
+
<!--
|
|
11
|
+
>
|
|
12
|
+
> **Issue:** #ISSUE_NUMBER -->
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1. PR Information
|
|
19
|
+
|
|
20
|
+
### What does this PR add, maintain, update, fix or ...?
|
|
21
|
+
<!-- Describe the issue that this pull request addresses -->
|
|
22
|
+
<!-- Example: Update the `README` file to add new contribution guidelines... -->
|
|
23
|
+
|
|
24
|
+
### Sample Screenshots/Videos/GIFs: <!-- Optional -->
|
|
25
|
+
*`N/A`*
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## 2. Pull-Request Checklist
|
|
32
|
+
<!-- Check if you did what was asked of you. -->
|
|
33
|
+
- [ ] Only includes relevant changes.
|
|
34
|
+
- [ ] Only affects one part of the repository. <!-- Important -->
|
|
35
|
+
- [ ] This is based on the latest version of the main branch. <!-- Important -->
|
|
36
|
+
- [ ] Does NOT have any merge conflicts. <!-- Important -->
|
|
37
|
+
- [ ] Does NOT contain any commented-out code. <!-- Important -->
|
|
38
|
+
- [ ] Does NOT contain breaking changes that raise the major digit of the version. <!-- Important -->
|
|
39
|
+
- [ ] Does NOT have any bugs or errors.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## 4. Developer Checklist
|
|
46
|
+
<!-- Check if you did what was asked of you. -->
|
|
47
|
+
- [ ] I have read, understand and apply the contribution regulations in [CONTRIBUTING.md](CONTRIBUTING.md) <!-- Important -->
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
<!-- If you want to leave a note about complications, suggestions, future implementations, or anything else... this is where you can do it. -->
|
|
54
|
+
> [!NOTE]
|
|
55
|
+
> No note was left by the developer. :D
|
|
56
|
+
|
|
57
|
+
<!-- If you have marked that there are bugs... this is the section to specify them. -->
|
|
58
|
+
<!-- Example:
|
|
59
|
+
|
|
60
|
+
> [!CAUTION]
|
|
61
|
+
> **requirements.txt**#L1-L2: Some dependencies are outdated and need to be updated to their latest versions. This may cause compatibility issues with other parts of the repository. Please review and update the dependencies accordingly.
|
|
62
|
+
|
|
63
|
+
> [!WARNING]
|
|
64
|
+
> **.gitignore**: .gitignore file exposes .env files, which may contain sensitive information. Please ensure that these files are not included in the repository and update the .gitignore file accordingly.
|
|
65
|
+
|
|
66
|
+
-->
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
---
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# Contributing to DesignKit
|
|
2
|
+
|
|
3
|
+
First of all, thank you for considering contributing to **DesignKit**! ❤️
|
|
4
|
+
|
|
5
|
+
Our goal is to build a modern, educational, and production-ready collection of software architecture and design patterns for Python, powered by Rust where appropriate.
|
|
6
|
+
|
|
7
|
+
Please read this document before opening a Pull Request.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Philosophy
|
|
12
|
+
|
|
13
|
+
DesignKit prioritizes:
|
|
14
|
+
|
|
15
|
+
- 📚 Education and readability over micro-optimizations.
|
|
16
|
+
- 🐍 Pythonic APIs.
|
|
17
|
+
- 🦀 Rust implementations for performance-critical components.
|
|
18
|
+
- 🧩 Reusable software architecture.
|
|
19
|
+
- 📝 Complete documentation.
|
|
20
|
+
- 🧪 Reliable testing.
|
|
21
|
+
- 🔒 Stable public APIs.
|
|
22
|
+
|
|
23
|
+
Every contribution should improve the library without making it harder to understand.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Before Contributing
|
|
28
|
+
|
|
29
|
+
Make sure you:
|
|
30
|
+
|
|
31
|
+
- Read the project README.
|
|
32
|
+
- Read the LICENSE.
|
|
33
|
+
- Search existing Issues and Pull Requests.
|
|
34
|
+
- Verify your idea has not already been implemented.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
# Development Setup
|
|
39
|
+
|
|
40
|
+
Clone the repository
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/Sheniey/designkit.git
|
|
44
|
+
cd designkit
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Create a virtual environment
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
python -m venv .venv
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Activate it
|
|
54
|
+
|
|
55
|
+
Windows
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
.venv\Scripts\activate
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Linux/macOS
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
source .venv/bin/activate
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Install development dependencies
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install -e ".[dev]"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Build the Rust extension
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
maturin develop
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Run tests
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pytest
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
# Python Version
|
|
88
|
+
|
|
89
|
+
DesignKit currently targets:
|
|
90
|
+
|
|
91
|
+
- Python **3.14+**
|
|
92
|
+
|
|
93
|
+
Pull Requests using older Python syntax will not be accepted.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
# Project Structure
|
|
98
|
+
|
|
99
|
+
A typical pattern should contain:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
designkit/
|
|
103
|
+
behavioral/
|
|
104
|
+
my_pattern/
|
|
105
|
+
__init__.py
|
|
106
|
+
core.py
|
|
107
|
+
...
|
|
108
|
+
tests/
|
|
109
|
+
behavioral/
|
|
110
|
+
test_my_pattern.py
|
|
111
|
+
samples/
|
|
112
|
+
behavioral/
|
|
113
|
+
my_pattern.py
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Documentation should be reflected in:
|
|
117
|
+
|
|
118
|
+
- README.md
|
|
119
|
+
- TODO.md
|
|
120
|
+
- Pattern documentation (if applicable)
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
# Adding a New Design Pattern
|
|
125
|
+
|
|
126
|
+
Every new pattern must include:
|
|
127
|
+
|
|
128
|
+
## 1. Implementation
|
|
129
|
+
|
|
130
|
+
Implement the pattern following the project's coding style.
|
|
131
|
+
|
|
132
|
+
Prefer:
|
|
133
|
+
|
|
134
|
+
- Type hints
|
|
135
|
+
- Clear naming
|
|
136
|
+
- Small classes
|
|
137
|
+
- Small functions
|
|
138
|
+
- Documentation strings
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 2. Tests
|
|
143
|
+
|
|
144
|
+
Every feature should be tested.
|
|
145
|
+
|
|
146
|
+
Tests should cover:
|
|
147
|
+
|
|
148
|
+
- Normal usage
|
|
149
|
+
- Invalid inputs
|
|
150
|
+
- Edge cases
|
|
151
|
+
- Public API
|
|
152
|
+
|
|
153
|
+
Use `pytest`.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 3. Sample
|
|
158
|
+
|
|
159
|
+
Provide at least one working example under:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
samples/
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Examples should be educational and executable.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 4. Documentation
|
|
170
|
+
|
|
171
|
+
Document:
|
|
172
|
+
|
|
173
|
+
- What problem the pattern solves
|
|
174
|
+
- Why it exists
|
|
175
|
+
- When it should be used
|
|
176
|
+
- Advantages
|
|
177
|
+
- Disadvantages
|
|
178
|
+
- Example usage
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
# Code Style
|
|
183
|
+
|
|
184
|
+
Preferred conventions:
|
|
185
|
+
|
|
186
|
+
- PEP 8
|
|
187
|
+
- Type annotations everywhere
|
|
188
|
+
- Explicit imports
|
|
189
|
+
- Meaningful names
|
|
190
|
+
- No dead code
|
|
191
|
+
- No commented-out code
|
|
192
|
+
|
|
193
|
+
Avoid unnecessary complexity.
|
|
194
|
+
|
|
195
|
+
Readable code is preferred over clever code.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
# Rust Code
|
|
200
|
+
|
|
201
|
+
Rust is used for performance-sensitive implementations.
|
|
202
|
+
|
|
203
|
+
Rust code should:
|
|
204
|
+
|
|
205
|
+
- Follow idiomatic Rust
|
|
206
|
+
- Be memory safe
|
|
207
|
+
- Expose clean Python APIs through PyO3
|
|
208
|
+
- Avoid unsafe blocks unless absolutely necessary
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
# API Design
|
|
213
|
+
|
|
214
|
+
Public APIs should be:
|
|
215
|
+
|
|
216
|
+
- Easy to discover
|
|
217
|
+
- Easy to read
|
|
218
|
+
- Easy to type
|
|
219
|
+
- Stable
|
|
220
|
+
|
|
221
|
+
Breaking API changes are discouraged.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
# Pull Requests
|
|
226
|
+
|
|
227
|
+
Every Pull Request must use the provided PR template.
|
|
228
|
+
|
|
229
|
+
The checklist must be completed honestly.
|
|
230
|
+
|
|
231
|
+
A PR should focus on **one design pattern** whenever possible.
|
|
232
|
+
|
|
233
|
+
Large unrelated changes may be rejected.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
# Pull Request Requirements
|
|
238
|
+
|
|
239
|
+
A Pull Request should:
|
|
240
|
+
|
|
241
|
+
- Build successfully
|
|
242
|
+
- Pass all tests
|
|
243
|
+
- Include documentation
|
|
244
|
+
- Include examples
|
|
245
|
+
- Include type hints
|
|
246
|
+
- Avoid breaking changes
|
|
247
|
+
- Follow the project philosophy
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
# Commit Messages
|
|
252
|
+
|
|
253
|
+
Recommended format:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
feat(pattern): implement state pattern
|
|
257
|
+
|
|
258
|
+
fix(observer): fix subscription bug
|
|
259
|
+
|
|
260
|
+
docs: improve README
|
|
261
|
+
|
|
262
|
+
test(factory): add edge cases
|
|
263
|
+
|
|
264
|
+
refactor(builder): simplify API
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
# Reporting Bugs
|
|
270
|
+
|
|
271
|
+
Please include:
|
|
272
|
+
|
|
273
|
+
- Python version
|
|
274
|
+
- Operating system
|
|
275
|
+
- Minimal reproducible example
|
|
276
|
+
- Expected behavior
|
|
277
|
+
- Actual behavior
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
# Feature Requests
|
|
282
|
+
|
|
283
|
+
Explain:
|
|
284
|
+
|
|
285
|
+
- The problem
|
|
286
|
+
- Why it matters
|
|
287
|
+
- Possible implementation
|
|
288
|
+
- Alternatives considered
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
# Code of Conduct
|
|
293
|
+
|
|
294
|
+
Please be respectful.
|
|
295
|
+
|
|
296
|
+
Constructive discussions are encouraged.
|
|
297
|
+
|
|
298
|
+
Harassment, discrimination, or toxic behavior will not be tolerated.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
# License
|
|
303
|
+
|
|
304
|
+
By submitting code, you agree that your contribution will be licensed under the project's MIT License.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
Thank you for helping make **DesignKit** better.
|