Skip to content

Commit

Permalink
Fix missing checkout steps on CI (#459)
Browse files Browse the repository at this point in the history
Before these changes, black and isort did nothing
on CI due to lack of the source code to analyze.

These changes also apply black/isort to the code.
  • Loading branch information
Jamim authored Nov 16, 2023
1 parent 7bf8671 commit 995f8d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ jobs:
black:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
isort:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: isort/isort-action@v1.1.0
12 changes: 5 additions & 7 deletions argcomplete/_check_console_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
"""
import os
import sys

from importlib.metadata import entry_points as importlib_entry_points
from importlib.metadata import EntryPoint
from importlib.metadata import entry_points as importlib_entry_points
from typing import Iterable

from ._check_module import ArgcompleteMarkerNotFound, find
from typing import Iterable


def main():
Expand All @@ -29,15 +28,14 @@ def main():
# assuming it is actually a console script.
name = os.path.basename(script_path)

entry_points : Iterable[EntryPoint] = importlib_entry_points() # type:ignore
entry_points: Iterable[EntryPoint] = importlib_entry_points() # type:ignore

# Python 3.12+ returns a tuple of entry point objects
# whereas <=3.11 returns a SelectableGroups object
if sys.version_info < (3, 12):
entry_points = entry_points["console_scripts"] # type:ignore
entry_points = entry_points["console_scripts"] # type:ignore

entry_points = [ep for ep in entry_points \
if ep.name == name and ep.group == "console_scripts" ] # type:ignore
entry_points = [ep for ep in entry_points if ep.name == name and ep.group == "console_scripts"] # type:ignore

if not entry_points:
raise ArgcompleteMarkerNotFound("no entry point found matching script")
Expand Down

0 comments on commit 995f8d9

Please sign in to comment.