Skip to content

Commit 5026bcc

Browse files
committed
- add dev and test dependencies to sasview dependencies in pixi config to make Pixi and venv instructions equivalent
- address review comments
1 parent 3eb541d commit 5026bcc

3 files changed

Lines changed: 25 additions & 28 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,3 @@ tests.log
8383
installers/credits.html
8484
# pixi environments
8585
.pixi/*
86-
!.pixi/config.toml

INSTALL.md

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,49 @@ environment
1818

1919
## Making a SasView Development Environment
2020

21-
### Develop using `venv`
21+
### Prerequisite: Obtaining the source code
2222

23-
If you're familiar with working with developing in Python, then the very quick version is:
23+
Obtain the SasView source using `git`. This step is the same whether you are using `venv` or Pixi to create the development environment. You will likely need to coordinate
24+
updates to `sasdata` and `sasmodels`. The
25+
[`bumps`](https://github.com/bumps/bumps) and
26+
[`periodictable`](https://github.com/python-periodictable/periodictable)
27+
packages are far more loosely coupled, but depending on what you are
28+
doing you may also want them as development packages.
2429

2530
```shell
2631
# clone the repository
2732
git clone https://github.com/sasview/sasdata/
2833
git clone https://github.com/sasview/sasmodels/
2934
git clone https://github.com/sasview/sasview/
35+
```
36+
37+
### Develop using `venv`
38+
39+
If you're familiar with working with developing in Python, then the very quick version is:
3040

41+
```shell
3142
cd sasview
3243

33-
# create the virtual environment
44+
# Create the virtual environment
3445
python -m venv .venv
3546
# .venv\Scripts\activate & REM Windows: activate environment
3647
. .venv/bin/activate # Linux/Mac: activate environment
3748

38-
# install repositories in editable/developer mode in the venv
39-
# use "python -m ..." to ensure the venv's pip is used
49+
# Install repositories in editable/developer mode in the venv
50+
# Use "python -m ..." to ensure the venv's pip is used
4051
python -m pip install -e ../sasdata
4152
python -m pip install -e ../sasmodels
4253
python -m pip install -e .[dev,test]
4354

44-
# test if sasview launches
55+
# Test if sasview launches
4556
python -m sas
57+
58+
# To deactivate the virtual environment when finished developing
59+
deactivate
4660
```
4761

4862
Step by step, that is:
4963

50-
1. Obtain the SasView source using `git`. You will likely need to coordinate
51-
updates to `sasdata` and `sasmodels`. The
52-
[`bumps`](https://github.com/bumps/bumps) and
53-
[`periodictable`](https://github.com/python-periodictable/periodictable)
54-
packages are far more loosely coupled, but depending on what you are
55-
doing you may also want them as development packages.
5664
1. Create a Python virtual environment in the `.venv` directory.
5765
1. Activate the `.venv` so that Python and its modules from the venv are used.
5866
Note that the particular syntax above works for the `bash` and `zsh` shells under Linux, Windows and macOS;
@@ -97,11 +105,6 @@ installed, follow the instructions [here](https://pixi.prefix.dev/latest/#instal
97105
The very quick version for developing using Pixi is:
98106

99107
```shell
100-
# Clone the repository
101-
git clone https://github.com/sasview/sasdata/
102-
git clone https://github.com/sasview/sasmodels/
103-
git clone https://github.com/sasview/sasview/
104-
105108
# Enter the developer environment
106109
# (This will create (or reuse) a local Pixi environment with all required dependencies.)
107110
cd sasview
@@ -113,20 +116,12 @@ python -m sas
113116
# Run tests
114117
pixi run test
115118

116-
# Exit the developer environment
119+
# Exit the developer environment when finished developing
117120
exit
118121
```
119122

120123
In more detail, the steps are:
121124

122-
1. Obtain the SasView source using `git`. You will likely need to coordinate
123-
updates to `sasdata` and `sasmodels`. The
124-
[`bumps`](https://github.com/bumps/bumps) and
125-
[`periodictable`](https://github.com/python-periodictable/periodictable)
126-
packages are far more loosely coupled, but depending on what you are
127-
doing you may also want them as development packages, in which case they
128-
need to be added as editable in the section `[tool.pixi.pypi-dependencies]`
129-
in `pyproject.toml`.
130125
1. Create (or reuse) a local Pixi environment in `.pixi` and enter the shell
131126
into the developer environment. The first time it will take a while to
132127
download and unpack all dependencies.

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,12 @@ channels = ["conda-forge"]
244244
platforms = ["linux-64", "win-64", "osx-arm64"]
245245

246246
[tool.pixi.pypi-dependencies]
247-
sasview = { path = ".", editable = true }
247+
sasview = { path = ".", editable = true, extras = ["test", "dev"]}
248248
sasdata = { path = "../sasdata", editable = true }
249249
sasmodels = { path = "../sasmodels", editable = true }
250+
# Uncomment if you want to install bumps and/or periodictable in editable mode:
251+
# bumps = { path = "../bumps", editable = true }
252+
# periodictable = { path = "../periodictable", editable = true }
250253

251254
[tool.pixi.tasks]
252255
test = { description = "Run the test suite", cmd = "python -m pytest -s test" }

0 commit comments

Comments
 (0)