winipedia-utils 0.3.40__py3-none-any.whl → 0.3.43__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.

Potentially problematic release.


This version of winipedia-utils might be problematic. Click here for more details.

@@ -25,27 +25,28 @@ class Workflow(YamlConfigFile):
25
25
 
26
26
  def get_path(self) -> Path:
27
27
  """Get the path to the config file."""
28
- file_name = (
29
- "_".join(
30
- split_on_uppercase(
31
- self.__class__.__name__.removesuffix(Workflow.__name__)
32
- )
33
- ).lower()
34
- + ".yaml"
35
- )
28
+ file_name = self.get_standard_job_name() + ".yaml"
36
29
  return Path(".github/workflows") / file_name
37
30
 
38
- @staticmethod
31
+ @classmethod
39
32
  def get_standard_job(
40
- name: str,
41
- steps: list[dict[str, Any]],
33
+ cls,
34
+ name: str | None = None,
35
+ runs_on: str = "ubuntu-latest",
42
36
  permissions: dict[str, Any] | None = None,
43
37
  if_condition: str | None = None,
38
+ steps: list[dict[str, Any]] | None = None,
44
39
  ) -> dict[str, Any]:
45
40
  """Get a standard job."""
41
+ if name is None:
42
+ name = cls.get_standard_job_name()
43
+
44
+ if steps is None:
45
+ steps = []
46
+
46
47
  job: dict[str, Any] = {
47
48
  name: {
48
- "runs-on": "ubuntu-latest",
49
+ "runs-on": runs_on,
49
50
  "steps": steps,
50
51
  }
51
52
  }
@@ -56,6 +57,13 @@ class Workflow(YamlConfigFile):
56
57
  job[name]["if"] = if_condition
57
58
  return job
58
59
 
60
+ @classmethod
61
+ def get_standard_job_name(cls) -> str:
62
+ """Get the standard job name."""
63
+ return "_".join(
64
+ split_on_uppercase(cls.__name__.removesuffix(Workflow.__name__))
65
+ ).lower()
66
+
59
67
  @classmethod
60
68
  def get_workflow_name(cls) -> str:
61
69
  """Get the workflow name."""
@@ -24,8 +24,8 @@ class HealthCheckWorkflow(Workflow):
24
24
  # also run once a week on main
25
25
  "schedule": [
26
26
  {
27
- # run every Sunday at 2:30 am
28
- "cron": "30 2 * * 0",
27
+ # run every Monday at 5 am
28
+ "cron": "0 5 * * 1",
29
29
  },
30
30
  ],
31
31
  "workflow_dispatch": {},
@@ -40,7 +40,6 @@ class HealthCheckWorkflow(Workflow):
40
40
  def get_jobs(self) -> dict[str, Any]:
41
41
  """Get the workflow jobs."""
