Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run tests
run: |
pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ dist/
venv*
docs/.buildinfo
docs/.doctrees
_version.py
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,22 @@ pip install rtdpy
## Issues/Requests/Contributions
See [CONTRIBUTING.md](CONTRIBUTING.md)

## Testing
Tests are written using `pytest`. `numpy` and `scipy` must also be installed in the environment if using `pytest` directly. `tox` can also be used to test against Python versions 3.5, 3.6, and 3.7. See [pytest documentation](https://docs.pytest.org/en/latest/) for how to use and interpret pytest results.

## Development and Testing
It is recommended to use a virtual environment for developing/testing.

```bash
git clone https://github.com/Merck/rtdpy.git # or use your forked repo
cd rtdpy
python3 -m venv .venv
source .venv/bin/activate
pip install -e . # will also install numpy and scipy dependencies
pip install pytest tox
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e ".[dev]" # install package with dev dependencies

# run all tests
# run all tests with coverage
pytest

# run tests and style check for Python versions 3.5, 3.6, and 3.7, if available.
tox
```

Tests are written using `pytest` and configuration is in `pyproject.toml`. See [pytest documentation](https://docs.pytest.org/en/latest/) for more details.

Author: Matthew Flamm

Email: <matthew.flamm@merck.com>
106 changes: 106 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "rtdpy"
dynamic = ["version"]
description = "Python package for residence time distribution analysis"
readme = "README.md"
license = {text = "MIT"}
authors = [
{name = "Matthew Flamm", email = "matthew.flamm@merck.com"}
]
requires-python = ">=3.10"
dependencies = [
"numpy<1.24",
"scipy<1.14",
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering",
]

[project.urls]
Homepage = "https://merck.github.io/rtdpy"
Repository = "https://github.com/Merck/rtdpy"
Documentation = "https://merck.github.io/rtdpy"

[tool.setuptools_scm]
version_file = "rtdpy/_version.py"

[tool.setuptools.packages.find]
where = ["."]
include = ["rtdpy*"]

[project.optional-dependencies]
dev = [
"numpy==1.23.5",
"scipy==1.13.1",
"pytest>=7.0",
"pytest-cov>=4.0",
"ruff>=0.1.0",
]
docs = [
"sphinx",
"numpydoc>=1.0.0",
"matplotlib",
"ipython",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = [
"--cov=rtdpy",
"--cov-report=term-missing",
"--cov-report=html",
"--strict-markers",
]
markers = []

[tool.coverage.run]
source = ["rtdpy"]
omit = [
"*/tests/*",
"*/__init__.py",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.ruff]
line-length = 89
target-version = "py310"
exclude = [
".git",
".venv",
"venv",
"__pycache__",
"build",
"dist",
]

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
]
ignore = []

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Allow unused imports in __init__.py
7 changes: 0 additions & 7 deletions requirements_docs.txt

This file was deleted.

6 changes: 5 additions & 1 deletion rtdpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
from .ad_hi_peclet import AD_hi_peclet
from .convection import Convection
from .rtd import RTDInputError, RTD
from .version import __version__

try:
from ._version import __version__
except ImportError:
__version__ = "unknown"
2 changes: 0 additions & 2 deletions rtdpy/version.py

This file was deleted.

27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

21 changes: 0 additions & 21 deletions tox.ini

This file was deleted.