Skip to content

Commit 25e1cb5

Browse files
committed
docs: update developer guide for new testing, CI workflows, and Ruff tooling:
- Add instructions for unit vs regression test suites - Document slow test markers and how to run them - Explain automatic regression dataset downloads via filestore - Add guidance for updating regression baselines - Update coding standards to use Ruff instead of Black/Flake8/isort - Document multi-OS and multi-Python CI workflows - Clarify developer setup and testing commands - Remove outdated tooling references
1 parent 631293f commit 25e1cb5

1 file changed

Lines changed: 86 additions & 33 deletions

File tree

docs/developer_guide.rst

Lines changed: 86 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
Developer Guide
22
===============
33

4-
CodeEntropy is open-source, and we welcome contributions from the wider community to help improve and extend its functionality. This guide walks you through setting up a development environment, running tests, submitting contributions, and maintaining coding standards.
4+
CodeEntropy is open-source, and we welcome contributions from the wider community
5+
to help improve and extend its functionality. This guide walks you through setting
6+
up a development environment, running tests, contributing code, and understanding
7+
the continuous integration workflows.
58

69
Getting Started for Developers
710
------------------------------
@@ -24,44 +27,77 @@ Install development dependencies::
2427
Running Tests
2528
-------------
2629

27-
Run the full test suite::
30+
CodeEntropy uses **pytest** with separate unit and regression suites.
2831

29-
pytest -v
32+
Run all tests::
3033

31-
Run tests with code coverage::
34+
pytest
35+
36+
Run only unit tests::
37+
38+
pytest tests/unit
39+
40+
Run regression tests::
41+
42+
pytest tests/regression
43+
44+
Run regression tests excluding slow systems::
45+
46+
pytest tests/regression -m "not slow"
47+
48+
Run slow regression tests::
49+
50+
pytest tests/regression -m slow
51+
52+
Run tests with coverage::
3253

3354
pytest --cov CodeEntropy --cov-report=term-missing
3455

35-
Run tests for a specific module::
56+
Update regression baselines::
3657

37-
pytest CodeEntropy/tests/test_CodeEntropy/test_levels.py
58+
pytest tests/regression --update-baselines
3859

3960
Run a specific test::
4061

41-
pytest CodeEntropy/tests/test_CodeEntropy/test_levels.py::test_select_levels
62+
pytest tests/unit/.../test_file.py::test_function
63+
64+
Regression Test Data
65+
--------------------
66+
67+
Regression datasets are automatically downloaded from the CCPBioSim filestore
68+
and cached locally in ``.testdata/`` when tests are run.
69+
70+
No manual setup is required.
71+
72+
The test configuration files reference datasets using the ``${TESTDATA}``
73+
placeholder, which is expanded automatically during test execution.
4274

4375
Coding Standards
4476
----------------
4577

46-
We use **pre-commit hooks** to maintain code quality and consistent style. To enable these hooks::
78+
We use **pre-commit hooks** to maintain code quality and consistent style.
79+
80+
Enable hooks::
4781

4882
pre-commit install
4983

50-
This ensures:
84+
Our tooling stack:
85+
86+
- **Linting and formatting** via ``ruff``
87+
- **Basic repository checks** via ``pre-commit-hooks``
88+
89+
Ruff performs:
90+
91+
- Code formatting
92+
- Import sorting
93+
- Static analysis
94+
- Style enforcement
5195

52-
- **Formatting** via ``black`` (`psf/black`)
53-
- **Import sorting** via ``isort`` with the ``black`` profile
54-
- **Linting** via ``flake8`` with ``flake8-pyproject``
55-
- **Basic checks** via ``pre-commit-hooks``, including:
96+
Run checks manually::
5697

57-
- Detection of large added files
58-
- AST validity checks
59-
- Case conflict detection
60-
- Executable shebang verification
61-
- Merge conflict detection
62-
- TOML and YAML syntax validation
98+
pre-commit run --all-files
6399

64-
To skip pre-commit checks for a commit::
100+
Skip checks for a commit (not recommended)::
65101

66102
git commit -n
67103

@@ -72,33 +108,50 @@ To skip pre-commit checks for a commit::
72108
Continuous Integration (CI)
73109
---------------------------
74110

75-
CodeEntropy uses **GitHub Actions** to automatically:
111+
CodeEntropy uses **GitHub Actions** with multiple workflows to ensure stability
112+
across platforms and Python versions.
113+
114+
Pull Request checks include:
115+
116+
- Unit tests on Linux, macOS, and Windows
117+
- Python versions 3.12-3.14
118+
- Quick regression tests
119+
- Documentation build
120+
- Pre-commit validation
121+
122+
Daily workflow:
76123

77-
- Run all tests
78-
- Check coding style
79-
- Build documentation
80-
- Validate versioning
124+
- Runs automated test validation
81125

82-
Every pull request will trigger these checks to ensure quality and stability.
126+
Weekly workflows:
127+
128+
- Full regression suite including slow tests
129+
- Documentation build across all Python versions
130+
131+
CI also caches regression datasets to improve performance.
83132

84133
Building Documentation
85134
----------------------
86135

87-
Build locally::
136+
Build documentation locally::
88137

89138
cd docs
90139
make html
91140

92-
The generated HTML files will be in ``docs/build/html/``. Open ``index.html`` in your browser to view the documentation.
141+
The generated HTML files will be in ``docs/build/html/``.
142+
143+
Open ``index.html`` in your browser to preview.
93144

94-
Edit docs in the following directories:
145+
Documentation sources are located in:
95146

96147
- ``docs/user_guide/``
97148
- ``docs/developer_guide/``
98149

99150
Contributing Code
100151
-----------------
101-
If you would to contribution to **CodeEntropy** please refer to our `Contributing Guidelines <https://github.com/CCPBioSim/CodeEntropy?tab=contributing-ov-file>`_
152+
153+
If you would like to contribute to **CodeEntropy**, please refer to the
154+
`Contributing Guidelines <https://github.com/CCPBioSim/CodeEntropy?tab=contributing-ov-file>`_.
102155

103156
Creating an Issue
104157
^^^^^^^^^^^^^^^^^
@@ -114,7 +167,7 @@ Branching
114167
- Never commit directly to ``main``.
115168
- Create a branch named after the issue::
116169

117-
git checkout -b 123-fix-levels
170+
git checkout -b 123-feature-description
118171

119172
Pull Requests
120173
^^^^^^^^^^^^^
@@ -132,6 +185,6 @@ Full developer setup::
132185

133186
git clone https://github.com/CCPBioSim/CodeEntropy.git
134187
cd CodeEntropy
135-
pip install -e .[testing,docs,pre-commit]
188+
pip install -e ".[testing,docs,pre-commit]"
136189
pre-commit install
137-
pytest --cov CodeEntropy --cov-report=term-missing
190+
pytest

0 commit comments

Comments
 (0)