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
Copy file name to clipboardExpand all lines: docs/azure_functions.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,10 @@ The following files are part of Azure functions setup and can be edited accordin
34
34
-`function_app.py`
35
35
-`.funcignore`
36
36
37
+
```{important}
38
+
Azure functions require a traditional `requirements.txt` file in the root of your project. If you use `uv`, run the following command before deploying (ideally, this is done automatically as part of your build step): `uv export --format requirements.txt -o requirements.txt`.
39
+
```
40
+
37
41
## Deployment
38
42
39
43
First, set the following environment variables to match your preferences:
Copy file name to clipboardExpand all lines: docs/migration.md
+67-25Lines changed: 67 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This guide is for existing users upgrading from pre-1.0 versions. If you're new to xlwings Server, follow the [Quickstart](quickstart.md) instead.
4
4
5
-
Starting with v1.0, xlwingis Server is now distributed as a standard Python package instead of requiring you to work directly in the xlwings-server Git repository.
5
+
Starting with v1.0, xlwings Server is distributed as a standard Python package instead of requiring you to work directly in the xlwings-server Git repository.
6
6
7
7
This leads to the following improvements:
8
8
@@ -15,32 +15,74 @@ Other key changes:
15
15
16
16
- Python 3.10 is now the minimal supported version
17
17
- Run the server via `uv run xlwings-server` instead of `python run.py`
18
-
-`pyproject.toml` can now be used to configure the application in addition to `.env` and environment variables, see [](server_config.md)
19
-
20
-
The migration requires one-time project restructuring. The changes below outline what's different in 1.0:
21
-
22
-
1. Follow the [](quickstart.md)
23
-
2. Replace the content of `custom_functions/` and `custom_scripts/` with the content of your old `app/custom_functions/` and `app/custom_scripts/`, respectively.
24
-
3. Copy over the certificates from `certs/` to the same folder.
25
-
4. Overwrite the UUIDs in `pyproject.toml` under `[tools.xlwings_server]` with those from `app/config.py`.
26
-
5. Replace the `.env` file with the `.env` from the old project
27
-
6. Copy `app/templates/manifest.xml` to `templates/manifest.xml`
28
-
7. Run the server: `uv run xlwings-server`.
29
-
30
-
Depending on how much you have customized, continue adding optional components:
31
-
32
-
- If your `app/static/css/style.css` isn't empty, copy it to `static/css/style.css`
33
-
- If your `app/static/js/main.js` isn't empty, copy it to `static/js/main.js`
34
-
- If you have other custom static files, copy them over from `app/static` to `static` into the respective subdirectory, e.g., `images`, `js`, `css`.
35
-
- If you have custom templates, copy them over from `app/templates` to `templates`.
36
-
- To support Azure functions: `uv run xlwings-server add azure functions`, then copy over `local.settings.json`
37
-
- To implement your own `User` model: `uv run xlwings-server add model user`, then add back the logic from `app/models/user.py` to `models/user.py`. There's no need to inherit from `BaseUser` anymore and the model has been simplified.
38
-
- If you want an empty task pane, you can simply delete `templates/taskpane.html`
39
-
- If you were using custom configuration, run `uv run xlwings-server add config` and edit `config.py`.
18
+
-`pyproject.toml` can now be used to configure the application in addition to `.env` and environment variables, see [](server_config.md). This is helpful for settings that are non-sensitive and the same across environments.
19
+
20
+
## Migration
21
+
22
+
To allow for a clean migration, we leave the legacy project untouched and work with a new project.
23
+
24
+
1. Install [uv](https://docs.astral.sh/uv/), Python's modern package manager. Run the following commands on a Terminal:
2. Create a new uv project (I'll be calling it `myproject` here) and change into the directory:
46
+
47
+
```text
48
+
uv init myproject
49
+
cd myproject
50
+
```
51
+
52
+
3. Install `xlwings-server` and `watchfiles` (for hot-reloading), then initialize xlwings-server:
53
+
54
+
```bash
55
+
uv add xlwings-server
56
+
uv add watchfiles --dev
57
+
uv run xlwings-server init .
58
+
```
59
+
60
+
4. Run the migration command from your new project directory:
61
+
62
+
```text
63
+
uv run xlwings-server migrate C:\path\to\old-project
64
+
```
65
+
66
+
After migration, review the migrated files and update any import statements as needed.
67
+
68
+
Run the server to see if the server start correctly:
69
+
70
+
```
71
+
uv run xlwings-server
72
+
```
73
+
74
+
Stop the server again and go through the following list to migrate the additional items that affect you.
75
+
76
+
## Additional Migration Steps
77
+
78
+
- If you have custom static files other than `css/style.css`, `js/main.js`, and `images/`, copy them over from `app/static` to `static`.
79
+
- If you use Azure functions for deployment, run: `uv run xlwings-server add azure functions`, then copy over `local.settings.json`. Note that Azure functions require a traditional `requirements.txt` file in the root of your project. If you use `uv`, run the following command before deploying (ideally, this is done automatically as part of your build step): `uv export --format requirements.txt -o requirements.txt`.
80
+
- If you are using a custom `User` model: `uv run xlwings-server add model user`, then add back the logic from `app/models/user.py` to `models/user.py`. There's no need to inherit from `BaseUser` anymore and the model has been simplified (no more properties).
81
+
- If you were using custom configuration in `app.config.py`, run `uv run xlwings-server add config` and edit `config.py`.
40
82
- If you are using custom authentication, copy `app/auth/custom/__init__.py` to `/auth/custom/__init__.py` and `app/static/js/auth.js` to `static/js/auth.js`.
41
-
- If you have custom FastAPI endpoints, run `uv run xlwings-server add router` and add them to `routers/custom.py`.
83
+
- If you have custom FastAPI endpoints (e.g., added to `app/routers/taskpane.py`), run `uv run xlwings-server add router` and add them to `routers/custom.py`.
42
84
- If you have customized `app/auth/entraid/jwks.py`, run `uv run xlwings-server add auth entraid` and replace the function in `auth/entraid/jwks.py` with that from `app/auth/entraid/jwks.py`.
43
-
-You may need to update import statements as follows:
85
+
-If you have custom User models, authentication, or other endpoints, make sure to change the imports into these:
0 commit comments