-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from VCTLabs/src-release
bug fixes and src release
- Loading branch information
Showing
13 changed files
with
211 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
prog_name: repolite | ||
top_dir: ext # local directory path for enabled repositories | ||
pull_with_rebase: false # use --ff-only if false | ||
# add new repo_name sections as needed | ||
repos: | ||
- repo_name: hiredis | ||
repo_alias: null | ||
repo_url: https://github.com/redis/hiredis.git | ||
repo_depth: 0 | ||
repo_remote: origin | ||
repo_opts: [] | ||
repo_branch: v0.14.1 | ||
repo_hash: null | ||
repo_use_rebase: false | ||
repo_has_lfs_files: false | ||
repo_init_submodules: false | ||
repo_install: false | ||
repo_enable: true | ||
- repo_name: json-c | ||
repo_alias: json | ||
repo_url: https://github.com/json-c/json-c.git | ||
repo_depth: 0 | ||
repo_remote: origin | ||
repo_opts: [] | ||
repo_branch: json-c-0.16-20220414 | ||
repo_hash: null | ||
repo_use_rebase: false | ||
repo_has_lfs_files: false | ||
repo_init_submodules: false | ||
repo_install: false | ||
repo_enable: true | ||
- repo_name: redis | ||
repo_alias: null | ||
repo_url: https://github.com/redis/redis.git | ||
repo_depth: 0 | ||
repo_remote: origin | ||
repo_opts: [] | ||
repo_branch: 6.0.16 | ||
repo_hash: null | ||
repo_use_rebase: false | ||
repo_has_lfs_files: false | ||
repo_init_submodules: false | ||
repo_install: false | ||
repo_enable: true |
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
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,3 @@ | ||
# tool requirements, useful for tox/pip/git | ||
#gitchangelog @ https://github.com/sarnold/gitchangelog/releases/download/3.1.2/gitchangelog-3.1.2-py3-none-any.whl | ||
repolite @ https://github.com/sarnold/repolite/releases/download/0.4.0/repolite-0.4.0-py3-none-any.whl |
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,33 @@ | ||
[tox] | ||
skip_missing_interpreters = true | ||
skipsdist = true | ||
|
||
[testenv:{sync,tools,build}] | ||
skip_install = true | ||
install_command = pip install {opts} {packages} | ||
envdir = {toxworkdir}/.env | ||
|
||
passenv = | ||
REPO_CFG | ||
DISPLAY | ||
XAUTHORITY | ||
HOME | ||
USERNAME | ||
USER | ||
CI | ||
LANG | ||
LC_COLLATE | ||
SSH_* | ||
GID | ||
UID | ||
XDG_* | ||
PIP_DOWNLOAD_CACHE | ||
|
||
deps = | ||
pip>=21.3 | ||
cmake | ||
ninja | ||
-r requirements-sync.txt | ||
|
||
commands = | ||
sync: repolite {posargs:--quiet} |
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
""" | ||
https://github.com/masenf/tox-ignore-env-name-mismatch | ||
MIT License | ||
Copyright (c) 2023 Masen Furer | ||
""" | ||
from contextlib import contextmanager | ||
from typing import Any, Iterator, Optional, Sequence, Tuple | ||
|
||
from tox.plugin import impl | ||
from tox.tox_env.api import ToxEnv | ||
from tox.tox_env.info import Info | ||
from tox.tox_env.python.virtual_env.runner import VirtualEnvRunner | ||
from tox.tox_env.register import ToxEnvRegister | ||
|
||
|
||
class FilteredInfo(Info): | ||
"""Subclass of Info that optionally filters specific keys during compare().""" | ||
|
||
def __init__( | ||
self, | ||
*args: Any, | ||
filter_keys: Optional[Sequence[str]] = None, | ||
filter_section: Optional[str] = None, | ||
**kwargs: Any, | ||
): | ||
""" | ||
:param filter_keys: key names to pop from value | ||
:param filter_section: if specified, only pop filter_keys when the compared section matches | ||
All other args and kwargs are passed to super().__init__ | ||
""" | ||
self.filter_keys = filter_keys | ||
self.filter_section = filter_section | ||
super().__init__(*args, **kwargs) | ||
|
||
@contextmanager | ||
def compare( | ||
self, | ||
value: Any, | ||
section: str, | ||
sub_section: Optional[str] = None, | ||
) -> Iterator[Tuple[bool, Optional[Any]]]: | ||
"""Perform comparison and update cached info after filtering `value`.""" | ||
if self.filter_section is None or section == self.filter_section: | ||
try: | ||
value = value.copy() | ||
except AttributeError: # pragma: no cover | ||
pass | ||
else: | ||
for fkey in self.filter_keys or []: | ||
value.pop(fkey, None) | ||
with super().compare(value, section, sub_section) as rv: | ||
yield rv | ||
|
||
|
||
class IgnoreEnvNameMismatchVirtualEnvRunner(VirtualEnvRunner): | ||
"""EnvRunner that does NOT save the env name as part of the cached info.""" | ||
|
||
@staticmethod | ||
def id() -> str: | ||
return "ignore_env_name_mismatch" | ||
|
||
@property | ||
def cache(self) -> Info: | ||
"""Return a modified Info class that does NOT pass "name" key to `Info.compare`.""" | ||
return FilteredInfo( | ||
self.env_dir, | ||
filter_keys=["name"], | ||
filter_section=ToxEnv.__name__, | ||
) | ||
|
||
|
||
@impl | ||
def tox_register_tox_env(register: ToxEnvRegister) -> None: | ||
"""tox4 entry point: add IgnoreEnvNameMismatchVirtualEnvRunner to registry.""" | ||
register.add_run_env(IgnoreEnvNameMismatchVirtualEnvRunner) |