Missing python interface file
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- developer-experience
Piste de recherche
Review the documented yara-python API and the proposed .pyi interface, then check how the compiled package is laid out in this repository. Compare the result with mypy stubgen output and verify the stubs support VSCode type hinting and code completion. Done means a correct .pyi file is included in the package with the public functions and classes represented.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
The compiled yara-python is missing a python interface file (.pyi).
Without such an interface definition, support in IDEs is quite limited (no type hinting, no code completion).
I've created a small interface file based on the documentation, which is definitely not 100% correct, but enough to enable code completion and type hinting in VSCode:
from typing import IO, Callable, Dict, List, Tuple, Union
class Match:
rule: str
namespace: str
tags: List[str]
meta: Dict[str, str]
strings: List[Tuple[int, str, str]]
class Rules:
def match(
self,
filepath: str = "",
pid: int = 0,
data: Union[str, bytes] = "",
externals: dict = {},
callback: Callable = lambda x: x,
fast: bool = False,
timeout: int = -1,
modules_data: dict = {},
modules_callback: Callable = lambda x: x,
warnings_callback: Callable = lambda x: x,
which_callbacks: int = 0,
console_callback: Callable = lambda x: x,
) -> List[Match]:
pass
def save(self, filepath: str = "", file: IO = None) -> None:
pass
def compile(
filepath: str = "",
source: str = "",
file: IO = None,
filepaths: dict = {},
sources: dict = {},
externals: dict = {},
includes: bool = True,
error_on_warning: bool = False,
) -> Rules:
pass
def load(filepath: str = "", file: IO = None) -> Rules:
pass
def set_config(
stack_size: int = -1, max_strings_per_rule: int = -1, max_match_data: int = -1
) -> None:
pass
Adding a correct .pyi file to this repo, which can also be autogenerated using mypys stubgen (https://mypy.readthedocs.io/en/stable/stubgen.html), would obviously be the preferred solution.
I already tried autogeneration with stubgen, which did not work that good (function parameters and type hints were missing).
- Langage dominant
- C
- Étoiles
- 755
- Forks
- 190
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de VirusTotal/yara-python
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
VirusTotal/yara-python#263 · 2 commentaires ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 28/100
VirusTotal/yara-python#234 · 2 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
VirusTotal/yara-python#216 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
VirusTotal/yara-python#212 · 11 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
VirusTotal/yara-python#199 · 3 commentaires ·
Toutes les issues de VirusTotal/yara-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
HexaCluster/credcheck#86 ·
-
Wheels for Python 3.15Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
mongodb/winkerberos#175 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
AOMediaCodec/SVT-AV1#3320 ·
-
Add `CPC_TAKE_TILL_CHARS`Ouvertedifficulty: easy
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100