half-orm-dev 0.16.0a1__py3-none-any.whl

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 (38) hide show
  1. half_orm_dev/__init__.py +0 -0
  2. half_orm_dev/changelog.py +117 -0
  3. half_orm_dev/cli_extension.py +171 -0
  4. half_orm_dev/database.py +127 -0
  5. half_orm_dev/db_conn.py +134 -0
  6. half_orm_dev/hgit.py +202 -0
  7. half_orm_dev/hop.py +167 -0
  8. half_orm_dev/manifest.py +43 -0
  9. half_orm_dev/modules.py +357 -0
  10. half_orm_dev/patch.py +348 -0
  11. half_orm_dev/patches/0/1/0/00_half_orm_meta.database.sql +34 -0
  12. half_orm_dev/patches/0/1/0/01_alter_half_orm_meta.hop_release.sql +2 -0
  13. half_orm_dev/patches/0/1/0/02_half_orm_meta.view.hop_penultimate_release.sql +3 -0
  14. half_orm_dev/patches/log +2 -0
  15. half_orm_dev/patches/sql/half_orm_meta.sql +208 -0
  16. half_orm_dev/repo.py +266 -0
  17. half_orm_dev/templates/.gitignore +14 -0
  18. half_orm_dev/templates/MANIFEST.in +1 -0
  19. half_orm_dev/templates/Pipfile +13 -0
  20. half_orm_dev/templates/README +25 -0
  21. half_orm_dev/templates/base_test +26 -0
  22. half_orm_dev/templates/init_module_template +6 -0
  23. half_orm_dev/templates/module_template_1 +12 -0
  24. half_orm_dev/templates/module_template_2 +5 -0
  25. half_orm_dev/templates/module_template_3 +3 -0
  26. half_orm_dev/templates/relation_test +19 -0
  27. half_orm_dev/templates/setup.py +81 -0
  28. half_orm_dev/templates/sql_adapter +9 -0
  29. half_orm_dev/templates/warning +12 -0
  30. half_orm_dev/utils.py +12 -0
  31. half_orm_dev/version.txt +1 -0
  32. half_orm_dev-0.16.0a1.dist-info/METADATA +314 -0
  33. half_orm_dev-0.16.0a1.dist-info/RECORD +38 -0
  34. half_orm_dev-0.16.0a1.dist-info/WHEEL +5 -0
  35. half_orm_dev-0.16.0a1.dist-info/entry_points.txt +2 -0
  36. half_orm_dev-0.16.0a1.dist-info/licenses/AUTHORS +3 -0
  37. half_orm_dev-0.16.0a1.dist-info/licenses/LICENSE +14 -0
  38. half_orm_dev-0.16.0a1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,314 @@
