From 11c19cc785af40bc7454ce6938c07c072383e245 Mon Sep 17 00:00:00 2001 From: Janek Lasocki-Biczysko Date: Sat, 3 Aug 2024 19:41:04 +0100 Subject: [PATCH] update all dependencies, target python 12, drop support for previous versions of python --- .github/workflows/lint-and-test.yml | 6 +++--- .gitignore | 4 ++++ ghsearch/client.py | 2 +- ghsearch/main.py | 13 ++++++++----- setup.py | 29 +++++++++++++---------------- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 05d79df..bedf71c 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -2,9 +2,9 @@ name: Lint and Test on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: build: @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10" ] + python-version: ["3.12"] steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 605249d..da6fbfc 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,7 @@ venv .coverage /htmlcov /build + +.envrc +.direnv + diff --git a/ghsearch/client.py b/ghsearch/client.py index 73629c2..72a5141 100644 --- a/ghsearch/client.py +++ b/ghsearch/client.py @@ -5,7 +5,7 @@ RESULTS_PER_PAGE = 100 # this is the max - see https://docs.github.com/en/rest/reference/search#search-code--parameters -def build_client(token: str, base_url: str = None) -> Github: +def build_client(token: str, base_url: str | None = None) -> Github: client_params: Dict[str, Any] = {"per_page": RESULTS_PER_PAGE, "login_or_token": token} if base_url: client_params["base_url"] = base_url diff --git a/ghsearch/main.py b/ghsearch/main.py index a67e5a2..d37da09 100644 --- a/ghsearch/main.py +++ b/ghsearch/main.py @@ -11,7 +11,10 @@ def _build_filters( - path_filter: str = None, include_archived: bool = True, content_filter: str = None, regex_content_filter: str = None + path_filter: str | None = None, + include_archived: bool = True, + content_filter: str | None = None, + regex_content_filter: str | None = None, ) -> List[Filter]: filters: List[Filter] = [] if path_filter: @@ -29,10 +32,10 @@ def run( query: List[str], github_token: str, printer: Printer, - github_api_url: str = None, - path_filter: str = None, - content_filter: str = None, - regex_content_filter: str = None, + github_api_url: str | None = None, + path_filter: str | None = None, + content_filter: str | None = None, + regex_content_filter: str | None = None, include_archived: bool = False, verbose: bool = False, ) -> None: diff --git a/setup.py b/setup.py index c4eee09..d0e92cc 100644 --- a/setup.py +++ b/setup.py @@ -16,21 +16,21 @@ def get_readme(): install_requires = [ - "click~=8.0.3", + "click~=8.1.7", "click-config-file~=0.6.0", - "PyGithub~=1.54.1", - "ruamel.yaml~=0.17.16", + "PyGithub~=2.3.0", + "ruamel.yaml~=0.18.6", ] dev_requires = [ - "black~=22.1.0", - "coverage~=6.3.1", - "flake8~=3.7.7", - "isort~=5.10.1", - "mypy~=0.931", - "pip-tools~=5.3.1", - "pytest-mock~=3.7.0", - "pytest~=6.2.5", + "black~=24.8.0", + "coverage~=7.6.0", + "flake8~=7.1.0", + "isort~=5.13.2", + "mypy~=1.11.1", + "pip-tools~=7.4.1", + "pytest-mock~=3.14.0", + "pytest~=8.3.2", ] @@ -44,15 +44,12 @@ def get_readme(): long_description_content_type="text/markdown", packages=find_packages(exclude="tests"), classifiers=[ - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.12", ], install_requires=install_requires, setup_requires=["pytest-runner"], tests_require=dev_requires, - python_requires=">=3.7", + python_requires=">=3.12", extras_require={ "dev": dev_requires, },