Skip to content

Commit

Permalink
Merge pull request #1114 from Ouranosinc/fix_setup_recipe
Browse files Browse the repository at this point in the history
Fix upstream installation recipe for PyPI-compliance
  • Loading branch information
Zeitsperre authored Jun 20, 2022
2 parents d64a525 + 2491a48 commit f88f2d2
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ on:
- master
paths-ignore:
- HISTORY.rst
- Makefile
- MANIFEST.in
- requirements_upstream.txt
- setup.cfg
- setup.py
- tox.ini
- xclim/__init__.py
- docs/**.ipynb
- docs/*.py
- docs/*.rst
- .github/**.yml
- .pre-commit-config.yaml

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ on:
- master
paths-ignore:
- HISTORY.rst
- Makefile
- MANIFEST.in
- requirements_upstream.txt
- setup.cfg
- setup.py
- tox.ini
- xclim/__init__.py
- docs/**.ipynb
- docs/**.py
- docs/**.rst
- .github/**.yml
- .pre-commit-config.yaml
schedule:
Expand Down
3 changes: 2 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ New features and enhancements
* Improved percentile based indicators metadata with the window, threshold and climatology period used to compute percentiles. (:issue:`1047`, :pull:`1050`).
* New ``xclim.core.calendar.construct_offset``, the inverse operation of ``parse_offset``. (:pull:`1090`).
* Rechunking operations in ``xclim.indices.run_length.rle`` are now synchronized with dask's options. (:pull:`1090`).
* A convenience recipe for installing key development branches of some dependencies has been added (`$ pip install xclim[upstream]`). (:issue:`1088`, :pull:`1092`).
* A mention of the "missing" checks and options is added to the history attribute of indicators, where appropriate. (:issue:`1100`, :pull:`1103`).

Breaking changes
Expand Down Expand Up @@ -53,6 +52,8 @@ Internal changes
* Test coverage statistic no longer includes coverage of the test files themselves. Coverage now reflects lines of usable code covered. (:pull:`1101`).
* Reordered listed authors alphabetically. Promoted :user:`bzah` to core contributor. (:pull:`1105`).
* Tests have been added for some functions in `xclim.testing.utils.py`; some previously uncaught bugs in ``list_input_variables``, ``publish_release_notes``, and ``show_versions`` have been patched. (:issue:`1078`, :pull:`1107`).
* A convenience command for installing xclim with key development branches of some dependencies has been added (`$ make upstream`). (:issue:`1088`, :pull:`1092`; amended in :issue:`1113`, :pull:`1114`).
- This build configuration is also available in `tox` for local development purposes (`$ tox -e pyXX-upstream`).

Bug fixes
^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include HISTORY.rst
include LICENSE
include README.rst
include requirements_dev.txt
include requirements_upstream.txt

recursive-include xclim *.txt *.json *.yml *.py
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ install: clean ## install the package to the active Python's site-packages

develop: clean ## install the package and development dependencies in editable mode to the active Python's site-packages
python -m pip install --no-user --editable ".[dev]"

upstream: clean develop ## install the GitHub-based development branches of dependencies in editable mode to the active Python's site-packages
python -m pip install --no-user --requirement requirements_upstream.txt
6 changes: 4 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ For convenience, these libraries can be installed alongside `xclim` using the fo

.. code-block::
$ pip install -e ".[upstream]"
$ pip install -r requirements_upstream.txt
# Or, alternatively:
$ make upstream
.. _flox: https://github.com/dcherian/flox
.. _clisops: https://github.com/roocs/clisops
Expand Down Expand Up @@ -93,4 +95,4 @@ To create a conda development environment including all xclim dependencies, ente
$ conda create -n my_xclim_env python=3.8 --file=environment.yml
$ conda activate my_xclim_env
(my_xclim_env) $ pip install .[dev]
(my_xclim_env) $ pip install ".[dev]"
4 changes: 4 additions & 0 deletions requirements_upstream.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
git+https://github.com/pydata/bottleneck.git@master#egg=bottleneck
git+https://github.com/Unidata/cftime.git@master#egg=cftime
git+https://github.com/dcherian/flox.git@main#egg=flox
git+https://github.com/pydata/xarray.git@main#egg=xarray
10 changes: 1 addition & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@
for dependency in dev.readlines():
dev_requirements.append(dependency)

upstream_requirements = [
"wheel",
"bottleneck @ git+https://github.com/pydata/bottleneck.git@master#egg=bottleneck",
"cftime @ git+https://github.com/Unidata/cftime.git@master#egg=cftime",
"flox @ git+https://github.com/dcherian/flox.git@main#egg=flox",
"xarray @ git+https://github.com/pydata/xarray.git@main#egg=xarray",
]

KEYWORDS = "xclim climate climatology netcdf gridded analysis"

setup(
Expand Down Expand Up @@ -94,7 +86,7 @@
[console_scripts]
xclim=xclim.cli:cli
""",
extras_require={"dev": dev_requirements, "upstream": upstream_requirements},
extras_require={"dev": dev_requirements},
url=URL,
version=VERSION,
zip_safe=False,
Expand Down
6 changes: 1 addition & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ commands =
pytest --nbval docs/notebooks --durations=3
pytest --rootdir xclim/testing/tests/ --xdoctest xclim --ignore=xclim/testing/tests/ --durations=3

[testenv:upstream]
extras =
upstream
dev

[testenv]
setenv =
PYTEST_ADDOPTS = "--color=yes"
Expand All @@ -54,6 +49,7 @@ extras = dev
deps =
coverage: coveralls
lm3: git+https://github.com/OpenHydrology/lmoments3.git@develop#egg=lmoments3
upstream: -rrequirements_upstream.txt
install_command = python -m pip install --no-user {opts} {packages}
download = True
commands =
Expand Down

0 comments on commit f88f2d2

Please sign in to comment.