@@ -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
2732git clone https://github.com/sasview/sasdata/
2833git clone https://github.com/sasview/sasmodels/
2934git 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
3142cd sasview
3243
33- # create the virtual environment
44+ # Create the virtual environment
3445python -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
4051python -m pip install -e ../sasdata
4152python -m pip install -e ../sasmodels
4253python -m pip install -e .[dev,test]
4354
44- # test if sasview launches
55+ # Test if sasview launches
4556python -m sas
57+
58+ # To deactivate the virtual environment when finished developing
59+ deactivate
4660```
4761
4862Step 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.
56641 . Create a Python virtual environment in the ` .venv ` directory.
57651 . 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
97105The 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.)
107110cd sasview
@@ -113,20 +116,12 @@ python -m sas
113116# Run tests
114117pixi run test
115118
116- # Exit the developer environment
119+ # Exit the developer environment when finished developing
117120exit
118121```
119122
120123In 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 ` .
1301251 . 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.
0 commit comments