Skip to content

Commit

Permalink
Merge branch 'airspeed-velocity:main' into hmaarrfk-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk authored Jul 2, 2024
2 parents c335ab9 + 6f7f546 commit 7cd9aa6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,19 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest"]
r-version: ['release']
fail-fast: false
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up R version ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}

- uses: mamba-org/setup-micromamba@v1
with:
init-shell: >-
Expand Down
2 changes: 1 addition & 1 deletion asv/plugins/conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _setup(self):
self._run_conda(['env', 'create', '-f', env_file_name,
'-p', self._path, "--yes"],
env=env)
else: # Backward compatbility
else: # Backward compatibility
self._run_conda(['env', 'create', '-f', env_file_name,
'-p', self._path, '--force'],
env=env)
Expand Down
8 changes: 6 additions & 2 deletions asv/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,15 +1328,19 @@ def _parse_declaration(self, declaration):
# Match git URLs
git_url_pattern = (
r'(git\+https:\/\/[a-zA-Z0-9-_\/.]+)' # match the git URL
r'(?:@([a-zA-Z0-9-_\/.]+))?' # optional branch or tag
r'(?:#egg=([a-zA-Z0-9-_]+))?' # optional egg fragment
)
git_url_match = re.search(git_url_pattern, declaration)

# If there's a git URL match, remove it from the declaration
if git_url_match:
self.path = git_url_match.group(1)
if git_url_match.group(2):
self.pkgname = git_url_match.group(2)
branch_or_tag = git_url_match.group(2)
if branch_or_tag:
self.path += f"@{branch_or_tag}"
if git_url_match.group(3):
self.pkgname = git_url_match.group(3)
declaration = declaration.replace(git_url_match.group(0), '', 1)

# Match local paths
Expand Down
23 changes: 21 additions & 2 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,26 @@ def mock_pip_caller(args):
'pkgname': None, 'specification': None,
'flags': [], 'is_editable': False, 'path': 'git+https://github.com/user/repo.git'
}),
# Git installations with a branch specified
("git+https://github.com/user/repo.git@branch", {
'pkgname': None, 'specification': None,
'flags': [], 'is_editable': False, 'path': 'git+https://github.com/user/repo.git@branch'
}),
# Editable git installations with #egg= suffix
("-e git+https://github.com/user/repo.git#egg=repo", {
'pkgname': 'repo', 'specification': None,
("-e git+https://github.com/user/repo.git#egg=pkgname", {
'pkgname': 'pkgname', 'specification': None,
'flags': ['-e'], 'is_editable': True, 'path': 'git+https://github.com/user/repo.git'
}),
# Git installations with a branch and egg specified
("git+https://github.com/user/pythonrepo.git@branch#egg=repo", {
'pkgname': 'repo', 'specification': None,
'flags': [], 'is_editable': False,
'path': 'git+https://github.com/user/pythonrepo.git@branch'
}),
# Flags with values
("--install-option=\"--prefix=/my/path\" numpy", {
'pkgname': 'numpy', 'specification': None,
Expand Down Expand Up @@ -513,6 +528,10 @@ def pip_caller(args):
("git+https://github.com/numpy/numpy.git#egg=numpy",
["install", "-v", "--upgrade", "git+https://github.com/numpy/numpy.git"]),
# Test with a git URL and branch
("git+https://github.com/numpy/numpy.git@branch",
["install", "-v", "--upgrade", "git+https://github.com/numpy/numpy.git@branch"]),
# Test with a local path
("./localpackage/", ["install", "-v", "--upgrade", "./localpackage/"]),
Expand Down

0 comments on commit 7cd9aa6

Please sign in to comment.