-
-
Notifications
You must be signed in to change notification settings - Fork 156
Fix issue #37 : Create my_path.pth only for local mypy test, remove afterwards #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
2ca61ab
1315ebb
a37d136
ccf6157
a10dfe0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,22 @@ | ||
| import shutil | ||
| import subprocess | ||
| from pathlib import Path | ||
| import sys | ||
|
|
||
| from scripts._job import Step, run_job | ||
|
|
||
| def create_mypy_pkg_file(): | ||
| pkg_path = [path for path in sys.path if path.endswith('site-packages')] | ||
|
||
|
|
||
| if not Path(fr'{pkg_path[0]}/my_path.pth').exists(): | ||
| with open(fr'{pkg_path[0]}/my_path.pth', 'w') as file: | ||
| file.write(str(Path.cwd())) | ||
|
|
||
|
|
||
| def destroy_mypy_pkg_file(): | ||
| pkg_path = [path for path in sys.path if path.endswith('site-packages')] | ||
|
|
||
| if Path(fr'{pkg_path[0]}/my_path.pth').exists(): | ||
| Path(fr'{pkg_path[0]}/my_path.pth').unlink() | ||
|
|
||
|
|
||
| def run_mypy_src(): | ||
|
|
@@ -44,6 +58,7 @@ def run_pyright_dist(): | |
| cmd = ["pyright", "tests"] | ||
| subprocess.run(cmd, check=True) | ||
|
|
||
|
|
||
| def uninstall_dist(): | ||
| cmd = ["pip", "uninstall", "-y", "pandas-stubs"] | ||
| subprocess.run(cmd, check=True) | ||
|
|
@@ -74,3 +89,6 @@ def create_new_venv(): | |
| cmd = ["poetry", "shell"] | ||
| subprocess.run(cmd, check=True) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| restore_last_changes() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you need a rollback here?