diff --git a/.gitignore b/.gitignore index 157bfb1..c4ecfbb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ NOTES .cache .pytest_cache pytest.xml +poetry.lock diff --git a/README.rst b/README.rst index 197e7a4..0f9a4a1 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,7 @@ There are currently three different long-running branches: Installation and Requirements ============================= -PyDelta requires **Python 3.3 or newer**. It has quite a set of dependencies (NumPy, Pandas, SciPy, SciKit-Learn, …), but it comes with a setup script that installs it with its dependencies. +PyDelta requires **an up-to-date Python 3**. It has quite a set of dependencies (NumPy, Pandas, SciPy, SciKit-Learn, …) that are declared in its pyproject.toml. If you only wish to use it, not to hack on it, pip can clone and install it for you:: @@ -45,13 +45,14 @@ If you only wish to use it, not to hack on it, pip can clone and install it for (Note that the Python 3 version of pip is sometimes called ``pip3``). -Developers can clone the repo and run pip to install:: +Developers can clone the repo and use [Poetry](https://python-poetry.org/) to setup a virtual environment for development. git clone -b next https://github.com/cophi-wue/pydelta cd pydelta - pip install -r requirements.txt + poetry install + +Tests can be run using `pytest`. To build the documentation `cd docs && make html`. -You may need to install numpy, scipy, and Cython separately first. ---- diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a1bafb8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[tool.poetry] +name = "delta" +version = "2.1.0.dev1" +description = "Stylometry toolkit" +authors = [ + "Thorsten Vitt ", + "Fotis Jannidis " + ] +license = "GPL-3.0-or-later" +readme = "README.rst" + +[tool.poetry.dependencies] +python = ">=3.7.1,<3.10" +numpy = "^1.20.3" +pandas = "^1.2.4" +scipy = "^1.6.3" +matplotlib = "^3.4.2" +regex = "^2021.4.4" +scikit-learn = "^0.24.2" +scikit-learn-extra = "^0.2.0" +joblib = "^1.0.1" + +[tool.poetry.dev-dependencies] +pytest = "^6.2.4" +pytest-cov = "^2.12.1" +Sphinx = "^4.0.2" +ipykernel = "^5.5.5" +nbsphinx = "^0.8.6" + +[tool.pytest.ini_options] +addopts = "--doctest-modules --junit-xml pytest.xml" +nb_diff_ignore = "/cells/*/output" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 4bc2c6f..0000000 --- a/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ --e . - -Cython - -pytest -pytest-cov -Sphinx -ipykernel -nbsphinx diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a44ff3e..0000000 --- a/setup.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[nosetests] -with-doctest=1 -exe=1 -with-xunit=1 -with-xcoverage=true -cover-package=delta - -[tool:pytest] -addopts = --doctest-modules --junit-xml pytest.xml -nb_diff_ignore = /cells/*/output diff --git a/working-requirements.txt b/working-requirements.txt deleted file mode 100644 index 9efc660..0000000 --- a/working-requirements.txt +++ /dev/null @@ -1,26 +0,0 @@ -matplotlib==1.3.1 -numpy==1.8.1 -pandas==0.13.1 -profig==0.2.8 -scipy==0.14.0 -regex==2014.10.24 -## The following requirements were added by pip --freeze: -Jinja2==2.7.2 -MarkupSafe==0.21 -PySide==1.2.2 -Pygments==1.6 -Sphinx==1.2 -autopep8==1.0.1 -docutils==0.11 -ipython==2.0.0 -jedi==0.8.0-final0 -nose==1.3.3 -pep8==1.5.6 -pyflakes==0.8.1 -pyparsing==2.0.2 -python-dateutil==2.2 -pytz==2014.2 -pyzmq==14.2.0 -six==1.6.1 -sympy==0.7.5 -tornado==3.2.1