Skip to content

Commit 8f2339d

Browse files
committed
-fix native interpreter parsing
- add missing architecture.png in docs - various code cleanups
1 parent dd6ea9f commit 8f2339d

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

aura/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ def update_aura():
222222
@cli.command()
223223
@click.option("-o", "--out", default="-", type=click.File("w"))
224224
@click.option("-m", "--max-distance", default=2, type=click.IntRange(min=0, max=10))
225-
@click.option("-l", "--limit", default=None, type=click.INT)
226-
def find_typosquatting(out, max_distance, limit=None):
225+
@click.option("-l", "--limit", default=100, type=click.INT)
226+
def find_typosquatting(out, max_distance, limit=100):
227227
if limit <= 0:
228228
click.secho("Invalid value for limit", file=sys.stderr)
229229
sys.exit(1)

aura/commands.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ def show_info():
216216

217217
def generate_typosquatting(out, distance=2, limit=None):
218218
f = partial(typos.damerau_levenshtein, max_distance=distance)
219-
pth = config.get_pypi_stats_path()
220-
for num, (x, y) in enumerate(typos.enumerator(typos.generate_popular(pth), f)):
219+
for num, (x, y) in enumerate(typos.enumerator(typos.generate_popular(), f)):
221220
if limit and num >= limit:
222221
break
223222

aura/data/aura_config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,4 @@ interpreters: &interpreters
206206
# All other interpreters are optional, AST parsing will try them in the defined order
207207

208208
native: native
209-
python3: python3
210209
python2: python2

aura/python_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
NATIVE_ENVIRONMENT_CACHE = None
2525

2626

27-
def run_with_interpreters(*, metadata=None, native_callback: Optional[Callable]=None, **kwargs):
27+
def run_with_interpreters(*, metadata=None, **kwargs):
2828
"""
2929
Proxy to execute_interpreter
3030
Iterates over defined interpreter until one that runs the input/script is found

aura/typos.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,13 @@ def diff_distance(s1, s2, cutoff=0.8, cut_return=None):
151151

152152

153153
def generate_popular(
154-
json_path: Path,
154+
json_path: Optional[Path]=None,
155155
full_list: Optional[Iterable[str]]=None,
156156
download_threshold: Optional[int]=None
157157
):
158+
if json_path is None:
159+
json_path = config.get_pypi_stats_path()
160+
158161
if not json_path.exists():
159162
raise ValueError(f"PyPI stats file does not exists: {json_path}")
160163

347 KB
Loading

0 commit comments

Comments
 (0)