checkmate5 4.0.94__py3-none-any.whl → 4.0.95__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.
checkmate/lib/models.py CHANGED
@@ -432,6 +432,9 @@ class ProjectIssueClass(BaseDocument):
432
432
  class Project(BaseDocument):
433
433
 
434
434
  IssueClass = IssueClass
435
+ project_id = IntegerField(indexed=True, unique=True)
436
+
437
+
435
438
 
436
439
  # contains a hash of the project configuration that will be used to mark
437
440
  # snapshots, diffs, file revisions etc.
@@ -91,12 +91,12 @@ def get_backend(project_path, project_config, settings, echo=False, initialize_d
91
91
  if not connection_string:
92
92
  raise ValueError("Connection string is required for the 'sql' backend.")
93
93
  engine = create_engine(connection_string)
94
- backend = Backend(engine)
94
+ backend = SQLBackend(engine)
95
95
  elif backend_type == "sqlite":
96
96
  if not connection_string:
97
97
  connection_string = f"sqlite:///{project_path}/database.db"
98
98
  engine = create_engine(connection_string, echo=echo)
99
- backend = Backend(engine)
99
+ backend = FileBackend(engine)
100
100
  else:
101
101
  raise ValueError("Unsupported backend type specified.")
102
102
 
@@ -112,15 +112,16 @@ def get_project(project_path, project_config, settings, backend):
112
112
  project_class = project_config.get('project_class', 'Project')
113
113
  ProjectClass = settings.models[project_class]
114
114
 
115
- try:
116
- project = backend.filter(ProjectClass, {'pk': project_config['project_id']}).first()
117
- except ProjectClass.DoesNotExist:
115
+ # Attempt to find the project by project_id
116
+ project = backend.filter(ProjectClass, {'pk': project_config['project_id']}).first()
117
+
118
+ # If the project doesn't exist, create a new one
119
+ if project is None:
118
120
  project = ProjectClass(pk=project_config['project_id'])
119
121
  backend.add(project)
120
- project = backend.query(ProjectClass).filter_by(pk=project_config['project_id']).first()
122
+ # If needed, ensure that the project is persisted
123
+ backend.commit() # If your backend requires an explicit commit
121
124
 
122
- project.path = project_path
123
- backend.add(project)
124
125
  return project
125
126
 
126
127
  def main():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: checkmate5
3
- Version: 4.0.94
3
+ Version: 4.0.95
4
4
  Summary: A meta-code checker written in Python.
5
5
  Author: Andreas Dewes
6
6
  License: AGPL-3.0
@@ -72,7 +72,7 @@ checkmate/helpers/issue.py,sha256=7wImtI8uZR5VcE_1u7mI8qvEXU97p6Rzkb1bbJkqXKQ,38
72
72
  checkmate/helpers/settings.py,sha256=97zsz4vNq7EpUpRME4XQvvp5LUp3618ZvSfNTce_4j4,322
73
73
  checkmate/lib/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
74
74
  checkmate/lib/backend.py,sha256=dO3rMqI70D8-9CrgL3qu3fqKf0BXvJCDIgSIys8IRyM,3683
75
- checkmate/lib/models.py,sha256=Myzjf7ChJnObPpMLXv34znMXkeP0Fma54iUN9uSl8AI,20191
75
+ checkmate/lib/models.py,sha256=rqIMCwyZjgDz59QDZGX8HSKSBNT2oNkOubFuDolVWjk,20254
76
76
  checkmate/lib/analysis/__init__.py,sha256=_JpM1GkChWCfLKqPqEz3-8DCPwNe7lPwQDMoF_6Ore0,45
77
77
  checkmate/lib/analysis/base.py,sha256=R9Zy6rKKCw1LSAsBBBaBbgFEo6Fkdx8DTtp7bsYoywE,3309
78
78
  checkmate/lib/code/__init__.py,sha256=a_z91IbpJCeWSjv4Qh2NAlcLhSfesGJ_fFXiz7i5JGI,84
@@ -82,7 +82,7 @@ checkmate/lib/stats/helpers.py,sha256=X21Pb7dz3PWubDRoqUjbxwonl43TRxqKEcwyM80tS6
82
82
  checkmate/lib/stats/mapreduce.py,sha256=rGdA_HninEZSeowtBn5R02c6wyT5dxcu-0T2ftlMnY0,782
83
83
  checkmate/management/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
84
84
  checkmate/management/decorators.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
85
- checkmate/management/helpers.py,sha256=8AQ2qNBBJ16H4T4G5FolH9RhdLQ1adVdzxrkLEaxcsU,5411
85
+ checkmate/management/helpers.py,sha256=sWxdeJTK1UbqWW8B1xxaWuSFdMkJAHerFxGGfombRV8,5469
86
86
  checkmate/management/commands/__init__.py,sha256=XAi0y8z1NviyGvLB68Oxnzr6Nw5AP8xgbcSSnc1Zcvw,766
87
87
  checkmate/management/commands/alembic.py,sha256=DTWH8hcY6UmWDo0wMwcID_wQIa-es7nyJHV6p1_T4FQ,718
88
88
  checkmate/management/commands/analyze.py,sha256=J1rawVEGjbrXT9ArfUVpfoLNs2JaFkV4mCrBnEIrXaw,1159
@@ -110,9 +110,9 @@ checkmate/scripts/manage.py,sha256=mpioBaxzirAKXZtbxO-y4dbOcc6UoP0MaAMsNuKHbz0,4
110
110
  checkmate/settings/__init__.py,sha256=z32hPz-kGS-tTGa6dWCFjrrrbS_eagLd-YrqBP3gjWI,33
111
111
  checkmate/settings/base.py,sha256=3WBXZITqoWepIja96bo5JTi-TDpQALPTCugL0E8z-yE,4551
112
112
  checkmate/settings/defaults.py,sha256=HJoZIin2BHT_gBCngGZNh7WgSNLqIDTK--iW7hXez4Q,5084
113
- checkmate5-4.0.94.dist-info/LICENSE.txt,sha256=9cSf5btiPmglu3yzhXkXcf7GNT8XC9o7Y54tfhvfDp8,213739
114
- checkmate5-4.0.94.dist-info/METADATA,sha256=4NQLq6ADtFGD-4pmZlAGN3EzOgJIfcDVSxbgxbre2vg,1234
115
- checkmate5-4.0.94.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
116
- checkmate5-4.0.94.dist-info/entry_points.txt,sha256=FbGnau5C4z98WmBYpMJqUzobQEr1AIi9aZApSavNojQ,60
117
- checkmate5-4.0.94.dist-info/top_level.txt,sha256=tl6eIJXedpLZbcbmYEwlhEzuTaSt0TvIRUesOb8gtng,10
118
- checkmate5-4.0.94.dist-info/RECORD,,
113
+ checkmate5-4.0.95.dist-info/LICENSE.txt,sha256=9cSf5btiPmglu3yzhXkXcf7GNT8XC9o7Y54tfhvfDp8,213739
114
+ checkmate5-4.0.95.dist-info/METADATA,sha256=f9YnctawSaJrWbF4h5btY6FnDUFfianTFkFtGoO8VvA,1234
115
+ checkmate5-4.0.95.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
116
+ checkmate5-4.0.95.dist-info/entry_points.txt,sha256=FbGnau5C4z98WmBYpMJqUzobQEr1AIi9aZApSavNojQ,60
117
+ checkmate5-4.0.95.dist-info/top_level.txt,sha256=tl6eIJXedpLZbcbmYEwlhEzuTaSt0TvIRUesOb8gtng,10
118
+ checkmate5-4.0.95.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.5.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5