diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ec3e80e..e1b5724 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.10' - name: Install dependencies run: | diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index e266ad5..754c0b8 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '^3.8' + python-version: '^3.10' - name: Install solidation run: python -m pip install . diff --git a/.github/workflows/typing.yml b/.github/workflows/typing.yml index 82a2448..837ccfd 100644 --- a/.github/workflows/typing.yml +++ b/.github/workflows/typing.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.10' - name: Install dependencies run: | diff --git a/setup.cfg b/setup.cfg index 3e0541c..ea6a30f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,8 +16,6 @@ keywords = classifiers = Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: Implementation :: CPython @@ -35,7 +33,7 @@ packages = find_namespace: package_dir = =src include_package_data = True -python_requires = >= 3.8 +python_requires = >= 3.10 install_requires = click >= 8.0 click-loglevel ~= 0.2 diff --git a/src/solidation/__main__.py b/src/solidation/__main__.py index acde5e0..034cef2 100644 --- a/src/solidation/__main__.py +++ b/src/solidation/__main__.py @@ -7,8 +7,9 @@ import os from pathlib import Path from random import sample +from re import Pattern from statistics import quantiles -from typing import TYPE_CHECKING, Any, List, Pattern, Set, Union +from typing import TYPE_CHECKING, Any from urllib.parse import quote import click from click_loglevel import LogLevel @@ -37,7 +38,7 @@ class RepoSpec(BaseModel): class OrgSpec(BaseModel): name: GHUser - fetch_members: Union[StrictBool, Pattern] = False + fetch_members: StrictBool | Pattern = False member_activity_only: bool = False def member_fetched(self, user: str) -> bool: @@ -50,9 +51,9 @@ def member_fetched(self, user: str) -> bool: class Configuration(BaseModel): project: str = "Project" recent_days: int = Field(default=7, ge=1) - organizations: List[Union[GHUser, OrgSpec]] = Field(default_factory=list) - repositories: List[Union[GHRepo, RepoSpec]] = Field(default_factory=list) - members: Set[GHUser] = Field(default_factory=set) + organizations: list[GHUser | OrgSpec] = Field(default_factory=list) + repositories: list[GHRepo | RepoSpec] = Field(default_factory=list) + members: set[GHUser] = Field(default_factory=set) num_oldest_prs: int = Field(default=10, ge=1) max_random_issues: int = Field(default=5, ge=1)