From a1c2112dd416127999f8d50b630a94c2d6e6dff6 Mon Sep 17 00:00:00 2001 From: Philipp Temminghoff Date: Fri, 18 Oct 2024 04:40:48 +0200 Subject: [PATCH] build: add script metadata --- scripts/create_inv_file.py | 9 +++++++++ scripts/create_screenshots.py | 8 ++++++++ scripts/download_docs.py | 11 +++++++++++ scripts/download_lang_files.py | 8 ++++++++ scripts/module_stats.py | 11 +++++++++-- scripts/parse_pyi.py | 7 +++++++ scripts/print_repr.py | 8 ++++++++ scripts/replace.py | 4 ++++ 8 files changed, 64 insertions(+), 2 deletions(-) diff --git a/scripts/create_inv_file.py b/scripts/create_inv_file.py index 1565d8395..ff049c177 100644 --- a/scripts/create_inv_file.py +++ b/scripts/create_inv_file.py @@ -1,3 +1,12 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "requests", +# "sphinx", +# "pyside6" +# ] +# /// + import codecs import pathlib import re diff --git a/scripts/create_screenshots.py b/scripts/create_screenshots.py index 3423dec20..dc9a85ee1 100644 --- a/scripts/create_screenshots.py +++ b/scripts/create_screenshots.py @@ -1,3 +1,11 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "prettyqt", +# "pyside6" +# ] +# /// + import inspect import pathlib diff --git a/scripts/download_docs.py b/scripts/download_docs.py index 2eb288e57..e8091d4f9 100644 --- a/scripts/download_docs.py +++ b/scripts/download_docs.py @@ -1,3 +1,14 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "prettyqt", +# "pyside6", +# "bs4", +# "requests" +# ] +# /// + + import inspect import logging import pathlib diff --git a/scripts/download_lang_files.py b/scripts/download_lang_files.py index add296cdd..32f1ced31 100644 --- a/scripts/download_lang_files.py +++ b/scripts/download_lang_files.py @@ -1,3 +1,11 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "bs4", +# "requests" +# ] +# /// + import collections import os import pathlib diff --git a/scripts/module_stats.py b/scripts/module_stats.py index bb7a225de..0f701a56d 100644 --- a/scripts/module_stats.py +++ b/scripts/module_stats.py @@ -1,8 +1,15 @@ -from __future__ import annotations +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "prettyqt", +# "pyside6", +# ] +# /// import importlib import pkgutil import types +from typing import Self import PyQt6 import PySide6 @@ -40,7 +47,7 @@ def list_modules(self, force_qt_naming=False): def import_modules(self): return [importlib.import_module(p) for p in self.list_modules()] - def compare_with(self, other: API): + def compare_with(self, other: Self): theirs = dir(other.module) ours = dir(self.module) print(f"Missing modules for {self.module.__name__}") diff --git a/scripts/parse_pyi.py b/scripts/parse_pyi.py index d4b355242..79e64a0c8 100644 --- a/scripts/parse_pyi.py +++ b/scripts/parse_pyi.py @@ -1,3 +1,10 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "typed_ast", +# ] +# /// + import pathlib import sys diff --git a/scripts/print_repr.py b/scripts/print_repr.py index 92695ddff..1d97f0d7a 100644 --- a/scripts/print_repr.py +++ b/scripts/print_repr.py @@ -1,3 +1,11 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "prettyqt", +# "pyside6", +# ] +# /// + import inspect from prettyqt import gui diff --git a/scripts/replace.py b/scripts/replace.py index 6ca0ec533..3aa77eb02 100644 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -1,3 +1,7 @@ +# /// script +# requires-python = ">=3.11" +# /// + import pathlib import re import sys