1
+ Metadata-Version: 2.4
2
+ Name: half_orm_dev
3
+ Version: 0.16.0a1
4
+ Summary: half_orm development Framework.
5
+ Home-page: https://github.com/collorg/halfORM_dev
6
+ Author: Joël Maïzi
7
+ Author-email: joel.maizi@collorg.org
8
+ License: GNU General Public License v3 (GPLv3)
9
+ Keywords: postgres,relation-object mapping
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Build Tools
13
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
14
+ Classifier: Programming Language :: Python :: 3.6
15
+ Classifier: Programming Language :: Python :: 3.7
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ License-File: AUTHORS
20
+ Requires-Dist: GitPython
21
+ Requires-Dist: click
22
+ Requires-Dist: pydash
23
+ Requires-Dist: half_orm>=0.14.0
24
+ Requires-Dist: pytest
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: keywords
32
+ Dynamic: license
33
+ Dynamic: license-file
34
+ Dynamic: requires-dist
35
+ Dynamic: summary
36
+
37
+ # halfORM packager (early alpha stage)
38
+
39
+ > **📢 Project Evolution Notice**
40
+ >
41
+ > **halfORM_dev is being redesigned to integrate with halfORM 0.16's new extension system.**
42
+ >
43
+ > This project will be refactored as `half-orm-dev` to provide development tools through the unified `half_orm` CLI interface. The core functionality (project management, database patches, code generation) will remain the same, but the integration and command structure will be modernized.
44
+ >
45
+ > **Current Status:**
46
+ > - halfORM core 0.16 with extension is about to be released
47
+ > - halfORM_dev refactoring will start soon
48
+ > - New `half-orm-dev` extension planned for Q3 2025
49
+ >
50
+ > **What's Changing:**
51
+ > - Commands will integrate with `half_orm dev` instead of standalone `hop`
52
+ > - Extension auto-discovery and security model
53
+ > - Simplified installation and configuration
54
+ > - Consistent CLI experience across all halfORM tools
55
+ >
56
+ > **For Current Users:**
57
+ > The existing halfORM_dev will continue to work as-is. The new extension will provide a migration path when ready.
58
+ >
59
+ > **Stay Updated:**
60
+ > Follow progress in [halfORM Discussions](https://github.com/collorg/halfORM/discussions) and [halfORM Issues](https://github.com/collorg/halfORM/issues).
61
+
62
+ ---
63
+
64
+ THIS DOC IS A WORK IN PROGRESS...
65
+
66
+ This package allows you to patch/test a PostgreSQL model and its associated
67
+ Python code using the `hop` command.
68
+
69
+ It is based on the [half_orm](https://github.com/collorg/halfORM)
70
+ PostgreSQL → Python relation object mapper.
71
+
72
+
73
+ ## Installation
74
+
75
+ Run `pip install half_orm_dev`.
76
+
77
+ ## help
78
+
79
+ ```
80
+ $ hop --help
81
+ Usage: hop [OPTIONS] COMMAND [ARGS]...
82
+
83
+ Generates/Synchronises/Patches a python package from a PostgreSQL database
84
+
85
+ Options:
86
+ -v, --version
87
+ --help Show this message and exit.
88
+
89
+ Commands:
90
+ new Creates a new hop project named <package_name>.
91
+ patch Applies the next patch
92
+ test Tests some common pitfalls.
93
+ update Updates the Python code with the changes made to the model.
94
+ ```
95
+
96
+ ## Create a new package for your database: *`hop new`*
97
+
98
+ ```
99
+ hop new <package name>
100
+ ```
101
+
102
+ **WARNING!** The `hop new` command will add to your database
103
+ two new schemas: `half_orm_meta` and "`half_orm_meta.view`".
104
+ The table `half_orm_meta.release` will containt the patch history
105
+ of your model (see `hop patch` bellow).
106
+
107
+
108
+ ```
109
+ $ hop new pagila
110
+ HALFORM_CONF_DIR: /home/joel/.halform
111
+ Using '/home/joel/.halform/pagila' file for connexion.
112
+ Initializing git with a 'main' branch.
113
+ Initializing the patch system for the 'pagila' database.
114
+ Patch system initialized at release '0.0.0'.
115
+
116
+ The hop project 'pagila' has been created.
117
+ ```
118
+
119
+ The tree command shows you the repartition of the modules in your package.
120
+
121
+ ```
122
+ $ tree pagila
123
+ pagila
124
+ ├── Backups
125
+ │ └── pagila-pre-patch.sql
126
+ ├── pagila
127
+ │ ├── base_test.py
128
+ │ ├── db_connector.py
129
+ │ ├── __init__.py
130
+ │ └── public
131
+ │ ├── actor_info.py
132
+ │ ├── actor_info_test.py
133
+ │ ├── actor.py
134
+ │ ├── actor_test.py
135
+ │ ├── address.py
136
+ │ ├── address_test.py
137
+ │ ├── category.py
138
+ │ ├── category_test.py
139
+ │ ├── city.py
140
+ │ ├── city_test.py
141
+ │ ├── country.py
142
+ │ ├── country_test.py
143
+ │ ├── customer_list.py
144
+ │ ├── customer_list_test.py
145
+ │ ├── customer.py
146
+ │ ├── customer_test.py
147
+ │ ├── film_actor.py
148
+ │ ├── film_actor_test.py
149
+ │ ├── film_category.py
150
+ │ ├── film_category_test.py
151
+ │ ├── film_list.py
152
+ │ ├── film_list_test.py
153
+ │ ├── film.py
154
+ │ ├── film_test.py
155
+ │ ├── __init__.py
156
+ │ ├── inventory.py
157
+ │ ├── inventory_test.py
158
+ │ ├── language.py
159
+ │ ├── language_test.py
160
+ │ ├── nicer_but_slower_film_list.py
161
+ │ ├── nicer_but_slower_film_list_test.py
162
+ │ ├── payment_p2020_01.py
163
+ │ ├── payment_p2020_01_test.py
164
+ │ ├── payment_p2020_02.py
165
+ │ ├── payment_p2020_02_test.py
166
+ │ ├── payment_p2020_03.py
167
+ │ ├── payment_p2020_03_test.py
168
+ │ ├── payment_p2020_04.py
169
+ │ ├── payment_p2020_04_test.py
170
+ │ ├── payment_p2020_05.py
171
+ │ ├── payment_p2020_05_test.py
172
+ │ ├── payment_p2020_06.py
173
+ │ ├── payment_p2020_06_test.py
174
+ │ ├── payment.py
175
+ │ ├── payment_test.py
176
+ │ ├── rental.py
177
+ │ ├── rental_test.py
178
+ │ ├── sales_by_film_category.py
179
+ │ ├── sales_by_film_category_test.py
180
+ │ ├── sales_by_store.py
181
+ │ ├── sales_by_store_test.py
182
+ │ ├── staff_list.py
183
+ │ ├── staff_list_test.py
184
+ │ ├── staff.py
185
+ │ ├── staff_test.py
186
+ │ ├── store.py
187
+ │ └── store_test.py
188
+ ├── Patches
189
+ │ └── README
190
+ ├── Pipfile
191
+ ├── README.md
192
+ └── setup.py
193
+ ```
194
+
195
+ Once created, go to the newly created directory
196
+
197
+ ```
198
+ cd pagila
199
+ ```
200
+
201
+ ## The organisation
202
+
203
+ ```
204
+ $ tree -d
205
+ .
206
+ ├── Backups
207
+ ├── pagila
208
+ │ └── public
209
+ └── Patches
210
+ ```
211
+
212
+ You will now be able to manage your package with the `hop` command.
213
+
214
+ ## Get the status of your package: *`hop`*
215
+
216
+ ```
217
+ $ hop
218
+ STATUS
219
+
220
+ connection_file_name: pagila
221
+ package_name: pagila
222
+
223
+ CURRENT RELEASE: 0.0.0: 2021-09-03 at 11:54:22+02:00
224
+ No new release to apply after 0.0.0.
225
+ Next possible releases: 0.0.1, 0.1.0, 1.0.0.
226
+ hop --help to get help.
227
+ ```
228
+
229
+ ## Patch your model: *`hop patch`*
230
+
231
+ ```
232
+ $ hop patch
233
+ No new release to apply after 0.0.0.
234
+ Next possible releases: 0.0.1, 0.1.0, 1.0.0.
235
+ ```
236
+
237
+ The patch system will try to find a next suitable patch to apply from the
238
+ last release number. If the last patch is X.Y.Z, `hop patch` will try in order
239
+ X.Y.<Z+1>, X.<Y+1>.Z, <X+1>.Y.Z.
240
+
241
+
242
+ To prepare a new patch, run `hop patch -p <patch_level>` where patch_level is one
243
+ of ['patch', 'minor', 'major']. The command will create a directory in
244
+ `Patches/X/Y/Z` with a CHANGELOG.md description file. You can add in this
245
+ directory a series of patches scripts.
246
+ The scripts are applied in alphabetical order and can only be of two types:
247
+
248
+
249
+ * SQL with .sql extension
250
+ * Python with .py extension
251
+
252
+ If there is a suitable patch to apply, hop will create a branch `hop_<release>`,
253
+ backup the database in `Backups/<dbname>-<release>.sql`, apply the patch and
254
+ update the Python code.
255
+
256
+ In development, you will frequently need to adjust a patch.
257
+ To replay a patch, simply run `hop patch` again.
258
+
259
+ To revert to the previous patch run `hop patch -r`.
260
+ If your git repo is not clean, `hop patch` will complain. You can use `hop patch -f`
261
+ to avoid the warning.
262
+
263
+ You can use git as you wish during this phase.
264
+ ## Generate a release (CI): *`hop release`* NotImplented
265
+
266
+ * `hop release -a` for alpha
267
+ * `hop release -c` for release candidate
268
+ * `hop release -p` for production
269
+
270
+ ## Test your code
271
+
272
+ Each `hop patch` should test and report any error.
273
+
274
+ The package is test ready. For each module there is a test
275
+
276
+ ```
277
+ $ pytest pagila/
278
+ ================= test session starts =================
279
+ platform linux -- Python 3.8.5, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
280
+ rootdir: /home/joel/Dev/halfORM_packager/tmp/pagila
281
+ collected 28 items
282
+
283
+ pagila/public/actor_info_test.py . [ 3%]
284
+ pagila/public/actor_test.py . [ 7%]
285
+ pagila/public/address_test.py . [ 10%]
286
+ pagila/public/category_test.py . [ 14%]
287
+ pagila/public/city_test.py . [ 17%]
288
+ pagila/public/country_test.py . [ 21%]
289
+ pagila/public/customer_list_test.py . [ 25%]
290
+ pagila/public/customer_test.py . [ 28%]
291
+ pagila/public/film_actor_test.py . [ 32%]
292
+ pagila/public/film_category_test.py . [ 35%]
293
+ pagila/public/film_list_test.py . [ 39%]
294
+ pagila/public/film_test.py . [ 42%]
295
+ pagila/public/inventory_test.py . [ 46%]
296
+ pagila/public/language_test.py . [ 50%]
297
+ pagila/public/nicer_but_slower_film_list_test.py . [ 53%]
298
+ [ 53%]
299
+ pagila/public/payment_p2020_01_test.py . [ 57%]
300
+ pagila/public/payment_p2020_02_test.py . [ 60%]
301
+ pagila/public/payment_p2020_03_test.py . [ 64%]
302
+ pagila/public/payment_p2020_04_test.py . [ 67%]
303
+ pagila/public/payment_p2020_05_test.py . [ 71%]
304
+ pagila/public/payment_p2020_06_test.py . [ 75%]
305
+ pagila/public/payment_test.py . [ 78%]
306
+ pagila/public/rental_test.py . [ 82%]
307
+ pagila/public/sales_by_film_category_test.py . [ 85%]
308
+ pagila/public/sales_by_store_test.py . [ 89%]
309
+ pagila/public/staff_list_test.py . [ 92%]
310
+ pagila/public/staff_test.py . [ 96%]
311
+ pagila/public/store_test.py . [100%]
312
+
313
+ ================= 28 passed in 0.18s ==================
314
+ ```
@@ -0,0 +1,38 @@
1
+ half_orm_dev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ half_orm_dev/changelog.py,sha256=dWgwEYvbRfvisRwQ9OgTFv2Dy0jNzrQyYln5L6RjRBo,4294
3
+ half_orm_dev/cli_extension.py,sha256=EFMLw3zmXCi7uev7GRGWmmuMAIpbWfPiMy8Qk2-Fhd0,5418
4
+ half_orm_dev/database.py,sha256=pceI49B_cC_5G3pLBTVG5kRFNdh4LBOspPl-3NA5lQw,4538
5
+ half_orm_dev/db_conn.py,sha256=PNL62_l1ERBMXJJp95ytwzSYQR-0VXO4IZVTmt6FKlo,4490
6
+ half_orm_dev/hgit.py,sha256=gAmuyFVhYqF3tLhucB7MO1b4GlVYNZrCupZo7HR5tXM,8132
7
+ half_orm_dev/hop.py,sha256=MXae6KV8bRsnXznfItk1V3PaEefLbV3znxgKDD5vCU8,5237
8
+ half_orm_dev/manifest.py,sha256=1BKDQf64baI8KOacW6Jx6IiopUtYitZcM44wrBwQhQw,1265
9
+ half_orm_dev/modules.py,sha256=cmsh-f9L6XK55oaVwYbrQScFOR9Iia6-nOOzzAjKePI,14206
10
+ half_orm_dev/patch.py,sha256=QHSg2kywgJdf2QLul7e9G7zg2agRRdOItspLYikQU4Y,14634
11
+ half_orm_dev/repo.py,sha256=lbcRnnb4T1L2yb5LLsNh0K62U1xIGNQdUy7bgp4Bd7E,8966
12
+ half_orm_dev/utils.py,sha256=PJ_JcWNowswbnCaWvecKLFB36XzPiNseZb4YIUBtBHM,333
13
+ half_orm_dev/version.txt,sha256=VtObc4nHx1TqD5eylVGLG28O2tD6NaXw81y3nN_X3CY,10
14
+ half_orm_dev/patches/log,sha256=n7MNnGR09Obd87gXLzIi6zA76sI4RhOJzC25wb0TbKE,22
15
+ half_orm_dev/patches/0/1/0/00_half_orm_meta.database.sql,sha256=gMZ94YlyrftxcqDn0l-ToCTee4A_bnP58DpHcIT_T1w,1074
16
+ half_orm_dev/patches/0/1/0/01_alter_half_orm_meta.hop_release.sql,sha256=nhRbDi6sUenvVfOnoRuWSbLEC1cEfzrXbxDof2weq04,183
17
+ half_orm_dev/patches/0/1/0/02_half_orm_meta.view.hop_penultimate_release.sql,sha256=Bd0lXJ6vC0JNe06yqTWYVSrwVDElCI3McSS5pm-Ijlo,306
18
+ half_orm_dev/patches/sql/half_orm_meta.sql,sha256=Vl2YzEWpWdam-tC0ZE8iNMeTRzEHpxtNhdBThbHb2u4,5864
19
+ half_orm_dev/templates/.gitignore,sha256=aHy4XGngr0kBPXSZHnNkDL4R2rK8hF4Lx2FM3I-O8cM,99
20
+ half_orm_dev/templates/MANIFEST.in,sha256=53BeBuKi8UtBWB6IG3VQZk9Ow8Iye6Zs14sP-gVyVDA,25
21
+ half_orm_dev/templates/Pipfile,sha256=u3lGJSk5HZwz-EOTrOdBYrkhGV6zgVtrrRPivrO5rmA,182
22
+ half_orm_dev/templates/README,sha256=Jb26Qv41KGSfD-6FpyqF7EEiPpI5nmhtpdsCJolg1pA,904
23
+ half_orm_dev/templates/base_test,sha256=UUtpB9JbSKtkXv2LUOOrMKsRPc3_ZRXWImSHtibs-II,445
24
+ half_orm_dev/templates/init_module_template,sha256=1cQeoVr_fL0rVXNwGTgaV7RCrFGBx4ybP-1HTPGI7lM,169
25
+ half_orm_dev/templates/module_template_1,sha256=-Zmq-v1vyzVMtHP0ECFUeVl26AA3UUYoMxPXL_dtIJU,256
26
+ half_orm_dev/templates/module_template_2,sha256=lQpgEX89yHHQlposwCLvBYv0P0J-4G9ZMIm13-1oZZA,165
27
+ half_orm_dev/templates/module_template_3,sha256=yjpQYT0EsIA6TI8KeyFaw_nHP9zCBma6o7g3P1MDs_M,187
28
+ half_orm_dev/templates/relation_test,sha256=QFIPu6J3Gnc4IQTTVN7Szm0UmMg6N_j-IMpmpi-zluc,460
29
+ half_orm_dev/templates/setup.py,sha256=hnnJ4cLnECbxzaTLeVBYd3aR-2kk6KuF1xkAoXWQN5A,2061
30
+ half_orm_dev/templates/sql_adapter,sha256=kAP5y7Qml3DKsbZLUeoVpeXjbQcWltHjkDznEDKNpek,190
31
+ half_orm_dev/templates/warning,sha256=4hlZ_rRdpmkXxOeRoVd9xnXBARYXn95e-iXrD1f2u7k,490
32
+ half_orm_dev-0.16.0a1.dist-info/licenses/AUTHORS,sha256=eWxqzRdLOt2gX0FMQj_wui03Od3jdlwa8xNe9tl84g0,113
33
+ half_orm_dev-0.16.0a1.dist-info/licenses/LICENSE,sha256=ufhxlSi6mttkGQTsGWrEoB3WA_fCPJ6-k07GSVBgyPw,644
34
+ half_orm_dev-0.16.0a1.dist-info/METADATA,sha256=yXk-7V-dH3EH9dOa5YzuGzsxSuGo5k7oj_htbJ3UY6M,10206
35
+ half_orm_dev-0.16.0a1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
+ half_orm_dev-0.16.0a1.dist-info/entry_points.txt,sha256=qaM6BMXgT4OIIRaIrShZQ_sKlqVIgl8QRHk3h0m3uns,46
37
+ half_orm_dev-0.16.0a1.dist-info/top_level.txt,sha256=M5hEsWfn5Kw0HL-VnNmS6Jw-3cwRyjims5a8cr18eTM,13
38
+ half_orm_dev-0.16.0a1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ hop = half_orm_dev.hop:main
@@ -0,0 +1,3 @@
1
+ # This is the list of half_orm_dev's significant contributors.
2
+ # Hopefully, it will become larger...
3
+ Joël Maizi
@@ -0,0 +1,14 @@
1
+ This file is part of half_orm_dev.
2
+
3
+ half_orm_dev is free software: you can redistribute it and/or modify
4
+ it under the terms of the GNU General Public License as published by
5
+ the Free Software Foundation, either version 3 of the License, or
6
+ (at your option) any later version.
7
+
8
+ half_orm is distributed in the hope that it will be useful,
9
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ GNU General Public License for more details.
12
+
13
+ You should have received a copy of the GNU General Public License
14
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -0,0 +1 @@
1
+ half_orm_dev