Skip to content

Commit aecbe54

Browse files
authored
Merge pull request #4326 from t20100/update-contributing-doc
Documentation: Updated contribution guidelines
2 parents 1ec1659 + f493d4d commit aecbe54

File tree

9 files changed

+78
-136
lines changed

9 files changed

+78
-136
lines changed

CONTRIBUTING.rst

Lines changed: 74 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,23 @@ which is described in other projects like `scikit-image <https://scikit-image.or
1010

1111
1. Create your `GitHub <https://github.com/>`_ account and upload your SSH keys.
1212

13-
2. Fork the silx project from https://github.com/silx-kit/silx/.
13+
2. `Fork the silx project <https://github.com/silx-kit/silx/fork>`_.
1414

15-
3. Clone your GitHub repository on yout local computer.
15+
3. Clone your GitHub repository on your local computer:
1616

17-
.. code-block:: bash
17+
.. code-block:: bash
1818
19-
git clone [email protected]/<your_user_name>/silx
20-
cd silx
19+
git clone [email protected]:<your_user_name>/silx
20+
cd silx
2121
22-
4. Install the dependencies defined in *requirements-dev.txt*.
22+
4. `Install silx for development`_.
2323

24-
.. code-block:: bash
25-
26-
pip install -r requirements-dev.txt
27-
28-
5. Make sure the silx test suite pass on your computer using the ``python3 run_tests.py`` or
29-
``python3 run_tests.py silx.gui.test.test_qt`` if you want to test only a subset of it.
30-
You can use ``python /path/to/silx/bootstrap.py script.py`` to test your scripts without
31-
installing silx, but the test suite is required to pass.
24+
5. `Run the tests`_ to make sure the silx test suite pass on your computer.
3225

3326
6. Open an issue in ``https://github.com/silx-kit/silx/issues`` to inform the
3427
maintainers of your intentions.
3528

36-
7. Create a local branch to start working on your issue ``git branch my_feature``.
29+
7. Create a local branch to start working on your issue: ``git branch my_feature``.
3730

3831
8. Code, enjoy but ensure that the new code is tested and does not break
3932
the current test suite.
@@ -49,52 +42,40 @@ which is described in other projects like `scikit-image <https://scikit-image.or
4942
If you encounter any problems or have any questions you can always ask on the `Issues page <https://github.com/silx-kit/silx/issues>`_.
5043

5144

52-
Pull Request title format
53-
-------------------------
45+
Install silx for development
46+
----------------------------
5447

55-
To ease release notes authoring, when creating a Pull Request (PR), please use the following syntax for the title::
48+
1. Install `build dependencies <https://mesonbuild.com/meson-python/how-to-guides/editable-installs.html#build-dependencies>`_::
5649

57-
<Subpackage/Module/Topic>: <Action> <summary of the main change affecting silx's users>
50+
pip install meson-python ninja cython
5851

52+
2. Install silx in `editable mode <https://peps.python.org/pep-0660/>`_ with the development dependencies::
5953

60-
With:
54+
pip install --no-build-isolation --editable .[dev]
6155

62-
- **Subpackage/Topic**: One of:
56+
.. note::
6357

64-
- A subpackage or a module: Use the fully qualified name of the subpackage or module of silx the PR is changing.
65-
For example: ``silx.gui.qt`` or ``silx.gui.plot.PlotWidget``.
66-
- A topic: If changes do not affect a particular subpackage or module, provide the topic of the change.
67-
This can be for example: ``Build``, ``Documentation``, ``CI``,... or the name of a silx application (e.g., ``silx view``).
58+
If the project "entry points" are modified, the project must be re-installed.
6859

69-
- **Action**: How the changes affects the project from a silx user point of view.
70-
Prefer using one of the following actions:
60+
.. seealso::
7161

72-
- **Added**: For new feature or new APIs
73-
- **Deprecated**
74-
- **Removed**
75-
- **Changed**
76-
- **Improved**
77-
- **Refactored**
78-
- **Fixed**
79-
- More: If none of the previous actions match your changes, please use another keyword.
62+
`Meson editable installs <https://mesonbuild.com/meson-python/how-to-guides/editable-installs.html>`_
8063

81-
- **Summary**: A short description of the main change as you would like to read it from release notes.
8264

83-
84-
Code formatting
65+
Format the code
8566
---------------
8667

87-
To format the code, use `black <https://black.readthedocs.io>`_.
68+
To format the code, use `black <https://black.readthedocs.io>`_::
8869

70+
black .
8971

90-
How-to build the documentation
91-
------------------------------
9272

93-
To build the documentation, using `Sphinx <http://www.sphinx-doc.org/>`_, run:
73+
Build the documentation
74+
-----------------------
9475

95-
.. code-block:: bash
76+
- `Install silx for development`_.
77+
- From the silx project root folder, run `Sphinx <http://www.sphinx-doc.org/>`_::
9678

97-
pip install . # Make sure to install the same version as the source
9879
sphinx-build doc/source/ build/html
9980

10081
.. note::
@@ -103,22 +84,64 @@ To build the documentation, using `Sphinx <http://www.sphinx-doc.org/>`_, run:
10384
environment variable ``DIRECTIVE_SNAPSHOT_QT`` set to ``True``.
10485

