From 98970eb012771951d52b42696fa5f69aa39e6f6b Mon Sep 17 00:00:00 2001 From: Raphael Vallat Date: Sat, 21 Dec 2024 04:54:30 -0800 Subject: [PATCH] Modern python packaging + v0.1.8 (#38) * modern packaging * ruff check * add tests folder to coverage * update doc to v0.1.8 * remove test folder --- .github/workflows/black.yml | 10 -- .github/workflows/python_tests.yml | 15 ++- .github/workflows/ruff.yml | 13 ++ .gitignore | 1 + MANIFEST.in | 1 - README.rst | 9 ++ codecov.yml | 2 - docs/build/html/.buildinfo | 4 +- docs/build/html/_modules/antropy/entropy.html | 17 +-- docs/build/html/_modules/antropy/fractal.html | 15 +-- docs/build/html/_modules/index.html | 12 +- docs/build/html/_sources/changelog.rst.txt | 5 + docs/build/html/_sources/index.rst.txt | 9 ++ docs/build/html/_static/basic.css | 15 +-- docs/build/html/_static/copybutton.js | 4 +- docs/build/html/_static/doctools.js | 7 -- .../html/_static/documentation_options.js | 2 +- docs/build/html/_static/language_data.js | 7 -- docs/build/html/_static/searchtools.js | 38 ++++-- docs/build/html/api.html | 12 +- docs/build/html/changelog.html | 19 ++- .../html/generated/antropy.app_entropy.html | 12 +- .../antropy.detrended_fluctuation.html | 12 +- .../html/generated/antropy.higuchi_fd.html | 12 +- .../html/generated/antropy.hjorth_params.html | 12 +- .../build/html/generated/antropy.katz_fd.html | 12 +- .../generated/antropy.lziv_complexity.html | 12 +- .../html/generated/antropy.num_zerocross.html | 12 +- .../html/generated/antropy.perm_entropy.html | 12 +- .../html/generated/antropy.petrosian_fd.html | 12 +- .../generated/antropy.sample_entropy.html | 12 +- .../generated/antropy.spectral_entropy.html | 12 +- .../html/generated/antropy.svd_entropy.html | 12 +- docs/build/html/genindex.html | 12 +- docs/build/html/index.html | 19 ++- docs/build/html/objects.inv | 2 +- docs/build/html/searchindex.js | 2 +- docs/changelog.rst | 5 + docs/index.rst | 9 ++ pyproject.toml | 114 +++++++++++++++++- requirements-test.txt | 4 - requirements.txt | 5 - setup.cfg | 21 ---- setup.py | 80 ------------ {antropy => src/antropy}/__init__.py | 4 +- {antropy => src/antropy}/entropy.py | 5 +- {antropy => src/antropy}/fractal.py | 3 +- {antropy => src/antropy}/utils.py | 3 +- {antropy/tests => tests}/test_entropy.py | 18 +-- {antropy/tests => tests}/test_fractal.py | 9 +- {antropy/tests => tests}/utils.py | 0 51 files changed, 363 insertions(+), 313 deletions(-) delete mode 100644 .github/workflows/black.yml create mode 100644 .github/workflows/ruff.yml delete mode 100644 codecov.yml delete mode 100644 requirements-test.txt delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 setup.py rename {antropy => src/antropy}/__init__.py (80%) rename {antropy => src/antropy}/entropy.py (99%) rename {antropy => src/antropy}/fractal.py (99%) rename {antropy => src/antropy}/utils.py (99%) rename {antropy/tests => tests}/test_entropy.py (98%) rename {antropy/tests => tests}/test_fractal.py (93%) rename {antropy/tests => tests}/utils.py (100%) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index 98b2a66..0000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Lint - -on: [push, pull_request] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: psf/black@stable \ No newline at end of file diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 69b88f1..1c7c99b 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: platform: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] runs-on: ${{ matrix.platform }} @@ -30,10 +30,15 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-test.txt - pip install . + pip install ".[test]" - name: Test with pytest run: | - pytest --cov --verbose \ No newline at end of file + pytest --cov --cov-report=xml --verbose + + - name: Upload coverage report + if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == 3.9 }} + uses: codecov/codecov-action@v4 + with: + token: d5ef1de8-d1c4-4d89-b304-4d8fffdf9906 + file: ./coverage.xml \ No newline at end of file diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 0000000..6251dfa --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,13 @@ +name: Ruff +on: [push, pull_request] +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: "Linting" + uses: astral-sh/ruff-action@v1 + - name: "Formatting" + uses: astral-sh/ruff-action@v1 + with: + args: "format --check" diff --git a/.gitignore b/.gitignore index 8d62719..f8e5056 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,4 @@ desktop.ini docs/build/doctrees/ docs/generated/ .DS_Store +push_pypi.md diff --git a/MANIFEST.in b/MANIFEST.in index aa2485a..8543787 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ # Add README, LICENSE and requirements : include README.rst include LICENSE -include requirements.txt diff --git a/README.rst b/README.rst index bf94653..15d65eb 100644 --- a/README.rst +++ b/README.rst @@ -41,6 +41,15 @@ or conda conda config --set channel_priority strict conda install antropy +To build and install from source, clone this repository or download the source archive and decompress the files + +.. code-block:: shell + + cd antropy + pip install ".[test]" # install the package + pip install -e ".[test]" # or editable install + pytest + **Dependencies** - `numpy `_ diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 00e3f1f..0000000 --- a/codecov.yml +++ /dev/null @@ -1,2 +0,0 @@ -codecov: - token: d5ef1de8-d1c4-4d89-b304-4d8fffdf9906 diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo index 3d73440..9e3ae82 100644 --- a/docs/build/html/.buildinfo +++ b/docs/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 3a25f3b4fb97564eec51e3b795229bc5 +# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 7a843bd555ee874c00dbc710835f6133 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/build/html/_modules/antropy/entropy.html b/docs/build/html/_modules/antropy/entropy.html index 84e7b1d..43fd727 100644 --- a/docs/build/html/_modules/antropy/entropy.html +++ b/docs/build/html/_modules/antropy/entropy.html @@ -4,16 +4,16 @@ - antropy.entropy — antropy 0.1.7 documentation + antropy.entropy — antropy 0.1.8 documentation - - + + - + @@ -39,7 +39,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.app_entropy.html b/docs/build/html/generated/antropy.app_entropy.html index ec5e587..5838614 100644 --- a/docs/build/html/generated/antropy.app_entropy.html +++ b/docs/build/html/generated/antropy.app_entropy.html @@ -5,16 +5,16 @@ - antropy.app_entropy — antropy 0.1.7 documentation + antropy.app_entropy — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.detrended_fluctuation.html b/docs/build/html/generated/antropy.detrended_fluctuation.html index 6a70632..8903c85 100644 --- a/docs/build/html/generated/antropy.detrended_fluctuation.html +++ b/docs/build/html/generated/antropy.detrended_fluctuation.html @@ -5,16 +5,16 @@ - antropy.detrended_fluctuation — antropy 0.1.7 documentation + antropy.detrended_fluctuation — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.higuchi_fd.html b/docs/build/html/generated/antropy.higuchi_fd.html index f80b5fd..aa53323 100644 --- a/docs/build/html/generated/antropy.higuchi_fd.html +++ b/docs/build/html/generated/antropy.higuchi_fd.html @@ -5,16 +5,16 @@ - antropy.higuchi_fd — antropy 0.1.7 documentation + antropy.higuchi_fd — antropy 0.1.8 documentation - - + + - + @@ -40,7 +40,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.hjorth_params.html b/docs/build/html/generated/antropy.hjorth_params.html index 6a414dc..d72c8d7 100644 --- a/docs/build/html/generated/antropy.hjorth_params.html +++ b/docs/build/html/generated/antropy.hjorth_params.html @@ -5,16 +5,16 @@ - antropy.hjorth_params — antropy 0.1.7 documentation + antropy.hjorth_params — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.katz_fd.html b/docs/build/html/generated/antropy.katz_fd.html index 5e7b32a..42b97d3 100644 --- a/docs/build/html/generated/antropy.katz_fd.html +++ b/docs/build/html/generated/antropy.katz_fd.html @@ -5,16 +5,16 @@ - antropy.katz_fd — antropy 0.1.7 documentation + antropy.katz_fd — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.lziv_complexity.html b/docs/build/html/generated/antropy.lziv_complexity.html index b7db135..bbe1b9d 100644 --- a/docs/build/html/generated/antropy.lziv_complexity.html +++ b/docs/build/html/generated/antropy.lziv_complexity.html @@ -5,16 +5,16 @@ - antropy.lziv_complexity — antropy 0.1.7 documentation + antropy.lziv_complexity — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.num_zerocross.html b/docs/build/html/generated/antropy.num_zerocross.html index 29d4258..ef5a830 100644 --- a/docs/build/html/generated/antropy.num_zerocross.html +++ b/docs/build/html/generated/antropy.num_zerocross.html @@ -5,16 +5,16 @@ - antropy.num_zerocross — antropy 0.1.7 documentation + antropy.num_zerocross — antropy 0.1.8 documentation - - + + - + @@ -40,7 +40,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.perm_entropy.html b/docs/build/html/generated/antropy.perm_entropy.html index 5a3434c..01698ab 100644 --- a/docs/build/html/generated/antropy.perm_entropy.html +++ b/docs/build/html/generated/antropy.perm_entropy.html @@ -5,16 +5,16 @@ - antropy.perm_entropy — antropy 0.1.7 documentation + antropy.perm_entropy — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.petrosian_fd.html b/docs/build/html/generated/antropy.petrosian_fd.html index c865202..2702b83 100644 --- a/docs/build/html/generated/antropy.petrosian_fd.html +++ b/docs/build/html/generated/antropy.petrosian_fd.html @@ -5,16 +5,16 @@ - antropy.petrosian_fd — antropy 0.1.7 documentation + antropy.petrosian_fd — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.sample_entropy.html b/docs/build/html/generated/antropy.sample_entropy.html index 8eeae20..9dc1cfe 100644 --- a/docs/build/html/generated/antropy.sample_entropy.html +++ b/docs/build/html/generated/antropy.sample_entropy.html @@ -5,16 +5,16 @@ - antropy.sample_entropy — antropy 0.1.7 documentation + antropy.sample_entropy — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.spectral_entropy.html b/docs/build/html/generated/antropy.spectral_entropy.html index aecafdf..659ad33 100644 --- a/docs/build/html/generated/antropy.spectral_entropy.html +++ b/docs/build/html/generated/antropy.spectral_entropy.html @@ -5,16 +5,16 @@ - antropy.spectral_entropy — antropy 0.1.7 documentation + antropy.spectral_entropy — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/generated/antropy.svd_entropy.html b/docs/build/html/generated/antropy.svd_entropy.html index 0765317..2c4787e 100644 --- a/docs/build/html/generated/antropy.svd_entropy.html +++ b/docs/build/html/generated/antropy.svd_entropy.html @@ -5,16 +5,16 @@ - antropy.svd_entropy — antropy 0.1.7 documentation + antropy.svd_entropy — antropy 0.1.8 documentation - - + + - + @@ -41,7 +41,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 2a714b1..4c2eca8 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -4,16 +4,16 @@ - Index — antropy 0.1.7 documentation + Index — antropy 0.1.8 documentation - - + + - + @@ -39,7 +39,7 @@ antropy - 0.1.7 + 0.1.8 diff --git a/docs/build/html/index.html b/docs/build/html/index.html index 3abc62f..b889050 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -5,16 +5,16 @@ - Installation — antropy 0.1.7 documentation + Installation — antropy 0.1.8 documentation - - + + - + @@ -40,7 +40,7 @@ antropy - 0.1.7 + 0.1.8 +

To build and install from source, clone this repository or download the source archive and decompress the files

+
cd antropy
+pip install ".[test]"     # install the package
+pip install -e ".[test]"  # or editable install
+pytest
+
+

Dependencies