You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Installing a Phoenix Build](#installing-a-phoenix-build)
10
10
-[Installing a `git` Branch on Colab](#installing-a-git-branch-on-colab)
11
-
-[Setting Up Your Windows Test Environment](#setting-up-your-windows-test-environment)
12
-
-[Selecting a Virtualization Option](#selecting-a-virtualization-option)
13
-
-[Installing Python and Phoenix](#installing-python-and-phoenix)
14
-
-[Configuring a Remote Interpreter](#configuring-a-remote-interpreter)
15
-
-[Troubleshooting](#troubleshooting)
16
11
-[Publishing a New Release](#publishing-a-new-release)
17
12
-[Best Practices](#best-practices)
18
13
-[REST API](#rest-api)
@@ -25,20 +20,32 @@
25
20
26
21
## Setting Up Your macOS Development Environment
27
22
28
-
We recommend using a virtual environment to isolate your Python dependencies. This guide will use `conda`, but you can use a different virtual environment management tool if you want.
23
+
We recommend using a virtual environment to isolate your Python dependencies. This guide will use `uv`, but you can use a different virtual environment management tool such as `conda` if you want.
29
24
30
-
First, ensure that your virtual environment manager is installed. For macOS users, we recommend installing `conda` via `brew` with
25
+
First, ensure that your virtual environment manager is installed. For macOS users, we recommend installing `uv` via `brew` with
31
26
32
27
```
33
-
brew install --cask mambaforge
28
+
brew install uv
34
29
```
35
30
36
-
For non-mac users, you can follow the instruction [here](https://github.com/conda-forge/miniforge#miniforge) to install `conda` for your particular operating system.
31
+
For non-mac users, you can follow the instruction [here](https://docs.astral.sh/uv/getting-started/installation/) to install `uv` for your particular operating system.
37
32
38
-
Create a new virtual environment with a Phoenix-compatible Python version. For example,
33
+
Create a new virtual environment. In general, we recommend developing on the lowest Python version compatible with Phoenix (currently 3.9) to make it easier to write code that is compatible across all supported versions.
39
34
40
35
```bash
41
-
conda create --name phoenix python=3.12
36
+
uv venv --python 3.9
37
+
```
38
+
39
+
Activate your virtual environment before continuing.
40
+
41
+
```bash
42
+
source ./.venv/bin/activate
43
+
```
44
+
45
+
From the root of the reposistory, install the `arize-phoenix` package in editable mode (using the `-e` flag) with development dependencies (using the `dev` extra) by running
46
+
47
+
```bash
48
+
uv pip install -e ".[dev]"
42
49
```
43
50
44
51
Second, install the web build dependencies.
@@ -65,30 +72,6 @@ pnpm install
65
72
pnpm run build
66
73
```
67
74
68
-
Finally, change directory back to repository root and install `phoenix` in
69
-
development mode (using the `-e` flag), and with development dependencies
70
-
(using the `[dev,test]` extra) by running
71
-
72
-
```bash
73
-
pip install -e ".[dev,test]"
74
-
```
75
-
76
-
If you are working on our LLM orchestration framework integrations, you may also wish to install LlamaIndex or LangChain from source. To install LlamaIndex from source,
77
-
78
-
- Uninstall any pre-existing version of LlamaIndex with `pip uninstall llama-index`.
79
-
- Fork and clone LlamaIndex using one of the following two methods:
80
-
- If you are an Arize employee, clone [Arize's fork of LlamaIndex](https://github.com/Arize-ai/llama_index).
81
-
- If you are an external contributor, fork and clone [LlamaIndex's upstream repository](https://github.com/run-llama/llama_index).
82
-
- Run `pip install -e .` from the repository root.
83
-
84
-
To install LangChain from source,
85
-
86
-
- Uninstall any pre-existing version of LangChain with `pip uninstall langchain`.
87
-
- Fork and clone LangChain using one of the following two methods:
88
-
- If you are an Arize employee, clone [Arize's fork of LangChain](https://github.com/Arize-ai/langchain).
89
-
- If you are an external contributor, fork and clone [LangChain's upstream repository](https://github.com/langchain-ai/langchain).
90
-
- Run `pip install -e .` from `libs/langchain`.
91
-
92
75
## Testing and Linting
93
76
94
77
Phoenix is backed with either a `sqlite` or `postgresql` database. By default, tests that involve
@@ -108,47 +91,34 @@ pg_config --bindir
108
91
This command should point to the `homebrew` install of `postgresql`, if it doesn't, try creating
109
92
a fresh Python environment or modifying your `PATH`.
110
93
111
-
Phoenix uses `hatch` as the project management tool to lint and test source code and to build the package. After creating and activating your `phoenix` virtual environment, view your `hatch` environments, dependencies and, scripts defined in `pyproject.toml` with
94
+
Phoenix uses `tox`to run linters, formatters, type-checks, tests, and more. In particular, we recommend using `tox-uv`, which uses `uv` under the hood for package management and is significantly faster than vanilla `tox`.
112
95
113
-
```bash
114
-
hatch env show
115
-
```
116
-
117
-
Scripts belonging to the various environments can be run with
118
-
119
-
```bash
120
-
hatch run <env-name>:<script-name>
121
-
```
122
-
123
-
To type-check your code, run
96
+
You can install `tox-uv` globally with
124
97
125
98
```bash
126
-
hatch run type:check
99
+
uv tool install tox --with tox-uv
127
100
```
128
101
129
-
To format your code, run
102
+
`tox` manages isolated virtual environments, each with a corresponding set of commands. These environments are defined inside of `tox.ini` and can be enumerated by running
130
103
131
104
```bash
132
-
hatch run style:fix
105
+
tox list
133
106
```
134
107
135
-
To run tests
108
+
Commands corresponding to an environment can be executed by running `tox run -e <env-name>`. For example, you can execute unit tests by running
136
109
137
110
```bash
138
-
hatch run tests
111
+
tox run -e unit_tests
139
112
```
140
113
141
114
By default, database tests only run against `sqlite`, in order to run database tests against
142
115
a `postgresql` database as well, use the `--run-postgres` flag
143
116
144
117
```bash
145
-
hatch run tests --run-postgres
118
+
tox run -e unit_tests -- --run-postgres
146
119
```
147
120
148
-
The following resources are helpful to learn more about the capabilities of `hatch` and to familiarize yourself with the CLI.
It is occasionally necessary to manually test a Phoenix build or to run Phoenix from source on Windows. The following instructions enable macOS developers who do not have a PC to quickly set up a Windows Python environment in a cloud or local virtual machine.
235
-
236
-
### Selecting a Virtualization Option
237
-
238
-
We recommend to use a virtual machine either with Microsoft Azure (a cloud virtual machine) or using the Parallels Desktop app (a local virtual machine). Which option you select will depend on your hardware and whether you wish to run a remote IDE. The following resources are helpful to make a decision:
239
-
240
-
-[Parallels Desktop for Mac System Requirements](https://kb.parallels.com/en/124223)
241
-
-[Supported SSH Clients for Remote Development with VSCode](https://code.visualstudio.com/docs/remote/troubleshooting#_installing-a-supported-ssh-client)
242
-
243
-
At the time of this writing in December 2022,
244
-
245
-
- Windows 11 is the only Windows OS with a supported ARM version,
246
-
- JetBrains does not support remote development on Windows servers,
247
-
- VSCode supports remote development on certain Windows versions not including Windows 11.
248
-
249
-
Hence, if you are a macOS developer using an Apple Silicon machine and you wish to use a remote interpreter, running a Windows VM locally is not straightforward and we recommend you use a Windows VM on Azure.
250
-
251
-
If you elect to use an Azure VM, we recommend that you select a non-headless OS (we use Windows Server 2019), configure an inbound port rule for RDP on port 3389 while creating the VM and screenshare with your VM using Microsoft Remote Desktop, which can be downloaded from the Apple App Store. This will enable you to [configure an SSH server](#configuring-a-remote-interpreter) on the VM for remote development.
252
-
253
-
### Installing Python and Phoenix
254
-
255
-
The following instructions assume you have created a Windows virtual machine either locally or in the cloud. These instructions have been tested on Windows Server 2019 and assume you are using Powershell.
256
-
257
-
Install `chocolatey`, a package manager for Windows, by following the instructions [here](https://chocolatey.org/install#individual).
258
-
259
-
Open a new shell and run
260
-
261
-
```powershell
262
-
choco install nvm pyenv-win git
263
-
```
264
-
265
-
Open a new shell and install the latest long-term supported version of `node` using
266
-
267
-
```powershell
268
-
nvm install lts
269
-
```
270
-
271
-
Activate this version using
272
-
273
-
```powershell
274
-
nvm use lts
275
-
```
276
-
277
-
Open a new shell and confirm that `node` and `npm` are available with
Create a virtual environment called `phoenix` with
304
-
305
-
```powershell
306
-
mkvirtualenv phoenix-env
307
-
```
308
-
309
-
Activate your virtual environment. You can now [install a Phoenix build](#installing-a-phoenix-build). Alternatively, if you wish to run Phoenix from source, clone the repo and install Phoenix in development mode with
310
-
311
-
```powershell
312
-
pip install -e ".[dev]"
313
-
```
314
-
315
-
### Configuring a Remote Interpreter
316
-
317
-
If you wish to use a remote SSH interpreter (e.g., via VSCode), you must install and run an SSH server on your Windows VM. We recommend to install OpenSSH Server by navigating to `Settings > Apps > Manage optional features > Add a feature`, selecting `OpenSSH Server` in the list and clicking `Install`. To start the SSH server, navigate to `Control Panel > System and Security > Administrative Tools > View local services`, select `OpenSSH Server` and press `Start`. If you wish to configure the server to start automatically on startup, select `Actions > Properties` while `OpenSSH Server` is selected from the list (or just double-click on `OpenSSH Server`), select `Automatic` in the `Startup type` dropdown and hit `Apply`.
318
-
319
-
You must also ensure that port 22 of your Windows VM is reachable by your SSH client.
320
-
321
-
- If using an Azure VM, this can be accomplished by defining an appropriate inbound port rule for TCP on port 22 either during creation of the virtual machine or after creation in the VM's networking settings.
322
-
- If using Parallels Desktop, navigate to `Preferences > Network` and define a port forwarding rule for TCP on destination port 22.
323
-
324
-
### Troubleshooting
325
-
326
-
- In our experience, the `workon` command familiar to users of `virtualenvwrapper` may not properly run on Windows with `virtualenvwrapper-win`. In order to activate a virtual environment, you can manually run the appropriate activation script (`activate.ps1` if using Powershell) typically located in `$env:USERPROFILE\Envs\<env-name>\Scripts`.
0 commit comments