10586

106-
How-to run the tests
107-
--------------------
87+
Run the tests
88+
-------------
89+
90+
- `Install silx for development`_.
91+
- From the silx project root folder, use `pytest <https://docs.pytest.org/en/stable/how-to/usage.html>`_:
92+
93+
.. warning::
94+
95+
GUI tests are part of the complete test suite and will make windows appear and disappear very quickly.
96+
97+
**Do not run these if you have a history of epilepsy or motion sickness**
98+
99+
* To run the complete test suite::
100+
101+
pytest
102+
103+
* To run a specfic test::
104+
105+
pytest <src/silx/path/to/test_file.py> # or
106+
pytest --pyargs <silx.subpackage.test.test_module>
108107

109-
To run the tests of an installed version of *silx*, run the following on the python interpreter:
108+
To run the tests of an installed version of *silx*, run the following from the Python interpreter:
110109

111110
.. code-block:: python
112111
113112
import silx.test
114113
silx.test.run_tests()
115114
116-
To run the test suite of a development version, use the *run_tests.py* script at
117-
the root of the source project.
118115
119-
.. code-block:: bash
116+
Pull Request title format
117+
-------------------------
118+
119+
To ease release notes authoring, when creating a Pull Request (PR), please use the following syntax for the title::
120+
121+
<Subpackage/Module/Topic>: <Action> <summary of the main change affecting silx's users>
122+
123+
124+
With:
125+
126+
- **Subpackage/Topic**: One of:
127+
128+
- A subpackage or a module: Use the fully qualified name of the subpackage or module of silx the PR is changing.
129+
For example: ``silx.gui.qt`` or ``silx.gui.plot.PlotWidget``.
130+
- A topic: If changes do not affect a particular subpackage or module, provide the topic of the change.
131+
This can be for example: ``Build``, ``Documentation``, ``CI``,... or the name of a silx application (e.g., ``silx view``).
132+
133+
- **Action**: How the changes affect the project from a silx user point of view.
134+
Prefer using one of the following actions:
135+
136+
- **Added**: For new feature or new APIs
137+
- **Deprecated**
138+
- **Removed**
139+
- **Changed**
140+
- **Improved**
141+
- **Refactored**
142+
- **Fixed**
120143

121-
python ./run_tests.py
144+
- **Summary**: A short description of the main change that will be included in the release notes.
122145

123146

124147
How-to make a release

MANIFEST.in

Lines changed: 0 additions & 20 deletions
This file was deleted.

doc/source/install.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,9 @@ The GUI widgets depend on the following extra packages:
158158
* `pyopencl <https://mathema.tician.de/software/pyopencl/>`_
159159
* `Mako <http://www.makotemplates.org/>`_
160160

161-
List of dependencies with minimum required versions:
162-
163-
.. include:: ../../requirements.txt
164-
:literal:
165161

166162
Build dependencies
167163
++++++++++++++++++
168164

169-
In addition to run-time dependencies, building *silx* requires a C/C++ compiler and `cython <http://cython.org>`_.
165+
*silx* uses `meson-python <https://mesonbuild.com/meson-python/>`_ build backend and
166+
requires `cython <http://cython.org>`_ and a C/C++ compiler.

package/windows/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Pre-requisites
55
--------------
66

77
- `PyInstaller <https://pyinstaller.readthedocs.io/>`_ must be installed.
8-
Run: ``pip install -r requirements-dev.txt``
8+
Run: ``pip install pyinstaller``
99
- `InnoSetup <https://jrsoftware.org/isinfo.php>`_ must be installed and in the ``PATH``.
1010
- silx and all its dependencies must be INSTALLED::
1111

requirements-dev.txt

Lines changed: 0 additions & 23 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/silx/gui/dialog/test/test_datafiledialog.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,6 @@ def printState(self):
809809
810810
Can be used to add or regenerate `STATE_VERSION1_QT4` or
811811
`STATE_VERSION1_QT5`.
812-
813-
>>> ./run_tests.py -v silx.gui.dialog.test.test_datafiledialog.TestDataFileDialogApi.printState
814812
"""
815813
dialog = self.createDialog()
816814
dialog.setDirectory("")

src/silx/gui/dialog/test/test_imagefiledialog.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,6 @@ def printState(self):
625625
626626
Can be used to add or regenerate `STATE_VERSION1_QT4` or
627627
`STATE_VERSION1_QT5`.
628-
629-
>>> ./run_tests.py -v silx.gui.dialog.test.test_imagefiledialog.TestImageFileDialogApi.printState
630628
"""
631629
dialog = self.createDialog()
632630
colormap = Colormap(normalization=Colormap.LOGARITHM)

src/silx/utils/test/test_debug.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ class TestDebug(unittest.TestCase):
5353

5454
def logB(self):
5555
"""
56-
Can be used to check the log output using:
57-
`./run_tests.py silx.utils.test.test_debug.TestDebug.logB -v`
56+
Can be used to check the log output
5857
"""
5958
print()
6059
test = _Foobar()

0 commit comments

Comments
 (0)