xcpcio 0.69.2__tar.gz → 0.69.4__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.

Potentially problematic release.


This version of xcpcio might be problematic. Click here for more details.

Files changed (56) hide show
  1. {xcpcio-0.69.2 → xcpcio-0.69.4}/PKG-INFO +1 -1
  2. {xcpcio-0.69.2 → xcpcio-0.69.4}/tests/test_contest.py +1 -1
  3. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/__version__.py +1 -1
  4. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/contest_uploader.py +26 -2
  5. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/reader/contest_package_reader.py +3 -3
  6. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/types.py +1 -1
  7. {xcpcio-0.69.2 → xcpcio-0.69.4}/.gitignore +0 -0
  8. {xcpcio-0.69.2 → xcpcio-0.69.4}/.python-version +0 -0
  9. {xcpcio-0.69.2 → xcpcio-0.69.4}/README.md +0 -0
  10. {xcpcio-0.69.2 → xcpcio-0.69.4}/pyproject.toml +0 -0
  11. {xcpcio-0.69.2 → xcpcio-0.69.4}/scripts/generate_ccs_models.sh +0 -0
  12. {xcpcio-0.69.2 → xcpcio-0.69.4}/tests/__init__.py +0 -0
  13. {xcpcio-0.69.2 → xcpcio-0.69.4}/tests/test_submission.py +0 -0
  14. {xcpcio-0.69.2 → xcpcio-0.69.4}/tests/test_team.py +0 -0
  15. {xcpcio-0.69.2 → xcpcio-0.69.4}/tests/test_types.py +0 -0
  16. {xcpcio-0.69.2 → xcpcio-0.69.4}/uv.lock +0 -0
  17. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/__init__.py +0 -0
  18. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/api/__init__.py +0 -0
  19. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/api/client.py +0 -0
  20. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/api/models.py +0 -0
  21. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/app/clics_archiver.py +0 -0
  22. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/app/clics_server.py +0 -0
  23. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/app/clics_uploader.py +0 -0
  24. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/__init__.py +0 -0
  25. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/__init__.py +0 -0
  26. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/app.py +0 -0
  27. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/dependencies.py +0 -0
  28. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/__init__.py +0 -0
  29. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/access.py +0 -0
  30. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/accounts.py +0 -0
  31. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/awards.py +0 -0
  32. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/clarifications.py +0 -0
  33. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/contests.py +0 -0
  34. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/general.py +0 -0
  35. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/groups.py +0 -0
  36. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/judgement_types.py +0 -0
  37. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/judgements.py +0 -0
  38. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/languages.py +0 -0
  39. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/organizations.py +0 -0
  40. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/problems.py +0 -0
  41. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/runs.py +0 -0
  42. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/submissions.py +0 -0
  43. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/routes/teams.py +0 -0
  44. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/server.py +0 -0
  45. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/services/__init__.py +0 -0
  46. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/api_server/services/contest_service.py +0 -0
  47. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/base/__init__.py +0 -0
  48. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/base/types.py +0 -0
  49. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/clics_api_client.py +0 -0
  50. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/contest_archiver.py +0 -0
  51. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/model/__init__.py +0 -0
  52. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/model/model_2023_06/__init__.py +0 -0
  53. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/model/model_2023_06/model.py +0 -0
  54. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/reader/__init__.py +0 -0
  55. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/clics/reader/interface.py +0 -0
  56. {xcpcio-0.69.2 → xcpcio-0.69.4}/xcpcio/constants.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xcpcio
3
- Version: 0.69.2
3
+ Version: 0.69.4
4
4
  Summary: xcpcio python lib
5
5
  Project-URL: homepage, https://github.com/xcpcio/xcpcio
6
6
  Project-URL: documentation, https://github.com/xcpcio/xcpcio
@@ -13,7 +13,7 @@ class TestContest:
13
13
  assert contest.start_time == 0
14
14
  assert contest.end_time == 0
15
15
  assert contest.frozen_time == 60 * 60 # 1 hour
16
- assert contest.unfrozen_time == 0x3F3F3F3F3F3F3F3F
16
+ assert contest.thaw_time == 0x3F3F3F3F3F3F3F3F
17
17
  assert contest.penalty == 20 * 60 # 20 minutes
18
18
  assert contest.problem_id is None
19
19
  assert contest.organization == "School"
