diff --git a/README.rst b/README.rst index 72f182a..9600584 100644 --- a/README.rst +++ b/README.rst @@ -75,15 +75,15 @@ Install from pypi:: pip install allantools -Latest version + examples, tests, test data, iPython notebooks : clone from github, then install :: +Latest version + examples, tests, test data, iPython notebooks : clone from github, then from the cloned repository install :: - python setup.py install + pip install . -(see `python setup.py --help install` for install options) +(see `pip install -h` for install options) These commands should be run as root for system-wide installation, or you can use the `--user` option to install for your account only. -Exact command names may vary depending on your OS / package manager / target python version. +Exact command names may vary depending on your OS / package manager / target python version. If command `pip` is not available or does not install the package in the expected python version, `python -m pip install .` is equivalent. Basic usage ----------- diff --git a/docs/dev.rst b/docs/dev.rst index 08fb0fa..184ffe3 100644 --- a/docs/dev.rst +++ b/docs/dev.rst @@ -25,10 +25,17 @@ Here follows an un-ordered to do list: Make sure your patch does not break any of the tests, and does not significantly reduce the readability of the code. + +Hatch environment +----------------- + +Current version of pyproject.toml supposes the use of `hatch` for developping the package. +Optional dependencies needed for development (e.g. `numpydoc`, `pytest`) are only installed if the `dev` environment is invoked, e.g. `hatch -e dev shell`. + Documentation generation ------------------------ -See /docs for documentation in sphinx format. On Ubuntu this requires -the **python-sphinx** and **python-numpydoc** packages. +See /docs for documentation in sphinx format. This requires +the **sphinx**, **sphinx-rtd-theme** and **numpydoc** packages (they should be installed automatically if you are using the `dev` environment from `hatch`, but can also be installed by your distribution manager if you prefer, e.g `apt install python3-sphinx sphinx-rtd-theme-common python3-numpydoc` on Ubuntu). html/pdf documentation using sphinx can be built locally with:: /docs$ make html @@ -55,6 +62,8 @@ reason are marked 'fails'. To run all tests:: $ py.test +You can also use `hatch test`. + To exclude known failing tests:: $ py.test -m "not fails" --durations=10 @@ -94,7 +103,7 @@ Creating a source distribution :: - python setup.py sdist + hatch build sdist This creates a package in dist/ Testing the source distribution. The install takes a long time while diff --git a/pyproject.toml b/pyproject.toml index b58b2de..7784507 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,9 +8,7 @@ version = "2024.06" dependencies = [ "numpy", "scipy>=1.6.0", - "numpydoc", "matplotlib", - "pytest", ] requires-python = ">=3.8" authors = [ @@ -34,7 +32,14 @@ exclude = [ "experimental/*", ] -[project.optional-dependencies] +[tool.hatch.envs.dev] +extra-dependencies = [ + "sphinx", + "sphinx-rtd-theme", + "numpydoc", + "pytest", + "coverage", +] [project.urls] Homepage = "https://github.com/aewallin/allantools"