-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(check-project): install deps in temp folder, run mypy with top namespace * docs: add check-project specific info * bump version to 1.1.1
- Loading branch information
1 parent
980f2c5
commit ae188bc
Showing
8 changed files
with
75 additions
and
12 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
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 @@ | ||
from poetry_multiproject_plugin.components.deps.installer import install_deps | ||
|
||
__all__ = ["install_deps"] |
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 os | ||
import subprocess | ||
from pathlib import Path | ||
|
||
|
||
def run_install_command(): | ||
subprocess.run(["poetry", "install", "--only", "main", "--quiet"]) | ||
|
||
|
||
def navigate_to(path: Path): | ||
os.chdir(str(path)) | ||
|
||
|
||
def install_deps(destination: Path): | ||
current_dir = Path.cwd() | ||
|
||
navigate_to(destination) | ||
run_install_command() | ||
|
||
navigate_to(current_dir) |
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,6 +1,11 @@ | ||
import shutil | ||
import os | ||
from pathlib import Path | ||
|
||
|
||
def remove_project(project_path: Path): | ||
shutil.rmtree(project_path) | ||
|
||
|
||
def remove_file(project_path: Path, file_name: str): | ||
os.remove(project_path / file_name) |
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,12 +1,22 @@ | ||
from pathlib import Path | ||
from typing import List | ||
|
||
from tomlkit.toml_document import TOMLDocument | ||
from tomlkit.toml_file import TOMLFile | ||
|
||
from poetry_multiproject_plugin.components.toml.packages import join_package_paths | ||
|
||
|
||
def toml(path: Path) -> TOMLDocument: | ||
p = path.as_posix() | ||
|
||
toml_file = TOMLFile(p) | ||
|
||
return toml_file.read() | ||
|
||
|
||
def package_paths(path: Path) -> List[Path]: | ||
data: dict = toml(path) | ||
packages = data["tool"]["poetry"]["packages"] | ||
|
||
return [join_package_paths(p) for p in packages] |
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