@@ -1,4 +1,4 @@
1
1
  # This file is auto-generated by Hatchling. As such, do not:
2
2
  # - modify
3
3
  # - track in version control e.g. be sure to add to .gitignore
4
- __version__ = VERSION = '0.69.2'
4
+ __version__ = VERSION = '0.69.4'
@@ -193,6 +193,24 @@ class ContestUploader:
193
193
  else:
194
194
  logger.warning(f"No validation result for {file_key}, will retry on next poll")
195
195
 
196
+ async def _fetch_api_data(
197
+ self,
198
+ api_files: Dict[str, FileData],
199
+ changed_api_files: list[str],
200
+ unchanged_files: list[str],
201
+ ):
202
+ api_data = await self._clics_client.fetch_api_info()
203
+ if api_data:
204
+ filename = "api.json"
205
+ content = json.dumps(api_data, ensure_ascii=False)
206
+
207
+ if self._cache.has_changed(filename, content):
208
+ checksum = self._cache.calculate_checksum(content)
209
+ api_files[filename] = FileData(content=content, checksum=checksum)
210
+ changed_api_files.append(filename)
211
+ else:
212
+ unchanged_files.append(filename)
213
+
196
214
  async def _fetch_contest_data(
197
215
  self,
198
216
  ) -> tuple[Dict[str, FileData], list[str], list[str]]:
@@ -248,9 +266,15 @@ class ContestUploader:
248
266
  return response
249
267
 
250
268
  async def fetch_and_upload(self) -> Optional[Dict]:
251
- await self._clics_client.fetch_api_info()
269
+ api_files, changed_api_files, unchanged_files = ({}, [], [])
270
+
271
+ await self._fetch_api_data(api_files, changed_api_files, unchanged_files)
272
+
273
+ contest_files, contest_changed, contest_unchanged = await self._fetch_contest_data()
274
+ api_files.update(contest_files)
275
+ changed_api_files.extend(contest_changed)
276
+ unchanged_files.extend(contest_unchanged)
252
277
 
253
- api_files, changed_api_files, unchanged_files = await self._fetch_contest_data()
254
278
  await self._fetch_endpoint_data(api_files, changed_api_files, unchanged_files)
255
279
 
256
280
  if changed_api_files:
@@ -38,7 +38,7 @@ class ContestPackageReader(BaseContestReader):
38
38
  return json.load(f)
39
39
  except FileNotFoundError:
40
40
  if default_value is not None:
41
- logger.warning("File not found, will return default value. [filepath={}]", filepath)
41
+ logger.warning(f"File not found, will load default value. [full_path={full_path}]")
42
42
  return default_value
43
43
  raise HTTPException(status_code=404, detail=f"File not found: {filepath}")
44
44
  except json.JSONDecodeError as e:
@@ -56,7 +56,7 @@ class ContestPackageReader(BaseContestReader):
56
56
  return data
57
57
  except FileNotFoundError:
58
58
  if default_value is not None:
59
- logger.warning("File not found, will load default value. [filepath={}]", filepath)
59
+ logger.warning(f"File not found, will load default value. [full_path={full_path}]")
60
60
  return default_value
61
61
  raise HTTPException(status_code=404, detail=f"File not found: {filepath}")
62
62
  except json.JSONDecodeError as e:
@@ -111,7 +111,7 @@ class ContestPackageReader(BaseContestReader):
111
111
  self.event_feed = self._load_ndjson_file("event-feed.ndjson", default_value=[])
112
112
  self.event_feed_tokens = [event["token"] for event in self.event_feed]
113
113
 
114
- self.contest_id = self.contest["id"]
114
+ self.contest_id = self.contest.get("id", "")
115
115
 
116
116
  def _get_file_attr(self, expected_href: str, base_path: Path, files: List[Dict]) -> FileAttr:
117
117
  for file in files:
@@ -219,7 +219,7 @@ class Contest(BaseModel):
219
219
 
220
220
  options: Optional[ContestOptions] = None
221
221
 
222
- unfrozen_time: int = Field(default=0x3F3F3F3F3F3F3F3F, exclude=True)
222
+ thaw_time: int = Field(default=0x3F3F3F3F3F3F3F3F, exclude=True)
223
223
 
224
224
  def append_balloon_color(self, color: BalloonColor):
225
225
  if self.balloon_color is None:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes