You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switch to Poetry for dependency management and package description (#356)
* Add poetry configuration file and update project dependencies
* Update package description and patch version.
* Remove requirements.txt, setup.py, and MANIFEST.in.
* Update GH workflows. Set test Python version matrix to 3.7, 3.8, 3.9.
* Add instructions for developing with Poetry and downloading dependencies
Copy file name to clipboardExpand all lines: README.md
+31-5Lines changed: 31 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,30 +21,56 @@ See the [demo.ipynb](https://github.com/MIT-LCP/wfdb-python/blob/master/demo.ipy
21
21
22
22
## Installation
23
23
24
-
The distribution is hosted on pypi at: <https://pypi.python.org/pypi/wfdb/>. To directly install the package from pypi, run from your terminal::
24
+
The distribution is hosted on PyPI at: <https://pypi.python.org/pypi/wfdb/>. The package can be directly installed from PyPI using either pip or poetry:
25
25
26
26
```sh
27
27
pip install wfdb
28
+
poetry add wfdb
28
29
```
29
30
30
31
The development version is hosted at: <https://github.com/MIT-LCP/wfdb-python>. This repository also contains demo scripts and example data. To install the development version, clone or download the repository, navigate to the base directory, and run:
31
32
32
33
```sh
34
+
# Without dev dependencies
33
35
pip install .
34
-
```
36
+
poetry install
35
37
36
-
## Development
38
+
# With dev dependencies
39
+
pip install ".[dev]"
40
+
poetry install -E dev
41
+
```
37
42
38
-
The package is to be expanded with physiological signal-processing tools, and general improvements. Development is made for Python 3.6+ only.
43
+
See the [note](#package-management) below about dev dependencies.
39
44
40
-
## Contributing
45
+
## Developing
41
46
42
47
We welcome community contributions in the form of pull requests. When contributing code, please ensure:
43
48
44
49
-[PEP8](https://www.python.org/dev/peps/pep-0008/) style guidelines are followed.
45
50
- Documentation is provided. New functions and classes should have numpy/scipy style [docstrings](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt).
46
51
- Unit tests are written for new features that are not covered by [existing tests](https://github.com/MIT-LCP/wfdb-python/tree/master/tests).
47
52
53
+
### Package Management
54
+
55
+
This project uses [poetry](https://python-poetry.org/docs/) for package management and distribution.
56
+
57
+
Development dependencies are specified as optional dependencies, and then added to the "dev" extra group in the [pyproject.toml](./pyproject.toml) file.
58
+
59
+
```sh
60
+
# Do NOT use: poetry add <somepackage> --dev
61
+
poetry add --optional <somepackage>
62
+
```
63
+
64
+
The `[tool.poetry.dev-dependencies]` attribute is NOT used because of a [limitation](https://github.com/python-poetry/poetry/issues/3514) that prevents these dependencies from being pip installable. Therefore, dev dependencies are not installed when purely running `poetry install`, and the `--no-dev` flag has no meaning in this project.
65
+
66
+
Make sure the versions in [version.py](./wfdb/version.py) and [pyproject.toml](./pyproject.toml) are kept in sync.
67
+
68
+
To upload a new distribution to PyPI:
69
+
70
+
```sh
71
+
poetry publish
72
+
```
73
+
48
74
## Citing
49
75
50
76
When using this resource, please cite the software [publication](https://physionet.org/content/wfdb-python/) oh PhysioNet.
0 commit comments