-
Notifications
You must be signed in to change notification settings - Fork 2
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 #2 from orsinium-labs/better-site-discovery
Better site discovery
- Loading branch information
Showing
9 changed files
with
71 additions
and
18 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 |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
.pytest_cache/ | ||
__pycache__/ | ||
dist/ | ||
/.venv/ | ||
/.hypothesis/ |
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,2 @@ | ||
[flake8] | ||
max-line-length = 90 |
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,29 @@ | ||
|
||
|
||
from io import StringIO | ||
from pathlib import Path | ||
import subprocess | ||
import sys | ||
from typeforce._cli import main | ||
|
||
|
||
def test_smoke(tmp_path: Path): | ||
# create venv | ||
venv_path = tmp_path / '.venv' | ||
cmd = [sys.executable, '-m', 'venv', str(venv_path)] | ||
subprocess.run(cmd, check=True) | ||
|
||
# install deps | ||
exe_path = venv_path / 'bin' / 'python' | ||
cmd = [str(exe_path), '-m', 'pip', 'install', 'astroid'] | ||
subprocess.run(cmd, check=True) | ||
|
||
# run typeforce | ||
stdout = StringIO() | ||
code = main(['--exe', str(exe_path)], stdout) | ||
assert code == 0 | ||
|
||
stdout.seek(0) | ||
output = stdout.read() | ||
assert 'astroid' in output | ||
assert 'patched' in output |
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,4 +1,4 @@ | ||
"""CLI tool to propagate py.typed into third-party libraries. | ||
""" | ||
|
||
__version__ = '0.2.0' | ||
__version__ = '0.2.1' |
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,9 @@ | ||
import sys | ||
import MODULE_NAME as module # type: ignore[import] | ||
|
||
for name in dir(module): | ||
obj = getattr(module, name) | ||
ann = getattr(obj, '__annotations__', None) | ||
if ann: | ||
sys.exit(21) | ||
sys.exit(22) |
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,4 @@ | ||
import site | ||
|
||
sites = site.getsitepackages() + [site.getusersitepackages()] | ||
print('\n'.join(sites)) |