From 14e68a6897b65c3c242bafe23aac07ef2cfce029 Mon Sep 17 00:00:00 2001 From: Maxime Liquet <35924738+maximlt@users.noreply.github.com> Date: Tue, 26 Mar 2024 01:10:26 +0100 Subject: [PATCH] Migrate to pyproject.toml (#1296) --- .flake8 | 7 ++ .git_archival.txt | 4 + .gitattributes | 5 + .github/workflows/build.yaml | 78 ++++--------- .github/workflows/docs.yaml | 37 +++---- .github/workflows/test.yaml | 45 ++++---- .gitignore | 9 +- .pre-commit-config.yaml | 9 ++ MANIFEST.in | 9 -- conda.recipe/meta.yaml | 54 ++++++--- doc/conf.py | 5 + doc/conftest.py | 7 ++ doc/developer_guide/index.md | 183 ++++++++++++++++++------------- doc/developer_guide/testing.md | 118 -------------------- dodo.py | 15 --- envs/py3.10-tests.yaml | 70 ++++++++++++ envs/py3.11-docs.yaml | 60 ++++++++++ envs/py3.11-tests.yaml | 70 ++++++++++++ envs/py3.12-tests.yaml | 70 ++++++++++++ envs/py3.8-tests.yaml | 70 ++++++++++++ envs/py3.9-tests.yaml | 70 ++++++++++++ hvplot/__init__.py | 38 ++++++- pyproject.toml | 171 ++++++++++++++++++++++++++++- scripts/update_conda_envs.py | 25 +++++ setup.cfg | 8 -- setup.py | 194 --------------------------------- tox.ini | 59 ---------- 27 files changed, 891 insertions(+), 599 deletions(-) create mode 100644 .flake8 create mode 100644 .git_archival.txt create mode 100644 .gitattributes delete mode 100644 MANIFEST.in delete mode 100644 doc/developer_guide/testing.md delete mode 100644 dodo.py create mode 100644 envs/py3.10-tests.yaml create mode 100644 envs/py3.11-docs.yaml create mode 100644 envs/py3.11-tests.yaml create mode 100644 envs/py3.12-tests.yaml create mode 100644 envs/py3.8-tests.yaml create mode 100644 envs/py3.9-tests.yaml create mode 100644 scripts/update_conda_envs.py delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100644 tox.ini diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..fad4e3bdd --- /dev/null +++ b/.flake8 @@ -0,0 +1,7 @@ +[flake8] +include = *.py +# run_tests.py is generated by conda build, which appears to have a +# bug resulting in code being duplicated a couple of times. +exclude = .git,__pycache__,.tox,.eggs,*.egg,doc,dist,build,_build,.ipynb_checkpoints,run_test.py +ignore = E, + W diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 000000000..8fb235d70 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..4f9ccb6ac --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# For setuptools_scm with .git_archival.txt +.git_archival.txt export-subst +# Line Endings configuration file for Git +# Set the default behavior, in case people don't have or can't have core.autocrlf set. +* text=auto diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 38f567926..6c15c999f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,6 +11,9 @@ on: schedule: - cron: '0 15 * * SUN' +env: + PYTHON_VERSION: "3.11" + jobs: conda_build: name: Build Conda Packages @@ -19,43 +22,29 @@ jobs: run: shell: bash -l {0} env: - CHANS_DEV: "-c pyviz/label/dev -c bokeh" - PKG_TEST_PYTHON: "--test-python=py38" - PYTHON_VERSION: "3.8" - CHANS: "-c pyviz" MPLBACKEND: "Agg" - CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: "100" - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} - name: Fetch unshallow run: git fetch --prune --tags --unshallow -f + - uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + python-version: ${{ env.PYTHON_VERSION }} + auto-update-conda: true - name: Set output id: vars run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: conda setup - run: | - conda config --set always_yes True - conda install -c pyviz "pyctdev>=0.5" - doit ecosystem_setup - # See: https://github.com/holoviz/panel/pull/4979 - conda install -c conda-forge "urllib3<2.0.0" "conda-build==3.24" + run: conda install anaconda-client conda-build setuptools_scm - name: conda build - run: doit package_build $CHANS_DEV $PKG_TEST_PYTHON --test-group=unit + run: VERSION=`python -m setuptools_scm` conda build conda.recipe/ - name: conda dev upload if: (github.event_name == 'push' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc'))) - run: doit package_upload --token=$CONDA_UPLOAD_TOKEN --label=dev + run: anaconda --token ${{ secrets.CONDA_UPLOAD_TOKEN }} upload --user pyviz --label=dev $(VERSION=`python -m setuptools_scm` conda build --output conda.recipe) - name: conda main upload if: (github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc'))) - run: doit package_upload --token=$CONDA_UPLOAD_TOKEN --label=dev --label=main + run: anaconda --token ${{ secrets.CONDA_UPLOAD_TOKEN }} upload --user pyviz --label=dev --label=main $(VERSION=`python -m setuptools_scm` conda build --output conda.recipe) pip_build: name: Build PyPI Packages runs-on: 'ubuntu-latest' @@ -63,43 +52,24 @@ jobs: run: shell: bash -l {0} env: - CHANS_DEV: "-c pyviz/label/dev -c bokeh" - PKG_TEST_PYTHON: "--test-python=py38" - PYTHON_VERSION: "3.9" - CHANS: "-c pyviz" MPLBACKEND: "Agg" - PPU: ${{ secrets.PPU }} - PPP: ${{ secrets.PPP }} - PYPI: "https://upload.pypi.org/legacy/" steps: - uses: actions/checkout@v4 - with: - fetch-depth: "100" - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - name: Fetch unshallow run: git fetch --prune --tags --unshallow -f - - name: conda setup - run: | - conda config --set always_yes True - conda install -c pyviz "pyctdev>=0.5" - doit ecosystem_setup - doit env_create $CHANS_DEV --python=$PYTHON_VERSION + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} - name: env setup run: | - conda activate test-environment - doit develop_install $CHANS_DEV -o tests_core - doit pip_on_conda + python -m pip install --upgrade pip setuptools + python -m pip install build - name: pip build - run: | - conda activate test-environment - doit ecosystem=pip package_build --test-group=simple - - name: pip upload + run: python -m build + - name: Publish package to PyPI if: github.event_name == 'push' - run: | - conda activate test-environment - doit ecosystem=pip package_upload -u $PPU -p $PPP -r $PYPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: ${{ secrets.PPU }} + password: ${{ secrets.PPP }} + packages-dir: dist/ diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index a10220385..636086041 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -20,6 +20,9 @@ on: schedule: - cron: '0 15 * * SUN' +env: + PYTHON_VERSION: "3.11" + jobs: conda_build_docs: name: Documentation:conda @@ -34,35 +37,29 @@ jobs: MOZ_HEADLESS: 1 DISPLAY: ":99.0" steps: - - uses: holoviz-dev/holoviz_tasks/install@v0.1a19 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: conda-incubator/setup-miniconda@v3 with: - name: Documentation - python-version: "3.11" - channels: pyviz,conda-forge,nodefaults - envs: "-o doc -o examples -o geo -o graphviz" - cache: true - conda-update: true + auto-update-conda: true + environment-file: envs/py${{ env.PYTHON_VERSION }}-docs.yaml + activate-environment: hvplotdocs - name: Set and echo git ref id: vars run: | echo "Deploying from ref ${GITHUB_REF#refs/*/}" echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: bokeh sampledata - run: | - conda activate test-environment - bokeh sampledata + run: bokeh sampledata - name: install dev nbsite - run: | - conda activate test-environment - pip install --pre -U nbsite + run: pip install --pre -U nbsite + - name: conda info + run: conda info - name: conda list - run: | - conda activate test-environment - conda list + run: conda list - name: build docs - run: | - conda activate test-environment - sphinx-build -b html doc builtdocs + run: sphinx-build -b html doc builtdocs - name: report failure if: failure() run: cat /tmp/sphinx-*.log | tail -n 100 @@ -106,7 +103,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ env.PYTHON_VERSION }} - name: install run: pip install ."[doc, examples, geo]" - name: install dev nbsite diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 17cb84c2d..190c78d23 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -90,25 +90,26 @@ jobs: run: shell: bash -el {0} steps: - - uses: holoviz-dev/holoviz_tasks/install@v0.1a19 + - uses: actions/checkout@v4 with: - name: unit_test_suite - python-version: ${{ matrix.python-version }} - channel-priority: strict - channels: pyviz/label/dev,conda-forge,nodefaults - envs: "-o examples_tests -o tests -o geo -o graphviz" - cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - conda-update: true - id: install - - name: doit test_unit - run: | - conda activate test-environment - doit test_unit - - name: test examples - run: | - conda activate test-environment - bokeh sampledata - doit test_examples + fetch-depth: 0 + - uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + environment-file: envs/py${{ matrix.python-version }}-tests.yaml + activate-environment: hvplottests + - name: conda info + run: conda info + - name: conda list + run: conda list + - name: bokeh sampledata + run: bokeh sampledata + - name: unit tests + run: pytest -v hvplot --cov=hvplot --cov-append + - name: unit tests geo + run: pytest -v hvplot --geo --cov=hvplot --cov-append + - name: examples tests + run: pytest -n auto --dist loadscope --nbval-lax -p no:python pip_test: name: pip tests:${{ matrix.os }}:${{ matrix.python-version }} needs: [pre_commit, setup] @@ -127,19 +128,23 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: upgrade pip / setuptools + run: pip install -U pip setuptools - name: install without geo # Because cartopy cannot be installed on Python 3.8 on these platforms if: matrix.python-version == '3.8' && contains(fromJSON('["ubuntu-latest", "windows-latest"]'), matrix.os) - run: pip install ."[tests, examples_tests, hvdev]" + run: pip install -ve '.[tests, examples-tests, hvdev]' - name: install with geo if: matrix.python-version != '3.8' || !contains(fromJSON('["ubuntu-latest", "windows-latest"]'), matrix.os) - run: pip install ."[tests, examples_tests, geo, hvdev, hvdev_geo]" + run: pip install -ve '.[tests, examples-tests, geo, hvdev, hvdev-geo]' - name: pip list run: pip list - name: bokeh sampledata run: bokeh sampledata - name: unit tests run: pytest -v hvplot --cov=hvplot --cov-append + - name: unit tests geo + run: pytest -v hvplot --geo --cov=hvplot --cov-append - name: examples tests run: pytest -n auto --dist loadscope --nbval-lax -p no:python - name: codecov diff --git a/.gitignore b/.gitignore index b35fd7dec..f7693f5e1 100644 --- a/.gitignore +++ b/.gitignore @@ -117,12 +117,6 @@ jupyter_execute/ # pip pip-wheel-metadata/ -# autover -hvplot/.version - -# doit -.doit.db - # IDE /.vscode @@ -131,3 +125,6 @@ hvplot/.version # Examples artefacts doc/user_guide/plot.html + +# setuptools_scm +hvplot/_version.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c67b177d..ae94d5e5e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,3 +36,12 @@ repos: exclude: (\.min\.js$|\.svg$|\.html$) additional_dependencies: - tomli +- repo: local + hooks: + - id: update_conda_envs + name: Update conda envs + entry: python scripts/update_conda_envs.py + language: python + additional_dependencies: [pyproject2conda] + files: '(pyproject.toml|update_conda_envs)' + pass_filenames: false diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index dcd9a4bc8..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,9 +0,0 @@ -include README.rst -include LICENSE -include hvplot/.version -include hvplot/tests/test_data/*.tif -include hvplot/datasets.yaml -include hvplot/data/crime.csv -global-exclude *.py[co] -global-exclude *~ -global-exclude *.ipynb_checkpoints/* diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index ad84047d9..f90b50a94 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -1,34 +1,56 @@ -{% set sdata = load_setup_py_data() %} +{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %} +{% set buildsystem = pyproject['build-system'] %} +{% set project = pyproject['project'] %} + +{% set name = project['name'] %} +{% set version = VERSION %} package: - name: hvplot - version: {{ sdata['version'] }} + name: {{ name|lower }} + version: {{ version }} source: path: .. build: noarch: python - script: python setup.py install --single-version-externally-managed --record=record.txt - -extra: - channels: - - pyviz - - intake + script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation requirements: build: - - python {{ sdata['python_requires'] }} - {% for dep in sdata['extras_require']['build'] %} + - python {{ project['requires-python'] }} + - pip + {% for dep in buildsystem['requires'] %} - {{ dep }} {% endfor %} run: - - python {{ sdata['python_requires'] }} - {% for dep in sdata.get('install_requires',{}) %} + - python {{ project['requires-python'] }} + {% for dep in project['dependencies'] %} + - {{ dep }} + {% endfor %} + +test: + requires: + - pip + {% for dep in project['optional-dependencies']['tests-core'] %} + {% if dep == 'dask[dataframe]' %} + - dask + {% else %} - {{ dep }} + {% endif %} {% endfor %} + source_files: + - pyproject.toml + imports: + - hvplot + - hvplot.pandas + commands: + - python -c "import hvplot; ver = hvplot.__version__; assert ver != '0.0.0' and ver != 'unknown'" + - pip check + - pytest hvplot about: - home: {{ sdata['url'] }} - summary: {{ sdata['description'] }} - license: {{ sdata['license'] }} + home: {{ project['urls']['Homepage'] }} + summary: {{ project['description'] }} + license: {{ project['license']['text'] }} + license_file: LICENSE diff --git a/doc/conf.py b/doc/conf.py index 3a257b649..ffc95cc94 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -114,6 +114,8 @@ 'reference/pandas/step': 'reference/tabular/step', 'reference/pandas/table': 'reference/tabular/table', 'reference/pandas/violin': 'reference/tabular/violin', + # Removal of the developer testing page + 'developer_guide/testing': 'developer_guide/index', } html_context.update({ @@ -122,3 +124,6 @@ "github_repo": "panel", "default_mode": "light", }) + + +nb_execution_mode = "off" diff --git a/doc/conftest.py b/doc/conftest.py index c02a1438d..9edae241c 100644 --- a/doc/conftest.py +++ b/doc/conftest.py @@ -26,6 +26,13 @@ "user_guide/Integrations.ipynb", ] +try: + import ibis +except ModuleNotFoundError: + collect_ignore_glob += [ + "user_guide/Integrations.ipynb", + ] + try: webdriver_control.create() except RuntimeError: diff --git a/doc/developer_guide/index.md b/doc/developer_guide/index.md index 2aaacb2c5..a7d2dd4ff 100644 --- a/doc/developer_guide/index.md +++ b/doc/developer_guide/index.md @@ -1,48 +1,45 @@ (devguide-setup)= -# Getting Set Up +# Developer Guide + +```{contents} +:depth: 3 +:local: true +``` + +## Set up The hvPlot library is a complex project which provides a wide range of data interfaces and an extensible set of plotting backends, which means the development and testing process involves a wide set of libraries. -```{contents} -:depth: 2 -:local: true -``` - -% dev_guide_preliminaries: +If you have any problems with the steps here, please contact the developers on [Discord](https://discord.gg/AXRHnJU6sP). -## Preliminaries +### Preliminaries -### Git +#### Git -The hvPlot source code is stored in a [Git] source control repository. +The hvPlot source code is stored in a [Git](https://git-scm.com) source control repository. The first step to working on hvPlot is to install Git on to your system. There are different ways to do this depending on whether, you are using Windows, OSX, or Linux. -To install Git on any platform, refer to the [Installing Git] section of -the [Pro Git Book]. +To install Git on any platform, refer to the [Installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) section of +the [Pro Git Book](https://git-scm.com/book/en/v2). -### Conda +#### Conda (optional) -Developing hvPlot requires a wide range of packages that are not -easily and quickly available using pip. To make this more manageable, -core developers rely heavily on the [conda package manager] for the -free [Anaconda] Python distribution. However, `conda` can also -install non-Python package dependencies, which helps streamline hvPlot -development greatly. It is *strongly* recommended that anyone -developing hvPlot also use `conda`, and the remainder of the -instructions will assume that `conda` is available. +Developing hvPlot requires a wide range of dependencies that can all be installed with +the [conda package manager](https://conda.io). Using `conda` is sometimes the easiest way to install +a dependency (e.g. `graphviz`, Firefox drivers). However, these days most of the dependencies +required to develop hvPlot can be installed with `pip`. -To install Conda on any platform, see the [Download conda] section of the -[conda documentation]. +Follow [these instructions](https://conda.io/projects/conda/user-guide/install/index.html) to download conda. -## Cloning the Repository +### Cloning the Repository -The source code for the hvPlot project is hosted on [GitHub]. To clone the +The source code for the hvPlot project is hosted on GitHub. To clone the source repository, issue the following command: ```sh @@ -55,49 +52,52 @@ checkout* for the remainder of this document. (dev-guide-installing-dependencies)= -## Installing Dependencies +### Installing Dependencies hvPlot requires many additional packages for development and testing. -### Conda Environments +::::{tab-set} -Create an empty conda environment with the name that you prefer, here we've -chosen hvplot_dev. Activate and configure its channels to only use -`pyviz/label/dev` and `conda-forge`. The former is used to install the -development versions of the other HoloViz packages, such as HoloViews or Panel. +:::{tab-item} pip + +Start by creating a virtual environment with `venv`: -```sh -conda create -n hvplot_dev -conda activate hvplot_dev -conda config --env --append channels pyviz/label/dev --append channels conda-forge -conda config --env --remove channels defaults ``` +python -m venv .venv +``` + +Activate it: -Since hvPlot interfaces with a large range of different libraries the -full test suite requires a wide range of dependencies. To make it -easier to install and run different parts of the test suite across -different platforms hvPlot uses a library called `pyctdev` to make things -more consistent and general. Specify also the desired Python version you want -to base your environment on. +``` +# Linux/MacOs +source .venv/bin/activate +# Windows +.venv\Scripts\activate +``` -You will need to pick a Python version. The best practice is to choose the minimum version -currently supported by hvPlot on the main development branch. If you cannot get the minimum -version installed, then try with a more recent version of Python. +Install the test dependencies: -```sh -conda install python=3.x pyctdev +``` bash +pip install -e '.[tests, examples-tests, geo, hvdev, hvdev-geo]' ``` -Finally to install the dependencies required to run the full unit test -suite and all the examples: +::: -```sh -doit develop_install -o examples_tests -o tests -o examples_conda +:::{tab-item} conda + +Create a development conda environment using one of the environment files present +in the `./envs` folder, and activate it: + +``` bash +conda env create --file envs/py3.10-tests.yaml +conda activate hvplottests ``` -Add `-o doc` if you want to install the dependencies required to build -the website. +::: + +:::: + ### Setting up pre-commit @@ -110,32 +110,67 @@ pre-commit install This will ensure that every time you make a commit linting will automatically be applied. -(devguide-python-setup)= -## Commands +## Testing + +This chapter describes how to run various tests locally in a +development environment, guidelines for writing tests, and information +regarding the continuous testing infrastructure. -You can list the available `doit` commands with `doit list`. +### Running Tests Locally -## Next Steps +Before attempting to run hvPlot tests, make sure you have successfully +run through all of the instructions in the {ref}`devguide-setup` +section of the Developer's Guide. -If you have any problems with the steps here, please [contact the developers]. +Currently hvPlot uses linting two types of tests: regular unit tests +which are run with `pytest` and notebook example tests run with `pytest` and `nbval`: -```{toctree} -:hidden: true -:maxdepth: 2 -:titlesonly: true +Run the unit tests with: -Getting Set up -Testing +```bash +pytest hvplot +pytest -v hvplot --geo # include the test that require geo dependencies +``` + +Run the example tests with: + +```sh +pytest -n auto --dist loadscope --nbval-lax -p no:python ``` -[anaconda]: https://anaconda.com/downloads -[conda documentation]: https://conda.io/docs/index.html -[conda package manager]: https://conda.io/docs/intro.html -[contact the developers]: https://gitter.im/pyviz/pyviz -[doit]: https://pydoit.org/ -[download conda]: https://conda.io/docs/download.html -[git]: https://git-scm.com -[github]: https://github.com -[installing git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git -[pro git book]: https://git-scm.com/book/en/v2 +### Writing Tests + +In order to help keep hvPlot maintainable, all Pull Requests that touch +code should normally be accompanied by relevant tests. While +exceptions may be made for specific circumstances, the default +assumption should be that a Pull Request without tests may not be +merged. + +Python unit tests maintain the basic functionality of the Python +portion of the hvPlot library. A few general guidelines will help you +write Python unit tests: + +In order to ensure that hvPlot's unit tests as relocatable and unambiguous +as possible, always prefer absolute imports in test files. When convenient, +import and use the entire module under test: + +- **Good**: `import hvplot.pandas` +- **Good**: `from hvplot.plotting import HvPlotTabular` +- **Bad**: `from ..plotting import HvPlotTabular` + +### Continuous Integration (CI) + +Every push to the `main` branch or any Pull Request branch on GitHub +automatically triggers a full test build on the [Github Action](https://github.com/holoviz/hvplot/actions) continuous +integration service. This is most often useful for running the full hvPlot +test suite continuously, but also triggers automated scripts for publishing +releases when a tagged branch is pushed. + +When in doubt about what command to run, you can always inspect the Github +workflow files in the `./github/workflows` folder so see what commands +are running on the CI. + +Github Action provides a limited number free build workers to Open Source projects. +Please be considerate of others and group commits into meaningful chunks of +work before pushing to GitHub (i.e. don't push on every commit). diff --git a/doc/developer_guide/testing.md b/doc/developer_guide/testing.md deleted file mode 100644 index 366a7e739..000000000 --- a/doc/developer_guide/testing.md +++ /dev/null @@ -1,118 +0,0 @@ -(devguide-testing)= - -# Testing - -This chapter describes how to run various tests locally in a -development environment, guidelines for writing tests, and information -regarding the continuous testing infrastructure. - -```{contents} -:depth: 2 -:local: true -``` - -## Running Tests Locally - -Before attempting to run hvPlot tests, make sure you have successfully -run through all of the instructions in the {ref}`devguide-setup` -section of the Developer's Guide. - -### Test Selection - -Currently hvPlot uses linting and two types of tests: regular unit tests -which are run with nose and notebook example tests run with nbsmoke: - -To run flake checking use: - -```sh -doit test_flakes -``` - -To run unit tests use: - -```sh -doit test_unit -``` - -To run example smoke tests use: - -```sh -doit test_examples -``` - -### Integration tests - -## Writing Tests - -In order to help keep hvPlot maintainable, all Pull Requests that touch -code should normally be accompanied by relevant tests. While -exceptions may be made for specific circumstances, the default -assumption should be that a Pull Request without tests may not be -merged. - -### Python Unit Tests - -Python unit tests maintain the basic functionality of the Python -portion of the hvPlot library. A few general guidelines will help you -write Python unit tests: - -absolute imports - -: In order to ensure that hvPlot's unit tests as relocatable and unambiguous - as possible, always prefer absolute imports in test files. When convenient, - import and use the entire module under test: - - - **GOOD**: `import hvplot.pandas` - - **GOOD**: `from hvplot.plotting import HvPlotTabular` - - **BAD**: `from ..plotting import HvPlotTabular` - -## Continuous Integration - -Every push to the `main` branch or any Pull Request branch on GitHub -automatically triggers a full test build on the [TravisCI] continuous -integration service. This is most often useful for running the full hvPlot -test suite continuously, but also triggers automated scripts for publishing -releases when a tagged branch is pushed. - -You can see the list of all current and previous builds at this URL: - - -### Configuration - -There are a number of files that affect the build configuration: - -- `.travis.yml` - : Defines the build matrix and global configurations for the stages - described below. -- `conda.recipe/meta.yaml` - : Instructions for building a conda noarch package for hvPlot. -- `setup.py` - : Used to build sdist packages and "dev" installs. This file is the - single source of truth of all dependencies. -- `tox.ini` - : Contains the configuration for the doit commands . - -### Etiquette - -TravisCI provides five free build workers to Open Source projects. A few -considerations will help you be considerate of others needing these limited -resources: - -- Group commits into meaningful chunks of work before pushing to GitHub (i.e. - don't push on every commit). - -- If you must make multiple commits in succession, navigate to TravisCI and - cancel all but the last build, in order to free up build workers. - -- If expensive `examples` tests are not needed (e.g. for a docs-only Pull - Request), they may be disabled by adding the text - - ```none - [ci disable examples] - ``` - - to your commit message. - -[contact the developers]: https://gitter.im/pyviz/pyviz -[pytest]: https://docs.pytest.org -[travisci]: https://travis-ci.org/ diff --git a/dodo.py b/dodo.py deleted file mode 100644 index b68ffd1e3..000000000 --- a/dodo.py +++ /dev/null @@ -1,15 +0,0 @@ -import os -if "PYCTDEV_ECOSYSTEM" not in os.environ: - os.environ["PYCTDEV_ECOSYSTEM"] = "conda" - -from pyctdev import * # noqa: api - - -def task_pip_on_conda(): - """Experimental: provide pip build env via conda""" - return {'actions':[ - # some ecosystem=pip build tools must be installed with conda when using conda... - 'conda install -y pip twine wheel rfc3986 keyring', - # ..and some are only available via conda-forge - 'conda install -y -c conda-forge tox virtualenv', - ]} diff --git a/envs/py3.10-tests.yaml b/envs/py3.10-tests.yaml new file mode 100644 index 000000000..78b592c3c --- /dev/null +++ b/envs/py3.10-tests.yaml @@ -0,0 +1,70 @@ +# +# This file is autogenerated by pyproject2conda +# with the following command: +# +# $ pyproject2conda project --overwrite force --template-python envs/py{py_version}-{env} +# +# You should not manually edit this file. +# Instead edit the corresponding pyproject.toml file. +# +name: hvplottests +channels: + - nodefaults + - pyviz/label/dev + - conda-forge +dependencies: + - python=3.10 + - bokeh>=1.0.0 + - cartopy + - codecov + - colorcet>=2 + - dask + - dask>=2021.3.0 + - datashader>=0.6.5 + - fiona + - flake8 + - fugue + - geopandas + - geoviews-core>=1.9.0 + - holoviews>=1.11.0 + - ibis-duckdb + - intake-parquet>=0.2.3 + - intake-xarray>=0.5.0 + - intake<2.0.0,>=0.6.5 + - ipywidgets + - matplotlib + - nbval + - networkx>=2.6.3 + - notebook>=5.4 + - numba>=0.51.0 + - numpy>=1.15 + - packaging + - pandas + - panel>=0.11.0 + - param<3.0,>=1.12.0 + - parameterized + - pillow>=8.2.0 + - plotly + - polars + - pooch + - pooch>=1.6.0 + - pre-commit + - pygraphviz + - pyproj + - pytest + - pytest-cov + - pytest-xdist + - rasterio + - rioxarray + - s3fs>=2022.1.0 + - scikit-image>=0.17.2 + - scipy + - scipy>=1.5.3 + - selenium>=3.141.0 + - spatialpandas>=0.4.3 + - streamz>=0.3.0 + - xarray + - xarray>=0.18.2 + - pip + - pip: + - -e .. diff --git a/envs/py3.11-docs.yaml b/envs/py3.11-docs.yaml new file mode 100644 index 000000000..c6669c170 --- /dev/null +++ b/envs/py3.11-docs.yaml @@ -0,0 +1,60 @@ +# +# This file is autogenerated by pyproject2conda +# with the following command: +# +# $ pyproject2conda project --overwrite force --template-python envs/py{py_version}-{env} +# +# You should not manually edit this file. +# Instead edit the corresponding pyproject.toml file. +# +name: hvplotdocs +channels: + - nodefaults + - pyviz/label/dev + - conda-forge +dependencies: + - python=3.11 + - bokeh>=1.0.0 + - cartopy + - colorcet>=2 + - dask>=2021.3.0 + - datashader>=0.6.5 + - fiona + - fugue + - geopandas + - geoviews-core>=1.9.0 + - holoviews>=1.11.0 + - ibis-duckdb + - intake-parquet>=0.2.3 + - intake-xarray>=0.5.0 + - intake<2.0.0,>=0.6.5 + - ipywidgets + - matplotlib + - nbsite>=0.8.4 + - networkx>=2.6.3 + - notebook>=5.4 + - numba>=0.51.0 + - numpy>=1.15 + - packaging + - pandas + - panel>=0.11.0 + - param<3.0,>=1.12.0 + - pillow>=8.2.0 + - plotly + - polars + - pooch>=1.6.0 + - pygraphviz + - pyproj + - rasterio + - rioxarray + - s3fs>=2022.1.0 + - scikit-image>=0.17.2 + - scipy>=1.5.3 + - selenium>=3.141.0 + - spatialpandas>=0.4.3 + - sphinxext-rediraffe + - streamz>=0.3.0 + - xarray>=0.18.2 + - pip + - pip: + - -e .. diff --git a/envs/py3.11-tests.yaml b/envs/py3.11-tests.yaml new file mode 100644 index 000000000..041e0f801 --- /dev/null +++ b/envs/py3.11-tests.yaml @@ -0,0 +1,70 @@ +# +# This file is autogenerated by pyproject2conda +# with the following command: +# +# $ pyproject2conda project --overwrite force --template-python envs/py{py_version}-{env} +# +# You should not manually edit this file. +# Instead edit the corresponding pyproject.toml file. +# +name: hvplottests +channels: + - nodefaults + - pyviz/label/dev + - conda-forge +dependencies: + - python=3.11 + - bokeh>=1.0.0 + - cartopy + - codecov + - colorcet>=2 + - dask + - dask>=2021.3.0 + - datashader>=0.6.5 + - fiona + - flake8 + - fugue + - geopandas + - geoviews-core>=1.9.0 + - holoviews>=1.11.0 + - ibis-duckdb + - intake-parquet>=0.2.3 + - intake-xarray>=0.5.0 + - intake<2.0.0,>=0.6.5 + - ipywidgets + - matplotlib + - nbval + - networkx>=2.6.3 + - notebook>=5.4 + - numba>=0.51.0 + - numpy>=1.15 + - packaging + - pandas + - panel>=0.11.0 + - param<3.0,>=1.12.0 + - parameterized + - pillow>=8.2.0 + - plotly + - polars + - pooch + - pooch>=1.6.0 + - pre-commit + - pygraphviz + - pyproj + - pytest + - pytest-cov + - pytest-xdist + - rasterio + - rioxarray + - s3fs>=2022.1.0 + - scikit-image>=0.17.2 + - scipy + - scipy>=1.5.3 + - selenium>=3.141.0 + - spatialpandas>=0.4.3 + - streamz>=0.3.0 + - xarray + - xarray>=0.18.2 + - pip + - pip: + - -e .. diff --git a/envs/py3.12-tests.yaml b/envs/py3.12-tests.yaml new file mode 100644 index 000000000..f7cd43692 --- /dev/null +++ b/envs/py3.12-tests.yaml @@ -0,0 +1,70 @@ +# +# This file is autogenerated by pyproject2conda +# with the following command: +# +# $ pyproject2conda project --overwrite force --template-python envs/py{py_version}-{env} +# +# You should not manually edit this file. +# Instead edit the corresponding pyproject.toml file. +# +name: hvplottests +channels: + - nodefaults + - pyviz/label/dev + - conda-forge +dependencies: + - python=3.12 + - bokeh>=1.0.0 + - cartopy + - codecov + - colorcet>=2 + - dask + - dask>=2021.3.0 + - datashader>=0.6.5 + - fiona + - flake8 + - fugue + - geopandas + - geoviews-core>=1.9.0 + - holoviews>=1.11.0 + - ibis-duckdb + - intake-parquet>=0.2.3 + - intake-xarray>=0.5.0 + - intake<2.0.0,>=0.6.5 + - ipywidgets + - matplotlib + - nbval + - networkx>=2.6.3 + - notebook>=5.4 + - numba>=0.51.0 + - numpy>=1.15 + - packaging + - pandas + - panel>=0.11.0 + - param<3.0,>=1.12.0 + - parameterized + - pillow>=8.2.0 + - plotly + - polars + - pooch + - pooch>=1.6.0 + - pre-commit + - pygraphviz + - pyproj + - pytest + - pytest-cov + - pytest-xdist + - rasterio + - rioxarray + - s3fs>=2022.1.0 + - scikit-image>=0.17.2 + - scipy + - scipy>=1.5.3 + - selenium>=3.141.0 + - spatialpandas>=0.4.3 + - streamz>=0.3.0 + - xarray + - xarray>=0.18.2 + - pip + - pip: + - -e .. diff --git a/envs/py3.8-tests.yaml b/envs/py3.8-tests.yaml new file mode 100644 index 000000000..0533acf30 --- /dev/null +++ b/envs/py3.8-tests.yaml @@ -0,0 +1,70 @@ +# +# This file is autogenerated by pyproject2conda +# with the following command: +# +# $ pyproject2conda project --overwrite force --template-python envs/py{py_version}-{env} +# +# You should not manually edit this file. +# Instead edit the corresponding pyproject.toml file. +# +name: hvplottests +channels: + - nodefaults + - pyviz/label/dev + - conda-forge +dependencies: + - python=3.8 + - bokeh>=1.0.0 + - cartopy + - codecov + - colorcet>=2 + - dask + - dask>=2021.3.0 + - datashader>=0.6.5 + - fiona + - flake8 + - fugue + - geopandas + - geoviews-core>=1.9.0 + - holoviews>=1.11.0 + - ibis-duckdb + - intake-parquet>=0.2.3 + - intake-xarray>=0.5.0 + - intake<2.0.0,>=0.6.5 + - ipywidgets + - matplotlib + - nbval + - networkx>=2.6.3 + - notebook>=5.4 + - numba>=0.51.0 + - numpy>=1.15 + - packaging + - pandas + - panel>=0.11.0 + - param<3.0,>=1.12.0 + - parameterized + - pillow>=8.2.0 + - plotly + - polars + - pooch + - pooch>=1.6.0 + - pre-commit + - pygraphviz + - pyproj + - pytest + - pytest-cov + - pytest-xdist + - rasterio + - rioxarray + - s3fs>=2022.1.0 + - scikit-image>=0.17.2 + - scipy + - scipy>=1.5.3 + - selenium>=3.141.0 + - spatialpandas>=0.4.3 + - streamz>=0.3.0 + - xarray + - xarray>=0.18.2 + - pip + - pip: + - -e .. diff --git a/envs/py3.9-tests.yaml b/envs/py3.9-tests.yaml new file mode 100644 index 000000000..e532e920e --- /dev/null +++ b/envs/py3.9-tests.yaml @@ -0,0 +1,70 @@ +# +# This file is autogenerated by pyproject2conda +# with the following command: +# +# $ pyproject2conda project --overwrite force --template-python envs/py{py_version}-{env} +# +# You should not manually edit this file. +# Instead edit the corresponding pyproject.toml file. +# +name: hvplottests +channels: + - nodefaults + - pyviz/label/dev + - conda-forge +dependencies: + - python=3.9 + - bokeh>=1.0.0 + - cartopy + - codecov + - colorcet>=2 + - dask + - dask>=2021.3.0 + - datashader>=0.6.5 + - fiona + - flake8 + - fugue + - geopandas + - geoviews-core>=1.9.0 + - holoviews>=1.11.0 + - ibis-duckdb + - intake-parquet>=0.2.3 + - intake-xarray>=0.5.0 + - intake<2.0.0,>=0.6.5 + - ipywidgets + - matplotlib + - nbval + - networkx>=2.6.3 + - notebook>=5.4 + - numba>=0.51.0 + - numpy>=1.15 + - packaging + - pandas + - panel>=0.11.0 + - param<3.0,>=1.12.0 + - parameterized + - pillow>=8.2.0 + - plotly + - polars + - pooch + - pooch>=1.6.0 + - pre-commit + - pygraphviz + - pyproj + - pytest + - pytest-cov + - pytest-xdist + - rasterio + - rioxarray + - s3fs>=2022.1.0 + - scikit-image>=0.17.2 + - scipy + - scipy>=1.5.3 + - selenium>=3.141.0 + - spatialpandas>=0.4.3 + - streamz>=0.3.0 + - xarray + - xarray>=0.18.2 + - pip + - pip: + - -e .. diff --git a/hvplot/__init__.py b/hvplot/__init__.py index 0eb3d875e..87d2a8abc 100644 --- a/hvplot/__init__.py +++ b/hvplot/__init__.py @@ -58,9 +58,9 @@ To report issues go to https://github.com/holoviz/holoviews. """ import inspect +import os import textwrap -import param import panel as _pn import holoviews as _hv @@ -74,8 +74,40 @@ andrews_curves, lag_plot, parallel_coordinates, scatter_matrix, plot) -__version__ = str(param.version.Version(fpath=__file__, archive_commit="$Format:%h$", - reponame="hvplot")) +# Define '__version__' +try: + # For performance reasons on imports, avoid importing setuptools_scm + # if not in a .git folder + if os.path.exists(os.path.join(os.path.dirname(__file__), "..", ".git")): + # If setuptools_scm is installed (e.g. in a development environment with + # an editable install), then use it to determine the version dynamically. + from setuptools_scm import get_version + + # This will fail with LookupError if the package is not installed in + # editable mode or if Git is not installed. + __version__ = get_version(root="..", relative_to=__file__) + else: + raise FileNotFoundError +except (ImportError, LookupError, FileNotFoundError): + # As a fallback, use the version that is hard-coded in the file. + try: + # __version__ was added in _version in setuptools-scm 7.0.0, we rely on + # the hopefully stable version variable. + from ._version import version as __version__ + except (ModuleNotFoundError, ImportError): + # Either _version doesn't exist (ModuleNotFoundError) or version isn't + # in _version (ImportError). ModuleNotFoundError is a subclass of + # ImportError, let's be explicit anyway. + + # Try something else: + from importlib.metadata import version as mversion, PackageNotFoundError + + try: + __version__ = mversion("hvplot") + except PackageNotFoundError: + # The user is probably trying to run this without having installed + # the package. + __version__ = "0.0.0+unknown" _METHOD_DOCS = {} diff --git a/pyproject.toml b/pyproject.toml index f8583e874..13d3e0b97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,157 @@ [build-system] requires = [ - "param >=1.7.0", - "pyct >=0.4.4", - "setuptools >=30.3.0" + "setuptools >=30.3.0", + "setuptools_scm >=6", ] +build-backend = "setuptools.build_meta" +[project] +name = "hvplot" +dynamic = ["version"] +description = "A high-level plotting API for the PyData ecosystem built on HoloViews." +readme = "README.md" +license = { text = "BSD" } +requires-python = ">=3.8" +authors = [ + { name = "Philipp Rudiger", email = "developers@holoviz.org" }, +] +maintainers = [ + { name = "HoloViz developers", email = "developers@holoviz.org" }, +] +classifiers = [ + "License :: OSI Approved :: BSD License", + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: OS Independent", + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Natural Language :: English", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries", +] +dependencies = [ + "bokeh >=1.0.0", + "colorcet >=2", + "holoviews >=1.11.0", + "numpy >=1.15", + "packaging", + "pandas", + "panel >=0.11.0", + "param >=1.12.0,<3.0", +] + +[project.entry-points."pandas_plotting_backends"] +holoviews = "hvplot:plotting" + +[project.urls] +Homepage = "https://hvplot.holoviz.org" +Source = "http://github.com/holoviz/hvplot" +HoloViz = "https://holoviz.org/" + +[project.optional-dependencies] +tests-core = [ + "codecov", + "dask[dataframe]", + "flake8", + "ipywidgets", + "matplotlib", + "parameterized", + "plotly", + "pooch", + "pre-commit", + "pytest-cov", + "pytest", + "scipy", + "xarray", +] +# Optional tests dependencies, i.e. one should be able +# to run and pass the test suite without installing any +# of those. +tests = [ + "hvplot[tests-core]", + "fugue", + "ibis-framework[duckdb]", # ibis-duckdb on conda + "polars", +] +geo = [ + "cartopy", + "fiona", + "geopandas", + "geoviews >=1.9.0", + "pyproj", + "rasterio", + "rioxarray", + "spatialpandas >=0.4.3", +] +# graphviz is difficult to install with pip, ok with conda. +graphviz = [ + "pygraphviz", +] +# Dependencies required to run the notebooks +examples = [ + "dask[dataframe] >=2021.3.0", + "datashader >=0.6.5", + "fugue", + "ibis-framework[duckdb]", # ibis-duckdb on conda + "intake-parquet >=0.2.3", + "intake-xarray >=0.5.0", + "intake >=0.6.5,<2.0.0", + "ipywidgets", + "networkx >=2.6.3", + "matplotlib", + "notebook >=5.4", + "numba >=0.51.0", + "pillow >=8.2.0", + "plotly", + "polars", + "pooch >=1.6.0", + "s3fs >=2022.1.0", + "scikit-image >=0.17.2", + "scipy >=1.5.3", + "selenium >=3.141.0", + "streamz >=0.3.0", + "xarray >=0.18.2", +] +tests-nb = [ + "pytest-xdist", + "nbval", +] +# Run the example tests by installing examples_tests together with tests +examples-tests = [ + "hvplot[examples]", + "hvplot[tests-nb]", +] +# Additional packages required to build the docs +doc = [ + "hvplot[examples]", + "nbsite >=0.8.4", + "sphinxext-rediraffe", +] +# Trick to let pip know we want to install dev dependencies +hvdev = [ + "colorcet >=0.0.1a1", + "datashader >=0.0.1a1", + "holoviews >=0.0.1a1", + "panel >=0.0.1a1", + "param >=0.0.1a1", + "pyviz_comms >=0.0.1a1", +] +hvdev-geo = [ + "geoviews >=0.0.1a1", +] + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +include = ["hvplot"] + +[tool.setuptools_scm] +version_file = "hvplot/_version.py" [tool.pytest.ini_options] addopts = "-v --pyargs" @@ -30,3 +177,21 @@ filterwarnings = [ ignore-words-list = "ser" skip = "doc/generate_modules.py" write-changes = true + +[tool.pyproject2conda.dependencies] +geoviews = { skip = true, packages = "geoviews-core >=1.9.0" } +# It should be ibis-framework[duckdb], but it works anyway. +ibis-framework = { skip = true, packages = "ibis-duckdb" } + +[tool.pyproject2conda.envs."tests"] +channels = ["nodefaults", "pyviz/label/dev", "conda-forge"] +python = ["3.8", "3.9", "3.10", "3.11", "3.12"] +extras = ["tests", "examples-tests", "geo", "graphviz"] +name = "hvplottests" +# reqs = ["-e .."] # Doesn't work + +[tool.pyproject2conda.envs."docs"] +channels = ["nodefaults", "pyviz/label/dev", "conda-forge"] +python = ["3.11"] +extras = ["doc", "examples", "geo", "graphviz"] +name = "hvplotdocs" diff --git a/scripts/update_conda_envs.py b/scripts/update_conda_envs.py new file mode 100644 index 000000000..3dc2d4749 --- /dev/null +++ b/scripts/update_conda_envs.py @@ -0,0 +1,25 @@ +import subprocess +from pathlib import Path + +def main(): + subprocess.run([ + "pyproject2conda", + "project", + "--overwrite", + "force", + "--template-python", + str(Path('envs', 'py{py_version}-{env}')), + ], + check=True, + ) + + # Hacky way to install the package in editable mode when creating the env. + for file in Path('envs').glob('*.yaml'): + with open(file, 'a', encoding='utf-8') as f: + f.write(' - pip\n') + f.write(' - pip:\n') + f.write(' - -e ..\n') + + +if __name__ == "__main__": + main() diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 00806d7a0..000000000 --- a/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[metadata] -license_file = LICENSE - -; The mapping can be removed when Numba support python 3.11 -[tool:pyctdev.conda] -namespace_map = - geoviews=geoviews-core - ibis-framework[duckdb]=ibis-duckdb diff --git a/setup.py b/setup.py deleted file mode 100644 index 330639e92..000000000 --- a/setup.py +++ /dev/null @@ -1,194 +0,0 @@ -import json -import os -import sys -import shutil - -from setuptools import setup, find_packages - -import pyct.build - -def get_setup_version(reponame): - """ - Helper to get the current version from either git describe or the - .version file (if available). - """ - basepath = os.path.split(__file__)[0] - version_file_path = os.path.join(basepath, reponame, '.version') - try: - from param import version - except: - version = None - if version is not None: - return version.Version.setup_version(basepath, reponame, archive_commit="$Format:%h$") - else: - print("WARNING: param>=1.6.0 unavailable. If you are installing a package, this warning can safely be ignored. If you are creating a package or otherwise operating in a git repository, you should install param>=1.6.0.") - return json.load(open(version_file_path))['version_string'] - - -########## dependencies ########## - -install_requires = [ - 'bokeh >=1.0.0', - 'colorcet >=2', - 'holoviews >=1.11.0', - 'pandas', - 'numpy >=1.15', - 'packaging', - 'panel >=0.11.0', - 'param >=1.12.0,<3.0', -] - -extras_require = {} - -# Tests packages required to run the examples tests -extras_require['tests_nb'] = [ - 'pytest-xdist', - 'nbval', -] - -# Test requirements -extras_require['tests_core'] = [ - 'codecov', - 'flake8', - 'pre-commit', - 'parameterized', - 'pytest', - 'pytest-cov', - 'matplotlib', - 'plotly', - 'xarray', - 'pooch', - 'scipy', - 'ipywidgets', - 'dask[dataframe]', -] - -# Optional tests dependencies, i.e. one should be able -# to run and pass the test suite without installing any -# of those. -extras_require['tests'] = extras_require['tests_core'] + [ - 'polars', - 'fugue', - 'ibis-framework', # ibis-duckdb on conda -] - -extras_require['geo'] = [ - 'cartopy', - 'fiona', - 'geopandas', - 'geoviews >=1.9.0', - 'pyproj', - 'rasterio', - 'rioxarray', - 'spatialpandas >=0.4.3', -] - -# graphviz is difficult to install with pip, ok with conda. -extras_require['graphviz'] = [ - 'pygraphviz', -] - -# Dependencies required to run the notebooks -extras_require['examples'] = [ - 'xarray >=0.18.2', - 'networkx >=2.6.3', - 'streamz >=0.3.0', - 'intake >=0.6.5,<2.0.0', - 'intake-parquet >=0.2.3', - 'intake-xarray >=0.5.0', - 'dask[dataframe] >=2021.3.0', - 'notebook >=5.4', - 's3fs >=2022.1.0', - 'scipy >=1.5.3', - 'pillow >=8.2.0', - 'selenium >=3.141.0', - 'scikit-image >=0.17.2', - 'pooch >=1.6.0', - 'matplotlib', - 'plotly', - 'ipywidgets', - 'numba >=0.51.0', - 'datashader >=0.6.5', - 'polars', - 'fugue', - 'ibis-framework[duckdb]', # ibis-duckdb on conda -] - -# Run the example tests by installing examples_tests together with tests -extras_require["examples_tests"] = extras_require["examples"] + extras_require['tests_nb'] - -# Additional packages required to build the docs -extras_require['doc'] = extras_require['examples'] + [ - 'nbsite >=0.8.4', - 'sphinxext-rediraffe', -] - -extras_require['hvdev'] = [ - 'panel >=0.0.1a1', - 'param >=0.0.1a1', - 'holoviews >=0.0.1a1', - 'datashader >=0.0.1a1', - 'colorcet >=0.0.1a1', - 'pyviz_comms >=0.0.1a1', -] - -extras_require['hvdev_geo'] = [ - 'geoviews >=0.0.1a1', -] - -# until pyproject.toml/equivalent is widely supported (setup_requires -# doesn't work well with pip) -extras_require['build'] = [ - 'param >=1.7.0', - 'pyct >=0.4.4', - 'setuptools >=30.3.0' # should make this pip now -] - -extras_require['all'] = sorted(set(sum(extras_require.values(), []))) - -########## metadata for setuptools ########## - -setup_args = dict( - name='hvplot', - version=get_setup_version("hvplot"), - description='A high-level plotting API for the PyData ecosystem built on HoloViews.', - long_description=open("README.md", encoding="utf-8").read(), - long_description_content_type="text/markdown", - author= "Philipp Rudiger", - author_email= "developers@pyviz.org", - maintainer="HoloViz developers", - maintainer_email="developers@pyviz.org", - packages=find_packages(), - include_package_data=True, - platforms=['Windows', 'Mac OS X', 'Linux'], - license='BSD', - url='https://hvplot.holoviz.org', - classifiers = [ - "License :: OSI Approved :: BSD License", - "Development Status :: 5 - Production/Stable", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Operating System :: OS Independent", - "Intended Audience :: Science/Research", - "Intended Audience :: Developers", - "Natural Language :: English", - "Topic :: Scientific/Engineering", - "Topic :: Software Development :: Libraries"], - python_requires=">=3.8", - install_requires=install_requires, - extras_require=extras_require, - tests_require=extras_require['tests'], - entry_points={ - 'console_scripts': [], - 'pandas_plotting_backends': [ - 'holoviews = hvplot:plotting', - ], - }, -) - - -if __name__ == '__main__': - setup(**setup_args) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 08991e69a..000000000 --- a/tox.ini +++ /dev/null @@ -1,59 +0,0 @@ -# For use with pyct (https://github.com/pyviz/pyct), but just standard -# tox config (works with tox alone). - -[tox] -# python version test group extra envs extra commands -envlist = {py38,py39,py310,py311,py312}-{simple,unit,examples,all}-{default}-{dev,pkg} - -[_simple] -description = Run simple tests -deps = .[tests] -commands = pytest -v hvplot - - -[_unit] -description = Run unit tests with coverage -deps = .[tests] -commands = pytest -v hvplot --cov=./hvplot --cov-append - pytest -v hvplot --geo --cov=./hvplot --cov-append - -[_examples] -description = Test that default examples run -deps = .[examples_tests, tests] -commands = pytest -n auto --dist loadscope --nbval-lax -p no:python - -[_all] -description = Run all tests -deps = .[examples_tests, tests] -commands = {[_unit]commands} - {[_examples]commands} - -[_pkg] -commands = bokeh sampledata - -[testenv] -# geoviews dependency cartopy and test dependency iris cannot be -# installed by pip alone, so provide access to site-packages and do -# not install deps with pip. -sitepackages = True -install_command = pip install --no-deps {opts} {packages} - -changedir = {envtmpdir} - -commands = examples-pkg: {[_pkg]commands} - simple: {[_simple]commands} - unit: {[_unit]commands} - examples: {[_examples]commands} - all: {[_all]commands} - -deps = unit: {[_unit]deps} - examples: {[_examples]deps} - all: {[_all]deps} - -[flake8] -include = *.py -# run_tests.py is generated by conda build, which appears to have a -# bug resulting in code being duplicated a couple of times. -exclude = .git,__pycache__,.tox,.eggs,*.egg,doc,dist,build,_build,.ipynb_checkpoints,run_test.py -ignore = E, - W