-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
004f873
commit 5643aeb
Showing
7 changed files
with
43 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
**/__pycache__ | ||
**/.pyc | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
|
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import operator | ||
import sys | ||
from typing import Callable | ||
import importlib.metadata | ||
from packaging.version import Version | ||
from functools import lru_cache | ||
|
||
|
||
@lru_cache | ||
def lwt_compare_version(package: str, op: Callable, version: str, use_base_version: bool = True, | ||
local_version: str = None) -> bool: | ||
try: | ||
pkg_version = Version(importlib.metadata.version(package)) | ||
except (importlib.metadata.PackageNotFoundError): | ||
return False | ||
except TypeError: | ||
# possibly mocked by Sphinx so needs to return True to generate summaries | ||
return True | ||
if local_version: | ||
if not operator.eq(local_version, pkg_version.local): | ||
return False | ||
if use_base_version: | ||
pkg_version = Version(pkg_version.base_version) | ||
return op(pkg_version, Version(version)) | ||
|
||
|
||
def _prepare_module_ctx(module_path, orig_globals): | ||
_orig_file = orig_globals.pop('__file__') | ||
orig_globals.update(vars(sys.modules.get(module_path))) | ||
orig_globals['__file__'] = _orig_file | ||
return orig_globals |
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
6 changes: 4 additions & 2 deletions
6
...les/stable/patched_numpyarrowextractor.py → ...e/patching/patched_numpyarrowextractor.py
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
4 changes: 2 additions & 2 deletions
4
...ples/stable/patched_triton_jit_fn_init.py → ...le/patching/patched_triton_jit_fn_init.py
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