Skip to content

Commit 856ac8e

Browse files
authored
Merge pull request #320 from EC-USGS/v2.0.0
Release 2.0.0
2 parents 80f31f2 + 65e54e8 commit 856ac8e

File tree

243 files changed

+306820
-34996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+306820
-34996
lines changed

.flake8

-14
This file was deleted.

.github/RELEASE.md

+55-32
Original file line numberDiff line numberDiff line change
@@ -28,73 +28,96 @@ pushed to this repo.
2828
To release a new version:
2929

3030
1. Test asv benchmarking with the `-q` flag to ensure it is working (multiple
31-
platformas a bonus).
31+
platformas a bonus). You can merge the ref you are testing, but you cant
32+
test the release ref on main until after the release is made, so that step
33+
will come below and those details will merge to develop and not the
34+
release.
35+
36+
1. If there are extended release notes to put in the gh-pages branch, once
37+
you have approval, change the dates of the appropriate pages to the
38+
desired release date. Change any links to the extended documentation in
39+
develop branch to match. Push gh-pages branch to confirm in develop before
40+
releasing.
3241

3342
1. On your local machine, create a release branch from `develop` or a patch
3443
branch from `main`. The branch's name must follow format
3544
`v{major}.{minor}.{patch}` ([semantic version](https://semver.org/) number
3645
with a leading 'v'). For instance, for a minor release, if this repo is an
3746
`upstream` remote and one's local `develop` is up to date with upstream
38-
`develop`, then from `develop` run `git switch -c vx.y.z`.
47+
`develop`, then from `develop` run `git switch -c vx.y.z`.
3948

4049
1. If this is a patch release, make changes/fixes locally. If this is a major or
41-
minor release, no changes are needed.
42-
43-
In either case, add the release version and date to the top of
44-
`doc/whats-new.rst`. If a patch, put it below the pending minor release.
50+
minor release, no changes may be needed. In either case, add the release version
51+
and date to the top of `doc/whats-new.rst`. If a patch, put it below the
52+
pending minor release. Also update the version in `doc/index.rst`. Update the
53+
CITATION.cff file. If a major release, get the provisional new DOI from USGS
54+
and add it to CITATION.cff and the main README.md.
4555

4656
1. Push the branch to this repo. For instance, if this repo is an `upstream`
4757
remote: `git push -u upstream vx.y.z`. This starts a job to:
48-
4958
- Check out the release branch and update version number in `version.txt` and
5059
`pywatershed/version.py` to match the version in the branch name.
5160
- Build and check the Python package.
5261
- Upload the package as an artifact.
5362
- Draft a PR against `main` with the updated version files.
5463

5564
1. On all platforms, pull the release from upstream and perform ASV performance
56-
benchmarks against previous release , e.g., ```asv run --verbose
57-
--show-stderr HASHFILE:pws_refs_for_asv.txt``` after editing the file to
58-
contain the previous and current release. Collect performance results from
59-
various machines into a single report and use `asv publish` to generate
60-
the static webpages to be included with the release as artifacts in that
61-
step below.
65+
benchmarks against previous release , e.g., ```asv run --verbose
66+
-show-stderr HASHFILE:pws_refs_for_asv.txt``` after editing the file to
67+
contain the previous and current release. Collect performance results from
68+
various machines into a single report and use `asv publish` to generate
69+
the static webpages to be included with the release as artifacts in that
70+
step below.
6271

6372
1. Inspect the package. If it looks good, merge the PR to `main`.
6473

65-
**Note**: it is critical to *merge* the PR to `main`, not squash as is
66-
conventional for development PRs. Squashing causes `develop` and `main` to
67-
diverge. Merging to `main` preserves commit history and ensures `develop`
68-
and `main` don't diverge.
74+
**Note**: it is critical to *merge* the PR to `main`, not squash as is
75+
conventional for development PRs. Squashing causes `develop` and `main` to
76+
diverge. Merging to `main` preserves commit history and ensures `develop`
77+
and `main` don't diverge.
6978

70-
Merging the PR to `main` will trigger another job to draft a [GitHub
71-
release](https://github.com/EC-USGS/pywatershed/releases). The release is
72-
not yet publicly visible at this point.
79+
Merging the PR to `main` will trigger another job to draft a [GitHub
80+
release](https://github.com/EC-USGS/pywatershed/releases). The release is
81+
not yet publicly visible at this point.
7382

7483
1. Inspect the GitHub release. If needed, make any manual edits to the release
7584
notes. If the release looks good, publish it via GitHub UI or CLI. Manually
7685
add the asv static web pages and frozen conda dependencies for each platform.
7786

7887
Publishing the release on GitHub automatically tags the head of `main` with
7988
the release version number (**Note**: release tags, unlike branches, don't
80-
include an initial `v`, as is common in some projects) and triggers jobs to:
89+
include an initial `v`, as is common in some projects) and triggers jobs to
90+
publish the package to PyPI.
8191

82-
- Publish the package to PyPI
83-
- Check out `main`
84-
- Run `.github/scripts/update_version.py -v x.y+1.0.dev0` to update
85-
`version.txt` and `pywatershed/version.py` with the minor version number
86-
incremented. The `.dev0` suffix indicates preliminary development status.
87-
- Draft a PR against `develop` with the updated version files and the
88-
updates previously merged to `main`.
92+
1. Delete the release branch on upstream.
8993

90-
1. In the case of a minor or major release, a couple of manual steps:
91-
- Update the PR against `develop` to add a new minor or major release to
92-
the top of `doc/whats-new.rst`
93-
- Update `main` image on WholeTale to have the current release.
94+
1. On all platforms, pull the release from upstream and perform ASV performance
95+
benchmarks against previous release. First delete `.asv/` entirely (unless
96+
there's some good reason to keep `.asv/envs`), then update
97+
`pws_refs_for_asv.txt` to have the previous release and the above release,
98+
next `asv run --verbose --show-stderr HASHFILE:pws_refs_for_asv.txt`. Collect
99+
performance results from various machines into a single `.asv/results/`, then
100+
use `asv publish` to generate the static webpages in `.asv/html`. When these
101+
are to your liking, add them to the gh-pages branch in the `asv/vM-m-p`
102+
directory.
103+
104+
1. In the case of a minor or major release, (a patch would be applied to both
105+
main and develop?) a couple of manual steps:
106+
- Check out `main` as a new branch to get it back into develop,
107+
eg feat_main_to_dev.
108+
- Run `.github/scripts/update_version.py -v x.y+1.0.dev0` to update
109+
`version.txt` and `pywatershed/version.py` with the minor version number
110+
incremented. The `.dev0` suffix indicates preliminary development status.
111+
- Add a new minor release to the top of `doc/whats-new.rst`
112+
- Incorporate the ASV details from the previous section above.
113+
- Open a PR against `develop` with the updated version files and the
114+
updates previously merged to `main`.
94115

95116
1. Merge the PR to `develop`. As above, it is important to *merge* the PR, not
96117
squash, to preserve history and keep `develop` and `main` from diverging.
97118

119+
1. Update `main` image on WholeTale to have the current release.
120+
98121

99122
## Utility scripts
100123

.github/scripts/update_version.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_authors():
2929

3030

3131
def update_version_py(timestamp: datetime, version: Version):
32-
lines = (
32+
_ = (
3333
open(_version_py_path, "r").readlines()
3434
if _version_py_path.exists()
3535
else []
@@ -38,7 +38,8 @@ def update_version_py(timestamp: datetime, version: Version):
3838
with open(_version_py_path, "w") as f:
3939
f.write(
4040
f"# {_project_name} version file automatically created using "
41-
f"{Path(__file__).name} on {timestamp:%B %d, %Y %H:%M:%S}\n\n"
41+
f"{Path(__file__).name} on {timestamp:%B %d, %Y %H:%M:%S}"
42+
" #noqa: E501\n\n"
4243
)
4344
f.write(f'__version__ = "{version}"\n')
4445
f.writelines(
@@ -48,13 +49,13 @@ def update_version_py(timestamp: datetime, version: Version):
4849
"author_dict = {\n",
4950
]
5051
+ [
51-
f" \"{a['given-names']} {a['family-names']}\": \"{a['email']}\",\n"
52+
f" \"{a['given-names']} {a['family-names']}\": \"{a['email']}\",\n" # noqa: E501
5253
for a in authors
5354
]
5455
+ [
5556
"}\n",
5657
'__author__ = ", ".join(author_dict.keys())\n',
57-
'__author_email__ = ", ".join(s for _, s in author_dict.items())\n',
58+
'__author_email__ = ", ".join(s for _, s in author_dict.items())\n', # noqa: E501
5859
]
5960
)
6061
f.close()
@@ -81,7 +82,7 @@ def update_version(
8182
finally:
8283
try:
8384
lock_path.unlink()
84-
except:
85+
except: # noqa: E722
8586
pass
8687

8788

@@ -96,7 +97,7 @@ def update_version(
9697
provided, the version number will not be changed. A file lock is held
9798
to synchronize file access. The version tag must comply with standard
9899
'<major>.<minor>.<patch>' format conventions for semantic versioning.
99-
"""
100+
""" # noqa: E501
100101
),
101102
)
102103
parser.add_argument(
@@ -110,7 +111,7 @@ def update_version(
110111
"--get",
111112
required=False,
112113
action="store_true",
113-
help="Just get the current version number, don't update anything (defaults to false)",
114+
help="Just get the current version number, don't update anything (defaults to false)", # noqa: E501
114115
)
115116
args = parser.parse_args()
116117

@@ -121,7 +122,7 @@ def update_version(
121122
else:
122123
update_version(
123124
timestamp=datetime.now(),
124-
version=Version(args.version)
125-
if args.version
126-
else _current_version,
125+
version=(
126+
Version(args.version) if args.version else _current_version
127+
),
127128
)

0 commit comments

Comments
 (0)