-
Notifications
You must be signed in to change notification settings - Fork 60
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 #137 from zooba/issue-132
Detect when a venv is created from an in-tree build. Fixes #132
- Loading branch information
Showing
4 changed files
with
67 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import functools | ||
|
||
|
||
# from jaraco.functools 3.5 | ||
def pass_none(func): | ||
""" | ||
Wrap func so it's not called if its first param is None | ||
>>> print_text = pass_none(print) | ||
>>> print_text('text') | ||
text | ||
>>> print_text(None) | ||
""" | ||
|
||
@functools.wraps(func) | ||
def wrapper(param, *args, **kwargs): | ||
if param is not None: | ||
return func(param, *args, **kwargs) | ||
|
||
return wrapper |
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ minversion = 3.25 | |
[testenv] | ||
deps = | ||
pytest | ||
jaraco.envs>=2.4 | ||
commands = | ||
pytest {posargs} | ||
setenv = | ||
|