Skip to content

Commit bd7e851

Browse files
authored
Merge pull request #163 from luxedo/DOC/159
Doc/159 - remove scpdt references from README
2 parents 58ff06a + e340dcb commit bd7e851

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

README.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ the output. Thus the example source needs to be valid python code still.
8282

8383
```
8484
$ pip install -e .
85-
$ pytest --pyargs scpdt
85+
$ pytest --pyargs scipy_doctest
8686
```
8787

8888
## Usage
@@ -100,7 +100,7 @@ For example,
100100

101101
```
102102
>>> from scipy import linalg
103-
>>> from scpdt import testmod
103+
>>> from scipy_doctest import testmod
104104
>>> res, hist = testmod(linalg, strategy='api')
105105
>>> res
106106
TestResults(failed=0, attempted=764)
@@ -116,15 +116,15 @@ the behavior of the eponymous functions of the `doctest` module).
116116

117117
There is a basic CLI, which also mimics that of the `doctest` module:
118118
```
119-
$ python -m scpdt foo.py
119+
$ python -m scipy_doctest foo.py
120120
```
121121

122122
Note that, just like `$ python -m doctest foo.py`, this may
123123
fail if `foo.py` is a part of a package due to package imports.
124124

125125
Text files can also be CLI-checked:
126126
```
127-
$ python -m scpdt bar.rst
127+
$ python -m scipy_doctest bar.rst
128128
```
129129

130130

@@ -148,39 +148,38 @@ passing the instance to `testmod` or constructors of `DT*` objects. Defaults
148148
are provided, based on a long-term usage in SciPy.
149149

150150

151-
### The Scpdt Pytest Plugin
151+
### The SciPy Doctest Pytest Plugin
152152

153-
The pytest plugin enables the use of scpdt tools to perform doctests.
153+
The pytest plugin enables the use of `scipy_doctest` tools to perform doctests.
154154

155155
Follow the given instructions to utilize the pytest plugin for doctesting.
156156

157-
### Running doctests on Scipy
158-
1. **Install plugin**
157+
### Running Doctests on SciPy
159158

160-
Start by installing the pytest plugin via pip:
159+
1. **Install plugin**
161160

162161
```bash
163-
pip install git+https://github.com/ev-br/scpdt.git@main
162+
pip install scipy-doctest
164163
```
165164

166165
2. **Configure Your Doctesting Experience**
167166

168167
To tailor your doctesting experience, you can utilize an instance of `DTConfig`.
169-
An in-depth explanation is given in the [tailoring your doctesting experience](https://github.com/ev-br/scpdt#tailoring-your-doctesting-experience) section.
168+
An in-depth explanation is given in the [tailoring your doctesting experience](https://github.com/scipy/scipy_doctest#tailoring-your-doctesting-experience) section.
170169

171170
3. **Run Doctests**
172171

173172
Doctesting is configured to execute on SciPy using the `dev.py` module.
174173

175174
To run all doctests, use the following command:
176175
```bash
177-
python dev.py test --doctests
176+
python dev.py smoke-docs
178177
```
179178

180179
To run doctests on specific SciPy modules, e.g: `cluster`, use the following command:
181180

182181
```bash
183-
python dev.py test --doctests -s cluster
182+
python dev.py smoke-docs -s cluster
184183
```
185184

186185
### Running Doctests on Other Packages/Projects
@@ -190,7 +189,7 @@ If you want to run doctests on packages or projects other than SciPy, follow the
190189
1. **Install the plugin**
191190

192191
```bash
193-
pip install git+https://github.com/ev-br/scpdt.git@main
192+
pip install scipy-doctest
194193
```
195194

196195
2. **Register or Load the Plugin**
@@ -202,14 +201,14 @@ To do this, add the following line of code:
202201
```python
203202
# In your conftest.py file or test module
204203

