Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move dependencies from requirements files into pyproject.toml, add extra groups for dev, docs #565

Open
wants to merge 7 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ exclude *.ini
exclude *.txt
exclude *.yaml
exclude *.yml
include requirements.txt
45 changes: 23 additions & 22 deletions doc/source/contributing/how_to_contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://pre-commit.com/>`_.
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.

Expand All @@ -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

Expand Down
54 changes: 46 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = {file = "LICENSE"}
readme = "README.rst"

requires-python = "~=3.7"
mfisher87 marked this conversation as resolved.
Show resolved Hide resolved
dynamic = ["version", "dependencies"]
dynamic = ["version"]

authors = [
{name = "The icepyx Developers", email = "[email protected]"},
Expand All @@ -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"
Expand All @@ -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"]

Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

11 changes: 0 additions & 11 deletions requirements-docs.txt

This file was deleted.

16 changes: 0 additions & 16 deletions requirements.txt

This file was deleted.

Loading