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: CONTRIBUTING.md
+57-26Lines changed: 57 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,36 +25,67 @@ These are especially suitable if you're new to the project, and we recommend sta
25
25
26
26
## Contributing code
27
27
28
-
29
28
### Creating a development environment
30
-
It is recommended to use [conda](conda:)
31
-
or [mamba](mamba:) to create a
32
-
development environment for `movement`. In the following we assume you have
33
-
`conda` installed, but the same commands will also work with `mamba`/`micromamba`.
34
29
35
-
First, create and activate a `conda` environment with some prerequisites:
30
+
In order to make changes to `movement`, you will need to fork the [repository](movement-github:).
31
+
If you are not familiar with `git`, we recommend reading up on [this guide](https://docs.github.com/en/get-started/using-git/about-git#basic-git-commands).
Finally, initialise the [pre-commit hooks](#formatting-and-pre-commit-hooks):
46
+
3. Create an environment using [conda](conda:) or [uv](uv:getting-started/installation/) and install `movement`in editable mode, including development dependencies.
To edit the documentation, ensure you have already set up a [development environment](#creating-a-development-environment).
217
247
218
-
Then, install a few additional dependencies in your development environment to be able to build the documentation locally. To do this, run the following command from the root of the repository:
248
+
To build the documentation locally, install the extra dependencies by running the following command from the repository root:
Install the core package from the latest release on PyPI:
47
+
You may exchange `pyqt` for `pyside6` if you prefer a different Qt backend.
48
+
See [napari's installation guide](napari:tutorials/fundamentals/installation.html)
49
+
for more details on available backends.
50
+
51
+
:::
52
+
53
+
:::{tab-item} From PyPI using pip
54
+
Install the core package:
45
55
```sh
46
56
pip install movement
47
57
```
48
-
If you wish to use the GUI, which additionally requires [napari](napari:),
49
-
you should instead run:
58
+
If you wish to use the GUI, which requires [napari](napari:), run instead:
59
+
```sh
60
+
pip install "movement[napari]"
61
+
```
62
+
:::
63
+
64
+
:::{tab-item} From PyPI using uv
65
+
Install the core package:
66
+
```sh
67
+
uv pip install movement
68
+
```
69
+
If you wish to use the GUI, which requires [napari](napari:), run instead:
50
70
```sh
51
-
pip install movement[napari] # works on most shells
52
-
pip install 'movement[napari]'# works on zsh (default shell on macOS)
71
+
uv pip install "movement[napari]"
53
72
```
54
73
:::
74
+
55
75
::::
56
76
57
77
:::{dropdown} Note for Apple Silicon users with macOS 13 or earlier
58
78
:color: info
59
79
:icon: info
60
80
61
-
We recommend installing `movement` following the `Conda` instructions above, as the `pip` method will likely fail for you.
62
-
Alternatively, updating your macOS to version 14 or later will allow `pip` installations to work as expected.
81
+
If you are using macOS 13 or earlier on Apple Silicon (M-series),
82
+
we recommend installing `movement` via `conda-forge`.
83
+
Alternatively, upgrade to macOS 14 to use any of the installation methods above.
63
84
:::
64
85
65
-
### Developers
66
-
If you are a developer looking to contribute to movement, please refer to our [contributing guide](target-contributing) for detailed setup instructions and guidelines.
86
+
:::{admonition} For developers
87
+
:class: tip
88
+
89
+
If you would like to contribute to `movement`, see our [contributing guide](target-contributing)
90
+
for detailed developer setup instructions and coding guidelines.
91
+
:::
67
92
68
-
## Check the installation
69
-
To verify that the installation was successful, run (with `movement-env` activated):
93
+
## Verify the installation
94
+
With your virtual environment activated, run:
70
95
```sh
71
96
movement info
72
97
```
73
-
You should see a printout including the version numbers of movement
98
+
You should see a printout including the version numbers of `movement`
74
99
and some of its dependencies.
75
100
76
-
To test the GUI installation, you can run:
101
+
To test the GUI installation:
77
102
78
103
```sh
79
104
movement launch
@@ -83,37 +108,68 @@ This is equivalent to running `napari -w movement` and should open the `napari`
83
108
window with the `movement` widget docked on the right-hand side.
84
109
85
110
## Update the package
86
-
To update `movement` to the latest version, you need to use the same package manager you used to install it (either `conda` or `pip`). If you are not sure which one you used, you can run from your active environment:
111
+
112
+
:::{dropdown} Always update using the same package manager used for installation
113
+
:icon: info
114
+
:color: info
115
+
116
+
If your environment was created with `conda`, first check which channel `movement` was installed from before updating.
117
+
Run `conda list movement` in your active `conda` environment and look at the **Channel** column:
118
+
- If the channel is `conda-forge`, update using `conda`.
119
+
- If the channel is `pypi`, update using `pip`.
120
+
121
+
:::
122
+
123
+
124
+
::::{tab-set}
125
+
:::{tab-item} conda
87
126
```sh
88
-
conda list movement
127
+
conda update -c conda-forge movement -y
89
128
```
90
-
If the output shows `conda-forge` as the channel, you used `conda` to install it. If it shows `pypi`, you used `pip`.
129
+
:::
91
130
92
-
Once this is clear, you can update `movement` by running the relevant command from below:
93
-
::::{tab-set}
94
-
:::{tab-item} Conda
131
+
:::{tab-item} pip
95
132
```sh
96
-
conda update movement -y
133
+
pip install -U movement
97
134
```
98
135
:::
99
136
100
-
:::{tab-item} Pip
137
+
:::{tab-item} uv
101
138
```sh
102
-
pip install movement -U
139
+
uv pip install -U movement
103
140
```
104
141
:::
105
142
::::
106
143
107
144
108
-
If the above fails, try installing it in a fresh new environment instead. This should prevent potential compatibility issues caused by changes in dependency versions. You can first uninstall the existing environment named `movement-env`:
145
+
If the above fails, try installing `movement` in a fresh new environment to avoid dependency conflicts.
146
+
147
+
First remove the existing environment:
148
+
149
+
::::{tab-set}
150
+
:::{tab-item} conda
109
151
```sh
110
152
conda env remove -n movement-env
111
153
```
112
-
Once the environment has been removed, you can create a new one following the [installation instructions](#install-the-package) above.
113
154
114
-
:::{tip}
115
-
If you are unsure about the environment name, you can get a list of the environments on your system with:
155
+
This command assumes your environment is named `movement-env`.
156
+
If you are unsure about the name, you can get a list of the environments
157
+
on your system with `conda env list`.
158
+
:::
159
+
160
+
:::{tab-item} uv
161
+
Delete the `.venv` folder in your project directory.
162
+
163
+
```powershell
164
+
rm -rf .venv # On macOS and Linux
165
+
rmdir /s /q .venv # On Windows PowerShell
166
+
```
167
+
168
+
Optionally, you can clean the `uv` cache for unused packages:
116
169
```sh
117
-
conda env list
170
+
uv cache prune
118
171
```
119
172
:::
173
+
::::
174
+
175
+
Once the environment has been removed, you can create a new one following the [instructions](#create-a-virtual-environment) above.
0 commit comments