diff --git a/.travis.yml b/.travis.yml index b3d7081e7..562df31c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,9 @@ before_install: - conda info -a install: - - conda create --name icepyx-env --channel conda-forge python=3.10 proj geos + - conda create --name icepyx-env --channel conda-forge python=3.10 pip proj geos - source activate icepyx-env - - pip install -r requirements.txt -r requirements-dev.txt - - pip install -e .[complete] + - pip install -e .[dev,complete] stages: - name: basic tests diff --git a/MANIFEST.in b/MANIFEST.in index 957ccc9e2..df6813f58 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,4 +9,3 @@ exclude *.ini exclude *.txt exclude *.yaml exclude *.yml -include requirements.txt diff --git a/doc/source/contributing/how_to_contribute.rst b/doc/source/contributing/how_to_contribute.rst index 84c21717b..68bd3eb08 100644 --- a/doc/source/contributing/how_to_contribute.rst +++ b/doc/source/contributing/how_to_contribute.rst @@ -73,38 +73,39 @@ update your local copy of icepyx with to ensure you have the most up to date version of icepyx in your library. +Setting up a Development Work Environment +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If you are modifying portions of code, you will need to run - -.. code-block:: shell +You will need to install icepyx in editable mode, so that when we make changes, they will immediately be testable at runtime. +You will also need icepyx's dependencies and some dev tooling (for automated checks, tests, and documentaiton). - pip install -e. +To set this up, start in the root of your local copy of the icepyx repo. +Then, create a new environment using mamba (or conda, or a tool of your choice) and activate it. +Finally, install icepyx and needed dependencies in to it: -within your Python environment to use your real-time edited version of the code during runtime. +.. code-block:: shell + mamba create --name icepyx-dev pip + mamba activate icepyx-dev + pip install --editable .[dev,docs] -Setting up a Development Work Environment ------------------------------------------ +Setting up development tools +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -icepyx uses a few tools to ensure that files have consistent formatting and run tests. -You can easily install the ones most frequently used by creating a new mamba (or conda) -environment (from the home level of your local copy of the icepyx repo) with +One of the dev tools we just installed is called `pre-commit `_. +We have included a set of pre-commit formatting hooks that we strongly encourage all contributors to use. +Configure those hooks to automatically execute with: .. code-block:: shell - mamba env create --name icepyx-env --channel conda-forge -f requirements-dev.txt -f requirements.txt - -and then (1) running `pre-commit install` to let git know about pre-commit and -(2) pip installing icepyx as described above and below. + pre-commit install -One of the tools installed with "requirements-dev.txt" is called [pre-commit](https://pre-commit.com/). -We have included a set of pre-commit formatting hooks that we strongly encourage all contributors to use. -These hooks will check the files you are committing for format consistency, -reformatting the files if necessary. +These hooks will check the files you are committing for format consistency and reformat them if necessary. You can tell files were reformatted if you get a message showing one of the checks failed. -In this case, you will need to re-commit your changes until all pre-commit hooks pass -(i.e. a failed pre-commit check results in no git commit). -Pre-commit will also run on icepyx PRs using the pre-commit CI (continuous integration). +In this case, pre-commit has prevented the commit from completing. +You will need to re-add and the formatted files and try to commit again until all pre-commit hooks pass. + +pre-commit will also run on icepyx PRs using the pre-commit CI (continuous integration) service. As with other automations happening in PRs, you'll want to make sure you pull the changes back to your local version before making new commits. @@ -116,7 +117,7 @@ If you are working in Jupyter Notebook, in addition to manually installing your .. code-block:: shell - pip install -e. + pip install --editable .[dev,docs] you will need to dynamically reload icepyx within your notebook by executing diff --git a/pyproject.toml b/pyproject.toml index 4f4c0a88c..377f8374d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ license = {file = "LICENSE"} readme = "README.rst" requires-python = "~=3.7" -dynamic = ["version", "dependencies"] +dynamic = ["version"] authors = [ {name = "The icepyx Developers", email = "jbscheick@gmail.com"}, @@ -31,6 +31,49 @@ classifiers=[ "Topic :: Software Development :: Libraries", ] +dependencies = [ + "backoff", + "dask[dataframe]", + "datashader", + "earthaccess>=0.5.1", + "fiona", + "geopandas", + "h5netcdf", + "h5py", + "holoviews", + "hvplot", + "matplotlib", + "numpy", + "requests", + "s3fs", + "shapely", + "xarray", +] + +[project.optional-dependencies] +dev = [ + "pre-commit", + "pypistats", + "pytest>=4.6", + "pytest-cov", + "responses", +] +docs = [ + "gitpython", + "linkify-it-py", + "myst-nb", + "nbsphinx", + "numpydoc", + "pybtex", + "pygithub", + "sphinx>=4.3", + "sphinx-panels", + "sphinx_rtd_theme>=1.0", + "sphinxcontrib-bibtex", +] +viz = ["geoviews >= 1.9.0", "cartopy >= 0.18.0", "scipy"] +complete = ["icepyx[viz]"] + [project.urls] Homepage = "https://icepyx.readthedocs.io" Documentation = "https://icepyx.readthedocs.io" @@ -46,13 +89,6 @@ requires = ["setuptools>=66", "wheel", "setuptools_scm"] [tool.setuptools] py-modules = ["_icepyx_version"] -[tool.setuptools.dynamic] -dependencies = {file = ["requirements.txt"]} - -[project.optional-dependencies] -viz = ["geoviews >= 1.9.0", "cartopy >= 0.18.0", "scipy"] -complete = ["icepyx[viz]"] - [tool.setuptools.packages.find] exclude = ["*tests"] @@ -61,6 +97,8 @@ version_file = "_icepyx_version.py" version_file_template = 'version = "{version}"' local_scheme = "node-and-date" fallback_version = "unknown" + + # [tool.ruff.format] # docstring-code-format = true # docstring-code-line-length = "dynamic" diff --git a/readthedocs.yml b/readthedocs.yml index dba60979f..efe60b8a7 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -25,7 +25,7 @@ formats: all # Optionally declare the Python requirements required to build your docs python: install: - - requirements: requirements-docs.txt - - requirements: requirements.txt - method: pip path: . + extra_requirements: + - docs diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 66106dab8..000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,5 +0,0 @@ -pre-commit -pypistats -pytest>=4.6 -pytest-cov -responses diff --git a/requirements-docs.txt b/requirements-docs.txt deleted file mode 100644 index 51dc9ff5a..000000000 --- a/requirements-docs.txt +++ /dev/null @@ -1,11 +0,0 @@ -gitpython -linkify-it-py -myst-nb -nbsphinx -numpydoc -pybtex -pygithub -sphinx>=4.3 -sphinx-panels -sphinx_rtd_theme>=1.0 -sphinxcontrib-bibtex diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6a9659270..000000000 --- a/requirements.txt +++ /dev/null @@ -1,16 +0,0 @@ -backoff -dask[dataframe] -datashader -earthaccess>=0.5.1 -fiona -geopandas -h5netcdf -h5py -holoviews -hvplot -matplotlib -numpy -requests -s3fs -shapely -xarray