Skip to content

Commit

Permalink
removed uv from the dev requirments, updated requirements, and added …
Browse files Browse the repository at this point in the history
…conda install docs
  • Loading branch information
fzumstein committed Sep 18, 2024
1 parent 80b6952 commit 7af3ff2
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 27 deletions.
42 changes: 42 additions & 0 deletions docs/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,45 @@ numpy==1.26.4
```

When you first clone xlwings Server, there will be a few dependencies in `requirements.in`. They are there to make the examples work out of the box, but you should replace them with your own top-level dependencies.

## Conda environments

If you'd like to use a Conda env because e.g., you have dependencies that are only available via Conda, do the following:

1. Create a new Conda env. Make sure to replce `myenv` with the desired name of your environment:

```text
conda create -n myenv python=3.12 -y
```

2. Activate the Conda env:

```text
conda activate myenv
```

3. Install the `uv` package manager:

```text
pip install uv
```

4. Install `requirements-dev.txt` (for development) or `requirements.txt` otherwise:

```text
uv pip sync requirements-dev.txt
```

5. Install conda dependencies:

```text
conda install blas
```

6. Export the environment into `environment.yml` (call it `environment-dev.yml` if this is a development environment):

```text
conda env export > environment.yml
```

Commit `environment.yml` to Git. You can now use it to recreate this specific Conda environment whenever you need it via `conda env create -f environment.yml`.
20 changes: 15 additions & 5 deletions docs/repo_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,31 @@ If you only want to play around with xlwings Server without committing any chang
git config --local merge.ours.driver true
```

7. In the desired Python environment, install the development dependencies:
7. Install the `uv` package manager:

```text
pip install -r requirements-dev.txt
pip install uv
```

8. Initialize the repo. This will create an `.env` file for configuration and will create unique UUIDs in the `app/config.py` file.
8. In the desired Python environment, install the development dependencies:

```text
uv pip sync -r requirements-dev.txt
```

9. Initialize the repo. This will create an `.env` file for configuration and will create unique UUIDs in the `app/config.py` file.

```text
python run.py init
```

9. Open the `.env` file and add your xlwings license key under `XLWINGS_LICENSE_KEY` (top of the file). Note that `.env` is ignored by Git as it may contain sensitive credentials. You should therefore back it up in a secure location such as a password manager.
10. Open the `.env` file and add your xlwings license key under `XLWINGS_LICENSE_KEY` (top of the file).

```{note}
`.env` is ignored by Git as it may contain sensitive credentials. You should therefore back it up in a secure location such as a password manager.
```
10. Commit the changes and push everything to your own repo (feel free to use a Git UI instead of the following commands). If you just want to play around with xlwings Server, you can skip this step.
11. Commit the changes and push everything to your own repo (feel free to use a Git UI instead of the following commands). If you just want to play around with xlwings Server, you can skip this step.
```text
git add .
Expand Down
10 changes: 5 additions & 5 deletions requirements-core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ croniter==3.0.3
# via -r requirements-core.in
cryptography==43.0.1
# via joserfc
fastapi-slim==0.114.1
fastapi-slim==0.115.0
# via -r requirements-core.in
gunicorn==23.0.0 ; sys_platform != 'win32'
# via -r requirements-core.in
Expand All @@ -41,7 +41,7 @@ httptools==0.6.1
# via -r requirements-core.in
httpx==0.27.2
# via -r requirements-core.in
idna==3.8
idna==3.10
# via
# anyio
# httpx
Expand All @@ -61,13 +61,13 @@ packaging==24.1 ; sys_platform != 'win32'
# via gunicorn
pycparser==2.22 ; platform_python_implementation != 'PyPy'
# via cffi
pydantic==2.9.1
pydantic==2.9.2
# via
# fastapi-slim
# pydantic-settings
pydantic-core==2.23.3
pydantic-core==2.23.4
# via pydantic
pydantic-settings==2.5.1
pydantic-settings==2.5.2
# via -r requirements-core.in
python-dateutil==2.9.0.post0
# via croniter
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ beautifulsoup4
pre-commit
pytest
pytest-mock
uv
watchfiles
20 changes: 9 additions & 11 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ cryptography==43.0.1
# joserfc
distlib==0.3.8
# via virtualenv
fastapi-slim==0.114.1
fastapi-slim==0.115.0
# via -r requirements.txt
filelock==3.16.0
filelock==3.16.1
# via virtualenv
gunicorn==23.0.0 ; sys_platform != 'win32'
# via -r requirements.txt
Expand All @@ -70,9 +70,9 @@ httptools==0.6.1
# via -r requirements.txt
httpx==0.27.2
# via -r requirements.txt
identify==2.6.0
identify==2.6.1
# via pre-commit
idna==3.8
idna==3.10
# via
# -r requirements.txt
# anyio
Expand Down Expand Up @@ -108,7 +108,7 @@ packaging==24.1
# pytest
pandas==2.2.2
# via -r requirements.txt
platformdirs==4.3.2
platformdirs==4.3.6
# via virtualenv
pluggy==1.5.0
# via pytest
Expand All @@ -118,16 +118,16 @@ pycparser==2.22 ; platform_python_implementation != 'PyPy'
# via
# -r requirements.txt
# cffi
pydantic==2.9.1
pydantic==2.9.2
# via
# -r requirements.txt
# fastapi-slim
# pydantic-settings
pydantic-core==2.23.3
pydantic-core==2.23.4
# via
# -r requirements.txt
# pydantic
pydantic-settings==2.5.1
pydantic-settings==2.5.2
# via -r requirements.txt
pytest==8.3.3
# via
Expand Down Expand Up @@ -190,13 +190,11 @@ tzdata==2024.1
# via
# -r requirements.txt
# pandas
uv==0.4.9
# via -r requirements-dev.in
uvicorn==0.30.6
# via -r requirements.txt
uvloop==0.20.0 ; sys_platform != 'win32'
# via -r requirements.txt
virtualenv==20.26.4
virtualenv==20.26.5
# via pre-commit
watchfiles==0.24.0
# via -r requirements-dev.in
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cryptography==43.0.1
# via
# -r requirements-core.txt
# joserfc
fastapi-slim==0.114.1
fastapi-slim==0.115.0
# via -r requirements-core.txt
gunicorn==23.0.0 ; sys_platform != 'win32'
# via -r requirements-core.txt
Expand All @@ -60,7 +60,7 @@ httptools==0.6.1
# via -r requirements-core.txt
httpx==0.27.2
# via -r requirements-core.txt
idna==3.8
idna==3.10
# via
# -r requirements-core.txt
# anyio
Expand Down Expand Up @@ -95,16 +95,16 @@ pycparser==2.22 ; platform_python_implementation != 'PyPy'
# via
# -r requirements-core.txt
# cffi
pydantic==2.9.1
pydantic==2.9.2
# via
# -r requirements-core.txt
# fastapi-slim
# pydantic-settings
pydantic-core==2.23.3
pydantic-core==2.23.4
# via
# -r requirements-core.txt
# pydantic
pydantic-settings==2.5.1
pydantic-settings==2.5.2
# via -r requirements-core.txt
python-dateutil==2.9.0.post0
# via
Expand Down

0 comments on commit 7af3ff2

Please sign in to comment.