Skip to content

Commit

Permalink
changes based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asewnath committed Jun 27, 2024
1 parent c4f3cd7 commit a99041d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_with_pinned_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:

Expand Down
8 changes: 2 additions & 6 deletions src/jedi_bundle/utils/file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,9 @@ def check_for_executable(logger, executable):
# --------------------------------------------------------------------------------------------------


def subprocess_run(logger, command, abort_on_fail=True, cwd=None):
def subprocess_run(logger, command, abort_on_fail=True, **kwargs):

# Prepare command
if cwd:
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
else:
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)

# Run process
output, error = p.communicate()
Expand Down
22 changes: 9 additions & 13 deletions src/jedi_bundle/utils/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import requests
import subprocess

from jedi_bundle.utils.logger import Logger
from jedi_bundle.utils.config import config_get
from jedi_bundle.utils.file_system import devnull, subprocess_run

Expand Down Expand Up @@ -77,22 +78,17 @@ def repo_has_branch(logger, url, branch, is_tag=False, is_commit=False):
logger.info(f'Cannot find commit at {commit_url}')
return r.ok

else:
# Command to check if branch exists and pass exit code back
heads_or_tags = '--heads'
if is_tag:
heads_or_tags = '--tags'
# Command to check if branch exists and pass exit code back
heads_or_tags = '--heads'
if is_tag:
heads_or_tags = '--tags'

git_ls_cmd = ['git', 'ls-remote', heads_or_tags, '--exit-code', url, branch]
git_ls_cmd = ['git', 'ls-remote', heads_or_tags, '--exit-code', url, branch]

# Run command
process = subprocess.run(git_ls_cmd, stdout=devnull)
# Run command
process = subprocess.run(git_ls_cmd, stdout=devnull)

# Return flag based on exit code.
if process.returncode == 0:
return True
else:
return False
return process.returncode == 0


# --------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit a99041d

Please sign in to comment.