From 70e637e23862c9f60f7671cf36c0b9345d6dbf38 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 28 Feb 2019 18:57:15 -0700 Subject: [PATCH 1/9] Add release procedure --- HOWTORELEASE.rst | 45 +++++++++++++++++++++++++++++++++++ docs/source/index.rst | 1 + docs/source/release_procedure | 1 + 3 files changed, 47 insertions(+) create mode 100644 HOWTORELEASE.rst create mode 100644 docs/source/release_procedure diff --git a/HOWTORELEASE.rst b/HOWTORELEASE.rst new file mode 100644 index 0000000..bb57535 --- /dev/null +++ b/HOWTORELEASE.rst @@ -0,0 +1,45 @@ +Release Procedure +----------------- + +Our current policy for releasing is to aim for a release every two weeks. +The idea is to get fixes and new features out instead of trying to cram a ton of +features into a release and by consequence taking a lot of time to make a new one. + +#. Create a new branch ``release-yyyy.mm.dd`` with the version for the release + + * Update `CHANGELOG.rst` + * Make sure all new changes, features are reflected in the documentation. + +#. Open a new pull request for this branch targeting `master` + + +#. After all tests pass and the PR has been approved, merge the PR into ``master`` + +#. Tag a release and push to github:: + + $ git tag -a v2019.1.1 -m "Version 2019.1.1" + $ git push origin master --tags + +#. Build and publish release on PyPI:: + + $ git clean -xfd # remove any files not checked into git + $ python setup.py sdist bdist_wheel --universal # build package + $ twine upload dist/* # register and push to pypi + +#. Update esmlab conda-forge feedstock + + * Fork `esmlab-feedstock repository `_ + * Clone this fork and edit recipe:: + + $ git clone git@github.com:username/esmlab-feedstock.git + $ cd esmlab-feedstock + $ cd recipe + $ # edit meta.yaml + + - Update version + - Get sha256 from pypi.org for `esmlab `_ + - Fill in the rest of information as described `here `_ + + * Commit and submit a PR + + diff --git a/docs/source/index.rst b/docs/source/index.rst index a35a004..77b9ca5 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -8,6 +8,7 @@ regridding.ipynb api contributing + release_procedure changelog diff --git a/docs/source/release_procedure b/docs/source/release_procedure new file mode 100644 index 0000000..c52e0c5 --- /dev/null +++ b/docs/source/release_procedure @@ -0,0 +1 @@ +.. include:: ../../HOWTORELEASE.rst \ No newline at end of file From b4f079e69c59067d044ff58fda859e6c092b3dd9 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 28 Feb 2019 18:58:40 -0700 Subject: [PATCH 2/9] Update pre-commit hooks --- .pre-commit-config.yaml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5b13881..8cc0b32 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,23 @@ repos: + +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.1.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-docstring-first + - id: check-json + - id: check-added-large-files + - id: check-yaml + - id: double-quote-string-fixer + - repo: https://github.com/ambv/black rev: 18.9b0 hooks: - id: black - args: ["--line-length", "100", "--skip-string-normalization", + args: ["--line-length", "100", "--skip-string-normalization", "--exclude", '''/(esmlab/_version.py|versioneer.py)/'''] - -- repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.4.3 - hooks: - - id: autopep8 - entry: autopep8 - args: ["--in-place", "--aggressive"] - - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.1.0 hooks: @@ -27,4 +31,4 @@ repos: rev: v4.3.4 hooks: - id: isort - args: ["line_length=100"] \ No newline at end of file + args: ["line_length=100"] From 9d665f8866e66871b2fb7ee0fdb27a75465c0302 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 28 Feb 2019 19:01:26 -0700 Subject: [PATCH 3/9] Update pull request template --- .github/PULL_REQUEST_TEMPLATE.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c643110..2ddc79c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,6 @@ Thanks for submitting a PR, your contribution is really appreciated! -Here's a quick checklist that should be present in PRs (you can delete this text from the final description, this is -just a guideline): +Here's a quick checklist that should be present in PRs (you can delete this text from the final description, this is just a guideline): -- [ ] Create a new changelog file in the `changelog` folder, with a name like `..rst`. See [CHANGELOG.rst](https://github.com/NCAR/esmlab/blob/master/CHANGELOG.rst) for details. - [ ] Include documentation when adding new features. - [ ] Include new tests or update existing tests when applicable. - -[summarize your pull request here] From 15f14088a957a39e8570f9ac9a5002279b884eec Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 28 Feb 2019 19:16:30 -0700 Subject: [PATCH 4/9] Update changelog --- CHANGELOG.rst | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 149c300..6699319 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,39 @@ Changelog history ================= + + +Esmlab v2019.2.28 (2019-02-28) +============================== + +Features +--------- + + +- Add function to flexibily compute weights and dimensions to use in statistical operations (:pr:`74`) `Anderson Banihirwe`_ + +- Add ``time_manager`` class to support managing the time coordinate of datasets (:pr:`75`) and (:pr:`76`) `Matthew Long`_ + + +Bug Fixes +---------- + +- Remove hard-coded ``tb_name=time_bound`` in ``compute_time_var`` (:pr:`72`) `Anderson Banihirwe`_ + +Documentation +--------------- + +- Add release procedure to documentation (:pr:`78`) `Anderson Banihirwe`_ + + +Trivial/Internal Changes +------------------------- + +- Use `esmlab-data `_ in tests (:pr:`67`) `Anderson Banihirwe`_ +- Update continuous integration workflow (:pr:`68`) `Anderson Banihirwe`_ + + + Esmlab v2019.2.1 (2019-02-12) ============================== @@ -25,4 +58,4 @@ Esmlab v2019.2.0 (2019-02-02) .. _`Anderson Banihirwe`: https://github.com/andersy005 -.. _`Matthew Long`: https://github.com/matt-long \ No newline at end of file +.. _`Matthew Long`: https://github.com/matt-long From 21ae346276b03cdeee09991bad740e44e8796a77 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 28 Feb 2019 19:23:00 -0700 Subject: [PATCH 5/9] Fix formatting issues --- CHANGELOG.rst | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6699319..944a11b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,8 +1,6 @@ -================= +================== Changelog history -================= - - +================== Esmlab v2019.2.28 (2019-02-28) ============================== @@ -10,7 +8,6 @@ Esmlab v2019.2.28 (2019-02-28) Features --------- - - Add function to flexibily compute weights and dimensions to use in statistical operations (:pr:`74`) `Anderson Banihirwe`_ - Add ``time_manager`` class to support managing the time coordinate of datasets (:pr:`75`) and (:pr:`76`) `Matthew Long`_ @@ -38,21 +35,21 @@ Trivial/Internal Changes Esmlab v2019.2.1 (2019-02-12) ============================== -- Add time_boud to output of compute_ann_mean (:pr:`51`) `Matthew Long`_ +- Add ``time_bound`` to output of ``compute_ann_mean`` (:pr:`51`) `Matthew Long`_ - Add xarray alignment option to prevent using mismatching coordinates (:pr:`54`) `Anderson Banihirwe`_ - Add regridding functionality (:pr:`56`) `Matthew Long`_ -- Handle time_bound on data read with decode_times=True (:pr:`59`) `Matthew Long`_ +- Handle ``time_bound`` on data read with ``decode_times=True`` (:pr:`59`) `Matthew Long`_ - Add interface to esmlab-data (:pr:`61`) `Anderson Banihirwe`_ Esmlab v2019.2.0 (2019-02-02) ============================== -- Rename compute_ann_climatology to compute_ann_mean (:pr:`33`) `Anderson Banihirwe`_ -- Don't add NaNs for _FillValue (:pr:`34`) `Anderson Banihirwe`_ -- Change time handling for compute_mon_climatology and compute_ann_mean (:pr:`37`) `Matthew Long`_ -- Add slice_mon_clim_time argument to compute_mon_climatology (:pr:`37`) `Matthew Long`_ -- Drop time_bound var from compute_ann_mean (:pr:`43`) `Matthew Long`_ +- Rename ``compute_ann_climatology`` to ``compute_ann_mean`` (:pr:`33`) `Anderson Banihirwe`_ +- Don't add ``NaNs`` for ``_FillValue`` (:pr:`34`) `Anderson Banihirwe`_ +- Change time handling for ``compute_mon_climatology`` and ``compute_ann_mean`` (:pr:`37`) `Matthew Long`_ +- Add slice_mon_clim_time argument to ``compute_mon_climatology`` (:pr:`37`) `Matthew Long`_ +- Drop ``time_bound`` variable from ``compute_ann_mean`` (:pr:`43`) `Matthew Long`_ From 1371c9c0fab537d48604a5e64afe19a04a4cca74 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 28 Feb 2019 19:53:13 -0700 Subject: [PATCH 6/9] Update manifest --- MANIFEST.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 0578006..537ac71 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,9 +4,13 @@ include LICENSE include README.rst include requirements.txt include requirements-py2.txt -recursive-include tests +include CONTRIBUTING.rst +include HOWTORELEASE.rst +recursive-include tests *.py +recursive-include tests/data/*.nc +recursive-include tests/utils/*.py recursive-exclude * __pycache__ recursive-exclude * *.py[co] include versioneer.py -include esmlab/_version.py \ No newline at end of file +include esmlab/_version.py From 3d2c13375b27b521956e2cdec9b0fb173c401e6a Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 28 Feb 2019 20:31:03 -0700 Subject: [PATCH 7/9] Update environment files --- ci/environment-dev-2.7.yml | 7 ++----- ci/environment-dev-3.6.yml | 4 ++-- ci/environment-dev-3.7.yml | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ci/environment-dev-2.7.yml b/ci/environment-dev-2.7.yml index 09a7343..190a2af 100644 --- a/ci/environment-dev-2.7.yml +++ b/ci/environment-dev-2.7.yml @@ -8,15 +8,12 @@ dependencies: - distributed - matplotlib - netcdf4 - - numpy==1.15 + - numpy - pytest - pytest-cov - python=2.7 - - xarray==0.11.2 + - xarray>=0.11.2 - zarr - pip: - pytest-lazy-fixture - contextlib2 - - - diff --git a/ci/environment-dev-3.6.yml b/ci/environment-dev-3.6.yml index c534529..7294ec8 100644 --- a/ci/environment-dev-3.6.yml +++ b/ci/environment-dev-3.6.yml @@ -10,11 +10,11 @@ dependencies: - ipykernel - matplotlib - netcdf4 - - numpy==1.15 + - numpy - pytest - pytest-cov - python=3.6 - - xarray==0.11.3 + - xarray>=0.11.3 - xesmf - zarr - pip: diff --git a/ci/environment-dev-3.7.yml b/ci/environment-dev-3.7.yml index bfd60d9..f4c0782 100644 --- a/ci/environment-dev-3.7.yml +++ b/ci/environment-dev-3.7.yml @@ -15,17 +15,15 @@ dependencies: - matplotlib - nbsphinx - netcdf4 - - numpy==1.15 + - numpy - numpydoc - - pandoc - pytest - pytest-cov - python=3.7 - recommonmark - - six - sphinx_rtd_theme - sphinx>=1.6 - - xarray==0.11.2 + - xarray>=0.11.2 - xesmf - zarr - pip: From a34500dc6dbe728acbe651f919fff3e0d15f6dbb Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 28 Feb 2019 20:39:51 -0700 Subject: [PATCH 8/9] update keywords --- setup.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/setup.py b/setup.py index 65b16a5..c233963 100644 --- a/setup.py +++ b/setup.py @@ -8,34 +8,34 @@ import versioneer from os.path import exists -if exists("README.rst"): - with open("README.rst") as f: +if exists('README.rst'): + with open('README.rst') as f: long_description = f.read() else: - long_description = "" + long_description = '' if sys.version_info > (3, 0): - with open("requirements.txt") as f: - install_requires = f.read().strip().split("\n") + with open('requirements.txt') as f: + install_requires = f.read().strip().split('\n') else: - with open("requirements-py2.txt") as f: - install_requires = f.read().strip().split("\n") + with open('requirements-py2.txt') as f: + install_requires = f.read().strip().split('\n') -test_requirements = ["pytest"] +test_requirements = ['pytest'] setup( - maintainer="Anderson Banihirwe", - maintainer_email="abanihi@ucar.edu", - description="Tools for working with earth system multi-model analyses with xarray", + maintainer='Anderson Banihirwe', + maintainer_email='abanihi@ucar.edu', + description='Tools for working with earth system multi-model analyses with xarray', install_requires=install_requires, - license="Apache License 2.0", + license='Apache License 2.0', long_description=long_description, - keywords="esmlab xarray cmip", - name="esmlab", + keywords='esmlab xarray cmip cesm', + name='esmlab', packages=find_packages(), - test_suite="tests", + test_suite='tests', tests_require=test_requirements, - url="https://github.com/NCAR/esmlab", + url='https://github.com/NCAR/esmlab', version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), zip_safe=False, From 55341e6eb7333583a346ecb669abc6f338bf4f9c Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 28 Feb 2019 21:14:07 -0700 Subject: [PATCH 9/9] fix release_procedure filename extension --- docs/source/release_procedure | 1 - docs/source/release_procedure.rst | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 docs/source/release_procedure create mode 100644 docs/source/release_procedure.rst diff --git a/docs/source/release_procedure b/docs/source/release_procedure deleted file mode 100644 index c52e0c5..0000000 --- a/docs/source/release_procedure +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../../HOWTORELEASE.rst \ No newline at end of file diff --git a/docs/source/release_procedure.rst b/docs/source/release_procedure.rst new file mode 100644 index 0000000..a81c63d --- /dev/null +++ b/docs/source/release_procedure.rst @@ -0,0 +1 @@ +.. include:: ../../HOWTORELEASE.rst