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

cleaner environment #30

Merged
merged 5 commits into from
Sep 13, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.11.0
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ build:
- sphinx-apidoc -o docs/apidoc --private --module-first xhydro

conda:
environment: environment-docs.yml
environment: environment-dev.yml
Copy link
Collaborator

@Zeitsperre Zeitsperre Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like I mentioned in person, there are a few ways of going about building the docs:

  1. We can install everything from the dev environment and evaluate notebooks (heavy on resources/memory, slower to build)
  2. We can mock the dependencies and install the library without any intention of running notebooks (faster, no gurantee that notebooks are running properly on RtD).
  3. We can do something fancier (like I developed in xclim).

Any of these approaches is fine. If we find that option 1 ends up being too slow, I can make something more custom resembling option 3 later...


python:
install:
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Internal changes
* Automated testing with tox now updated to use v4.0+ conventions.
* Removed all references to travis.ci.
* Deployments to TestPyPI and PyPI are now run using GitHub Workflow Environments as a safeguarding mechanism. (:pull:`28`).
* Various cleanups of the environment files. (:issue:`23`, :pull:`30`).

0.1.2 (2023-05-10)
------------------
Expand Down
4 changes: 1 addition & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst
include requirements_dev.txt
include requirements_docs.txt
include .zenodo.json

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
Expand All @@ -22,5 +20,5 @@ exclude .readthedocs.yml
exclude .yamllint.yaml
exclude Makefile
exclude environment.yml
exclude environment-docs.yml
exclude environment-dev.yml
exclude tox.ini
32 changes: 32 additions & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: xhydro-dev
channels:
- conda-forge
dependencies:
- python >=3.9,<3.11
# Don't forget to sync the changes here with environment.yml!
# Main packages
# Dev
- bump2version
- coveralls
- furo
- ipykernel
- ipython
- jupyter_client
- nbsphinx
- nbval
- pandoc
- pooch
- pre-commit
- pytest
- pytest-cov
- sphinx
- sphinx-autoapi
- sphinxcontrib-napoleon
- sphinx-codeautolink
- sphinx-copybutton
- pip
# Testing
- tox >=4.0
# Packaging
- build
- wheel
14 changes: 0 additions & 14 deletions environment-docs.yml

This file was deleted.

34 changes: 1 addition & 33 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,4 @@ name: xhydro
channels:
- conda-forge
dependencies:
- python >=3.10,<3.11
- IPyKernel
- bottleneck >=1.3.1
- cartopy
- cftime >=1.4.1
- cf_xarray >=0.6.1
- dask >=2.6
- furo
- geopandas
- geoviews
- h5netcdf
- hvplot
- intake
- intake-geopandas
- intake-xarray >=0.6.1
- jsonpickle
- matplotlib-base
- nbsphinx
- netCDF4
- numba
- numpy >=1.16.0
- pymannkendall
- rioxarray
- s3fs >=2022.7.0
- scipy >=1.2
- sphinx
- sphinx-autoapi
- sphinx-codeautolink
- sphinx-copybutton
- sphinxcontrib-napoleon
- xarray >=0.17.0
- xclim >=0.43.0
- zarr >=2.11.1
- python >=3.9,<3.11
16 changes: 0 additions & 16 deletions requirements_dev.txt

This file was deleted.

10 changes: 0 additions & 10 deletions requirements_docs.txt

This file was deleted.

35 changes: 2 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,9 @@
with open("README.rst") as readme_file:
readme = readme_file.read()

requirements = [
"bottleneck>=1.3.1",
"cartopy",
"cf-xarray>=0.6.1",
"cftime>=1.4.1",
"dask[array]>=2.6",
"geopandas",
"h5netcdf",
"intake-xarray>=0.6.1",
"jsonpickle",
"numba",
"numpy>=1.16.0",
"pandas>=0.23",
"pint>=0.10",
"pyarrow",
"pyyaml",
"s3fs>=2022.7.0",
"scipy>=1.2",
"xarray>=0.17.0",
"xclim>=0.43.0",
"zarr>=2.11.1",
]
requirements = []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RondeauG and I spoke about this earlier. As we start adding content to xhydro, we should progressvely add requirements here. That way it doesn`t take so long to install/test in the early stages.


test_requirements = ["pytest>=3"]

docs_requirements = [
dependency for dependency in open("requirements_docs.txt").readlines()
]

dev_requirements = [
dependency for dependency in open("requirements_dev.txt").readlines()
]
dev_requirements = ["pytest", "pytest-cov"]

setup(
author="Thomas-Charles Fortier Filion",
Expand Down Expand Up @@ -69,9 +40,7 @@
name="xhydro",
packages=find_packages(include=["xhydro", "xhydro.*"]),
test_suite="tests",
tests_require=test_requirements,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is deprecated and the pytest and setuptools maintainers suggest against using it. Good call.

More info: https://docs.pytest.org/en/latest/explanation/goodpractices.html#do-not-run-via-setuptools

extras_require={
"docs": docs_requirements,
"dev": dev_requirements,
},
url="https://github.com/TC-FF/xhydro",
Expand Down