Skip to content

Commit 8eb52da

Browse files
author
Arun Persaud
committed
pip install: move extra libraries into pyproject.toml, fix documentation
1 parent ec0e5ba commit 8eb52da

File tree

3 files changed

+42
-16
lines changed

3 files changed

+42
-16
lines changed

docs/source/contributing.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,55 @@
11
# Contributing
22

3-
We welcome contributions to code, documentation, tests, and files, just create a [GitHub issue](https://github.com/FSIBT/PyMCNP/issues).
3+
We welcome contributions to code, documentation, tests, and files,
4+
just create a [GitHub issue](https://github.com/FSIBT/PyMCNP/issues).
45

56
## Contributing
67

7-
PyMCNP source code is accessable for contributions, suggestions, and bug reports on [GitHub](https://github.com/FSIBT/PyMCNP):
8+
PyMCNP source code is accessable for contributions, suggestions, and
9+
bug reports on [GitHub](https://github.com/FSIBT/PyMCNP):
810

911
# Installing
1012
git clone https://github.com/FSIBT/PyMCNP
1113
cd PyMCNP
12-
pip install -e .
14+
pip install -e .[dev]
1315

1416
# Running
1517
pymcnp
1618

17-
To contribute, use [pre-commit](https://pre-commit.com) and [ruff](https://docs.astral.sh/ruff/):
19+
To contribute, use [pre-commit](https://pre-commit.com) and
20+
[ruff](https://docs.astral.sh/ruff/). These will be automatically
21+
included when using the optional _dev_ dependency.
1822

1923
# Installing
20-
pip install pre-commit ruff
2124
cd PyMCNP
2225
pre-commit install
2326

24-
# Running
25-
pre-commit
26-
2727
## Testing
2828

29-
To run the PyMCNP test suite, after cloning the PyMCNP GitHub repository, use the following commands to install [pytest](https://docs.pytest.org/en/stable/) with [pytest-cov](https://pytest-cov.readthedocs.io/en/latest/) inside the PyMCNP directory:
29+
To run the PyMCNP test suite, after cloning the PyMCNP GitHub
30+
repository, use the following commands to install
31+
[pytest](https://docs.pytest.org/en/stable/) with
32+
[pytest-cov](https://pytest-cov.readthedocs.io/en/latest/) inside the
33+
PyMCNP directory. This can be done automatically using the _test_
34+
dependency. By default coverage and testmon will be used with pytest.
3035

3136
# Installing
32-
pip install pytest-cov
3337
cd PyMCNP
38+
pip install -e .[test]
3439
python -m pytest
3540

3641
# Running
3742
pytest --cov --cov-report term-missing:skip-covered
3843

3944
## Documenting
4045

41-
To rebuild the documentation using [Sphinx](https://www.sphinx-doc.org/en/master/) and [Napolean](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html):
46+
To rebuild the documentation using
47+
[Sphinx](https://www.sphinx-doc.org/en/master/) and
48+
[Napolean](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html). This
49+
can be done automatically using the _doc_ dependency.
4250

4351
# Installing
44-
pip install sphinx
52+
pip install -e .[doc]
4553

4654
# Running
4755
cd docs

docs/source/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# PyMCNP Documentation
22

33
PyMCNP is a Python package and CLI for interfacing
4-
with [MCNP](https://mcnp.lanl.gov). PyMCNP parsers MCNP files,
4+
with [MCNP](https://mcnp.lanl.gov). PyMCNP parsers MCNP files,
55
visualizes simulation geometries, and runs MCNP simulations in parallel.
66

77
## Table of Contents
88

99
```{eval-rst}
1010
.. toctree::
1111
:maxdepth: 1
12-
12+
1313
cli
1414
pymcnp
1515

pyproject.toml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ dependencies = [
3333
"molmass",
3434
"numpy",
3535
"pandas",
36-
"pytest",
36+
"pyvista",
3737
"rich",
3838
"scipy",
39-
"pyvista",
4039
]
4140

4241
[project.optional-dependencies]
@@ -46,6 +45,19 @@ docs = [
4645
"sphinx_rtd_theme",
4746
]
4847

48+
dev = [
49+
"pre-commit",
50+
"ruff",
51+
]
52+
53+
test = [
54+
"pytest",
55+
"pytest-cov",
56+
"pytest-testmon",
57+
"PyQt5",
58+
]
59+
60+
4961
[project.urls]
5062
Documentation = "https://pymcnp.readthedocs.io/en/latest/"
5163
Homepage = "https://github.com/FSIBT/PyMCNP"
@@ -61,6 +73,12 @@ where = ["./src"]
6173
[tool.setuptools_scm]
6274
write_to = "./src/version.py"
6375

76+
[tool.pytest.ini_options]
77+
addopts = "--testmon --cov --cov-report=term-missing:skip-covered"
78+
testpaths = [
79+
"tests"
80+
]
81+
6482
[tool.ruff]
6583
line-length = 200
6684
lint.ignore = ["E741", "E742"]

0 commit comments

Comments
 (0)