Skip to content

Commit

Permalink
some materials
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Apr 19, 2024
1 parent 6d443f6 commit 3428dd4
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,11 @@ This package is essentially a wrapper for `venv` and `pip`.
When entering the context, a temporary folder is created using the [tempfile](https://docs.python.org/3/library/tempfile.html) library. Then it is added to [sys.path](https://docs.python.org/3/library/sys.html#sys.path), and after exiting the context, it is removed from there. To install the package in this particular temporary folder, the `--target` argument is passed to pip, indicating the path to it. Interaction with `pip` and `venv` occurs through [subprocesses](https://docs.python.org/3/library/subprocess.html).

The `import_here` method works by temporarily substituting [sys.path](https://docs.python.org/3/library/sys.html#sys.path) and [sys.modules](https://docs.python.org/3/library/sys.html#sys.modules). This is necessary so that the search for packages takes place only in the necessary directories.


## Examples

```python
with instld('git+https://github.com/pomponchik/cantok.git'):
import cantok
```
Binary file added docs/assets/presentation_3.pptx
Binary file not shown.
Binary file added docs/assets/presentation_4.pptx
Binary file not shown.
Binary file added docs/assets/presentation_5.pptx
Binary file not shown.
Binary file added docs/assets/terminal_4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/~$presentation_4.pptx
Binary file not shown.
Binary file added docs/assets/~$presentation_5.pptx
Binary file not shown.

0 comments on commit 3428dd4

Please sign in to comment.