-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR resolves a couple bugs encountered during testing: - package and compiler versions can now be made up of any non-space character. previously, the regex matched semvar formatting, but spackages can have versions in other formats - clarified that specs should be URL-encoded in calls to /api/v1/allocate - fixed issue where expensive variants algo was unable to complete due to some packages storing popular variants string values rather than boolean. ex: quantum-espresso hdf5=none
- Loading branch information
Showing
4 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,9 +76,9 @@ async def test_empty_sample(db_conn): | |
# Test validate_payload | ||
def test_valid_spec(): | ||
"""Tests that a valid spec is parsed correctly.""" | ||
assert parse_alloc_spec("[email protected] +json+native+treesitter%[email protected]") == { | ||
assert parse_alloc_spec("[email protected]-test +json+native+treesitter%[email protected]") == { | ||
"pkg_name": "emacs", | ||
"pkg_version": "29.2", | ||
"pkg_version": "29.2-test", | ||
"pkg_variants": '{"json": true, "native": true, "treesitter": true}', | ||
"pkg_variants_dict": {"json": True, "native": True, "treesitter": True}, | ||
"compiler_name": "gcc", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,8 @@ def parse_alloc_spec(spec: str) -> dict: | |
""" | ||
|
||
# example: [email protected] +json+native+treesitter%[email protected] | ||
spec_pattern = re.compile(r"(.+?)@([\d.]+)\s+(.+?)%([\w-]+)@([\d.]+)") | ||
# this regex accommodates versions made up of any non-space characters | ||
spec_pattern = re.compile(r"(.+?)@(\S+)\s+(.+?)%([\w-]+)@(\S+)") | ||
|
||
match = spec_pattern.match(spec) | ||
if not match: | ||
|