205-
pytest_plugins = "scpdt"
204+
pytest_plugins = "scipy_doctest"
206205
```
207206

208207
Check out the [pytest documentation](https://docs.pytest.org/en/stable/how-to/writing_plugins.html#requiring-loading-plugins-in-a-test-module-or-conftest-file) for more information on requiring/loading plugins in a test module or `conftest.py` file.
209208

210209
3. **Configure your doctesting experience**
211210

212-
An in-depth explanation is given in the [tailoring your doctesting experience](https://github.com/ev-br/scpdt#tailoring-your-doctesting-experience) section.
211+
An in-depth explanation is given in the [tailoring your doctesting experience](https://github.com/scipy/scipy_doctest#tailoring-your-doctesting-experience) section.
213212

214213
4. **Run doctests**
215214

@@ -232,7 +231,7 @@ $ pytest --pyargs <your-package> --doctest-modules --doctest-collect=api
232231

233232
### Tailoring Your Doctesting Experience
234233

235-
[DTConfig](https://github.com/ev-br/scpdt/blob/671083d65b54111770cee71c9bc790ac652d59ab/scpdt/impl.py#L16) offers a variety of attributes that allow you to fine-tune your doctesting experience.
234+
[DTConfig](https://github.com/scipy/scipy_doctest/blob/main/scipy_doctest/impl.py#L23) offers a variety of attributes that allow you to fine-tune your doctesting experience.
236235

237236
These attributes include:
238237
1. **default_namespace (dict):** Defines the namespace in which examples are executed.
@@ -252,16 +251,16 @@ Typically, it is entered for each DocTest (especially in API documentation), ens
252251
12. **nameerror_after_exception (bool):** Controls whether subsequent examples in the same test, after one has failed, may raise spurious NameErrors. Set to `True` if you want to observe these errors or if your test is expected to raise NameErrors. The default is `False`.
253252

254253
To set any of these attributes, create an instance of `DTConfig` called `dt_config`.
255-
This instance is already set as an [attribute of pytest's `Config` object](https://github.com/ev-br/scpdt/blob/671083d65b54111770cee71c9bc790ac652d59ab/scpdt/plugin.py#L27).
254+
This instance is already set as an [attribute of pytest's `Config` object](https://github.com/scipy/scipy_doctest/blob/58ff06a837b7bff1dbac6560013fc6fd07952ae2/scipy_doctest/plugin.py#L39).
256255

257256
**Example:**
258257

259258
```python
260259
dt_config = DTConfig()
261260
dt_config.stopwords = {'plt.', '.hist', '.show'}
262261
dt_config.local_resources = {
263-
'scpdt.tests.local_file_cases.local_files': ['scpdt/tests/local_file.txt'],
264-
'scpdt.tests.local_file_cases.sio': ['scpdt/tests/octave_a.mat']
262+
'scipy_doctest.tests.local_file_cases.local_files': ['scipy_doctest/tests/local_file.txt'],
263+
'scipy_doctest.tests.local_file_cases.sio': ['scipy_doctest/tests/octave_a.mat']
265264
}
266265
dt_config.skiplist = {
267266
'scipy.special.sinc',
@@ -270,9 +269,9 @@ dt_config.skiplist = {
270269
}
271270
```
272271

273-
If you don't set these attributes, the [default settings](https://github.com/ev-br/scpdt/blob/671083d65b54111770cee71c9bc790ac652d59ab/scpdt/impl.py#L73) of the attributes are used.
272+
If you don't set these attributes, the [default settings](https://github.com/scipy/scipy_doctest/blob/58ff06a837b7bff1dbac6560013fc6fd07952ae2/scipy_doctest/impl.py#L94) of the attributes are used.
274273

275-
By following these steps, you will be able to effectively use the Scpdt pytest plugin for doctests in your Python projects.
274+
By following these steps, you will be able to effectively use the SciPy Doctest pytest plugin for doctests in your Python projects.
276275

277276
Happy testing!
278277

@@ -299,7 +298,7 @@ instead of `$ pytest --pyargs scipy`.
299298
If push comes to shove, you may try using the magic env variable:
300299
` PY_IGNORE_IMPORTMISMATCH=1 pytest ...`,
301300
however the need usually indicates an issue with the package itself.
302-
(see [gh-107](https://github.com/ev-br/scpdt/pull/107) for an example).
301+
(see [gh-107](https://github.com/scipy/scipy_doctest/pull/107) for an example).
303302

304303
- *Optional dependencies are not that optional*
305304

0 commit comments

Comments
 (0)