Skip to content

Commit

Permalink
Drop the example based on using pip's internals (#519)
Browse files Browse the repository at this point in the history
pip's documentation explicitly states to not use `import pip`:

> While it is implemented in Python, and so is available from your Python code via
> `import pip`, you must not use pip’s internal APIs in this way.

This example is in direct contradiction with the documentation's guidance and, thus, has
been removed.
  • Loading branch information
Pradyun Gedam authored and GitHub committed Mar 29, 2021
1 parent 4134e6d commit 4498c5b
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,23 +389,6 @@ jobs:
${{ runner.os }}-pip-
```

### Using a script to get cache location

> Note: This uses an internal pip API and may not always work
```yaml
- name: Get pip cache dir
id: pip-cache
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
```

## Python - pipenv

```yaml
Expand Down

0 comments on commit 4498c5b

Please sign in to comment.