Skip to content

Commit

Permalink
Use --index-url in PyPi description (#22620) (#22636)
Browse files Browse the repository at this point in the history
  • Loading branch information
yardenshoham authored Jan 28, 2023
1 parent f204ff4 commit 9f5e44b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/content/doc/packages/pypi.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ For example:
pip install --index-url https://testuser:password123@gitea.example.com/api/packages/testuser/pypi/simple --no-deps test_package
```

You can use `--extra-index-url` instead of `--index-url` but that makes you vulnerable to dependency confusion attacks because `pip` checks the official PyPi repository for the package before it checks the specified custom repository. Read the `pip` docs for more information.

## Supported commands

```
Expand Down
2 changes: 1 addition & 1 deletion templates/package/content/pypi.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.pypi.install"}}</label>
<div class="markup"><pre class="code-block"><code>pip install --extra-index-url {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/pypi/simple {{.PackageDescriptor.Package.Name}}</code></pre></div>
<div class="markup"><pre class="code-block"><code>pip install --index-url {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/pypi/simple {{.PackageDescriptor.Package.Name}}</code></pre></div>
</div>
<div class="field">
<label>{{.locale.Tr "packages.pypi.documentation" | Safe}}</label>
Expand Down

0 comments on commit 9f5e44b

Please sign in to comment.