Skip to content

Commit e9d04de

Browse files
author
Beyang Liu
committed
update README to be consistent with lang-go and lang-typescript, mention auth proxies
1 parent c326a44 commit e9d04de

1 file changed

Lines changed: 33 additions & 33 deletions

File tree

‎README.md‎

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
# Python (beta)
1+
# Code intelligence for Python (beta)
22

33
![](https://user-images.githubusercontent.com/1387653/51012886-6a645400-1514-11e9-8958-8ebe3e40aff9.png)
44

5-
This extension adds Python code intelligence to Sourcegraph using a [Python language server](https://github.com/Microsoft/python-language-server) (the [@sourcegraph fork](https://github.com/sourcegraph/python-language-server/tree/wip2)).
5+
This extension provides Python code intelligence on Sourcegraph. Ensure this extension is enabled and then try it on some examples:
66

7-
[**🗃️ Source code**](https://github.com/sourcegraph/lang-python)
8-
9-
[**➕ View in extension registry**](https://sourcegraph.com/extensions/sourcegraph/python)
10-
11-
## Features
7+
- Tensorflow: [tensorflow_ranking/examples/tf_ranking_libsvm.py](https://sourcegraph.com/github.com/tensorflow/ranking@931e4e18d68612d0b29dc3c81994acdd4b6ab743/-/blob/tensorflow_ranking/examples/tf_ranking_libsvm.py#L294:27&tab=references)
8+
- Flask: [flask/views.py](https://sourcegraph.com/github.com/pallets/flask/-/blob/flask/views.py)
9+
- Zulip: [corporate/lib/stripe.py](https://sourcegraph.com/github.com/zulip/zulip/-/blob/corporate/lib/stripe.py)
10+
- Trivial sample: [pkg0/m0.py](http://sourcegraph.com/github.com/sgtest/python-sample-0/-/blob/pkg0/m0.py)
1211

13-
For Python code viewed on [Sourcegraph](https://sourcegraph.com) and when using the [Sourcegraph browser extension](https://docs.sourcegraph.com/integration/browser_extension):
12+
![Screenshot](https://user-images.githubusercontent.com/1976/49628952-d4c92800-f99b-11e8-9605-d880b733cde6.png)
1413

15-
- Hovers with documentation and inferred type signatures
16-
- Go to definition
17-
- Find references
14+
## Usage with private Sourcegraph instances
1815

19-
## Usage on your own Sourcegraph instance
16+
This extension is configured to talk to a language server over WebSockets. If you are running a
17+
private Sourcegraph instance, you should run your own language server. The server is available as a
18+
Docker image `sourcegraph/lang-python` from Docker Hub.
2019

21-
Run the language server Docker container:
20+
### Using Docker
2221

23-
```
24-
docker run --rm -p 4288:4288 sourcegraph/lang-python:insiders
25-
```
22+
1. Run the Python language server Docker container:
2623

27-
Add these to your Sourcegraph settings:
24+
```sh
25+
docker run --rm -p 4288:4288 sourcegraph/lang-python:insiders
26+
```
2827

29-
```
30-
"python.languageServer.url": "ws://localhost:4288",
31-
"python.sourcegraph.url": "http://host.docker.internal:7080",
32-
```
28+
1. Enable this extension on your Sourcegraph https://sourcegraph.example.com/extensions/sourcegraph/lang-python
3329

34-
If you're running on Linux, change `python.sourcegraph.url` to the IP given by:
3530

36-
```bash
37-
ip addr show docker0 | grep -Po 'inet \K[\d.]+'
38-
```
31+
1. Add these to your Sourcegraph settings:
3932

40-
## Usage on Sourcegraph.com
33+
```json
34+
"python.languageServer.url": "ws://localhost:4288",
35+
"python.sourcegraph.url": "http://host.docker.internal:7080",
36+
```
4137

42-
This extension is enabled for all users by default on Sourcegraph.com and when using the [Sourcegraph browser extension](https://docs.sourcegraph.com/integration/browser_extension) on public code.
38+
If you're running on Linux, change `python.sourcegraph.url` to the IP given by:
4339
44-
To use it, just visit a Python file and hover over tokens. Examples:
40+
```bash
41+
ip addr show docker0 | grep -Po 'inet \K[\d.]+'
42+
```
4543
46-
- Tensorflow: [tensorflow_ranking/examples/tf_ranking_libsvm.py](https://sourcegraph.com/github.com/tensorflow/ranking@931e4e18d68612d0b29dc3c81994acdd4b6ab743/-/blob/tensorflow_ranking/examples/tf_ranking_libsvm.py#L294:27&tab=references)
47-
- Flask: [flask/views.py](https://sourcegraph.com/github.com/pallets/flask/-/blob/flask/views.py)
48-
- Zulip: [corporate/lib/stripe.py](https://sourcegraph.com/github.com/zulip/zulip/-/blob/corporate/lib/stripe.py)
49-
- Trivial sample: [pkg0/m0.py](http://sourcegraph.com/github.com/sgtest/python-sample-0/-/blob/pkg0/m0.py)
44+
### Authentication proxies and firewalls
5045
51-
![Screenshot](https://user-images.githubusercontent.com/1976/49628952-d4c92800-f99b-11e8-9605-d880b733cde6.png)
46+
Some customers deploy Sourcegraph behind an authentication proxy or firewall. If you do this, we
47+
recommend deploying the language server behind the proxy so that it can issue requests directly to
48+
Sourcegraph without going through the proxy. (Otherwise, you will need to configure the language
49+
server to authenticate through your proxy.) Make sure you set `python.sourcegraphUrl` to the URL
50+
that the language server should use to reach Sourcegraph, which is likely different from the URL
51+
that end users use.
5252
5353
## Known issues
5454

0 commit comments

Comments
 (0)