42
42
  return self.get_standard_job(
43
- "check-pull-request",
44
43
  steps=[
45
44
  *(
46
45
  self.get_poetry_setup_steps(
@@ -34,7 +34,6 @@ class PublishWorkflow(Workflow):
34
34
  def get_jobs(self) -> dict[str, Any]:
35
35
  """Get the workflow jobs."""
36
36
  return self.get_standard_job(
37
- "publish",
38
37
  steps=[
39
38
  *(
40
39
  self.get_poetry_setup_steps(
@@ -5,10 +5,10 @@ This workflow is used to create a release on GitHub.
5
5
 
6
6
  from typing import Any
7
7
 
8
- from winipedia_utils.git.workflows.base.base import Workflow
8
+ from winipedia_utils.git.workflows.health_check import HealthCheckWorkflow
9
9
 
10
10
 
11
- class ReleaseWorkflow(Workflow):
11
+ class ReleaseWorkflow(HealthCheckWorkflow):
12
12
  """Release workflow.
13
13
 
14
14
  This workflow is triggered by a push to the main branch.
@@ -28,16 +28,6 @@ class ReleaseWorkflow(Workflow):
28
28
 
29
29
  def get_jobs(self) -> dict[str, Any]:
30
30
  """Get the workflow jobs."""
31
- return self.get_standard_job(
32
- "release",
33
- steps=[
34
- *(
35
- self.get_poetry_setup_steps(
36
- install_dependencies=True,
37
- fetch_depth=0,
38
- )
39
- ),
40
- self.get_pre_commit_step(),
41
- *self.get_release_steps(),
42
- ],
43
- )
31
+ steps = super().get_jobs()
32
+ steps[self.get_standard_job_name()]["steps"].extend(self.get_release_steps())
33
+ return steps
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: winipedia-utils
3
- Version: 0.3.40
3
+ Version: 0.3.43
4
4
  Summary: A package with many utility functions
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -18,10 +18,10 @@ winipedia_utils/git/pre_commit/hooks.py,sha256=KHP-CEo-zv1BJNKfKr2ymUNf69bCX42w2
18
18
  winipedia_utils/git/pre_commit/run_hooks.py,sha256=PVwEDXymeg0OebAx9Vd53vD4UkzVSlCUesKdvfCA6V8,1468
19
19
  winipedia_utils/git/workflows/__init__.py,sha256=BPdntTwFEyBMJ6MyT7gddPHswvRdH9tsRtfK72VSV7Y,57
20
20
  winipedia_utils/git/workflows/base/__init__.py,sha256=XHsbmjiaGom-KX-S3leCY9cJD3aP9p_0X6xYMcdkHBU,23
21
- winipedia_utils/git/workflows/base/base.py,sha256=nmLPoMh3Sn8NwFyqIWlaLFy2IA6UlI4G5feGk9d4n4c,7266
22
- winipedia_utils/git/workflows/health_check.py,sha256=XPBSVluXx0_WSkl_KsiMFjCNnwo_gXRaxtSssgJdwp0,1387
23
- winipedia_utils/git/workflows/publish.py,sha256=8XSSJDpSiDLcowoyKJ06zbZG39v4GRXwGmE7dUykqHw,1342
24
- winipedia_utils/git/workflows/release.py,sha256=3Y-4SN94iNP5IH86iiRXU1HzeZ8OCVNAJCo2gU_QMyI,1198
21
+ winipedia_utils/git/workflows/base/base.py,sha256=kQe4EHr9hcK8z1nMrARGK0Lo6qzE13jnIoHo89bWU2g,7514
22
+ winipedia_utils/git/workflows/health_check.py,sha256=-D2v_tlYyKFzpLMUpjoKFYFnHv1zzZAc3udnIPGjVZo,1349
23
+ winipedia_utils/git/workflows/publish.py,sha256=VSDj2ZQ1BswUxW_AazsVUMlg-xCnbr7iVPY0I79fwik,1319
24
+ winipedia_utils/git/workflows/release.py,sha256=4CKLMQrE3aTpX4IfVUH8mO8vj5a-SDkC28adDUKUMnQ,973
25
25
  winipedia_utils/iterating/__init__.py,sha256=rlF9hzxbowq5yOfcXvOKOQdB-EQmfrislQpf659Zeu4,53
26
26
  winipedia_utils/iterating/iterate.py,sha256=inipzHP1vgmziObqA-iHU7wi11JseZkeMQ9I6_JJ1xM,3364
27
27
  winipedia_utils/logging/__init__.py,sha256=AMt1LwA_E7hexYjMpGzUempoyDdAF-dowWvq59wC5aM,51
@@ -83,7 +83,7 @@ winipedia_utils/testing/tests/conftest.py,sha256=BLgUJtLecOwuEsIyJ__0buqovd5AhiG
83
83
  winipedia_utils/text/__init__.py,sha256=j2bwtK6kyeHI6SnoBjpRju0C1W2n2paXBDlNjNtaUxA,48
84
84
  winipedia_utils/text/config.py,sha256=e6M0AhfzLjLeVqiNTFw_09pMkfhiwVqI9JMRqLykX-w,4661
85
85
  winipedia_utils/text/string.py,sha256=yXmwOab5hXyVQG1NwlWDpy2prj0U7Vb2F5HKLT2Y77Q,3382
86
- winipedia_utils-0.3.40.dist-info/METADATA,sha256=sNcmXx5mkJcujtLtR1fkxW04A8_w91sj0hPL9Cu7wNw,9884
87
- winipedia_utils-0.3.40.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
88
- winipedia_utils-0.3.40.dist-info/licenses/LICENSE,sha256=o316mE2gGzd__JT69p7S_zlOmKiHh8YjpImCCcWyTvM,1066
89
- winipedia_utils-0.3.40.dist-info/RECORD,,
86
+ winipedia_utils-0.3.43.dist-info/METADATA,sha256=14KWpD67uDHvYlocbTo1Zqwa-ZLG7HOZ_YKoZQSz1Zo,9884
87
+ winipedia_utils-0.3.43.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
88
+ winipedia_utils-0.3.43.dist-info/licenses/LICENSE,sha256=o316mE2gGzd__JT69p7S_zlOmKiHh8YjpImCCcWyTvM,1066
89
+ winipedia_utils-0.3.43.dist-info/RECORD,,