diff --git a/CHANGES.md b/CHANGES.md index 94a181fe..bdc4044a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +See also the [unreleased changes]. + % Type of changes % --------------- @@ -22,11 +24,13 @@ and this project adheres to % Security Security in case of vulnerabilities. -% Unreleased_ - -% ----------- +## [0.8.0] (2024-01-28) -% towncrier release notes start +- Build and upload wheels on PyPI with Github Actions. +- Much better CI in foss.heptapod.net and Github Actions. +- Use the [Meson build system](https://mesonbuild.com) via + [meson-python](https://github.com/mesonbuild/meson-python). +- Development: use PDM, Nox and Pixi. ## [0.7.4] (2023-10-05) @@ -318,3 +322,5 @@ Merge with geofluidsim (Ashwin Vishnu Mohanan repository) [0.7.2]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.7.1...0.7.2 [0.7.3]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.7.2...0.7.3 [0.7.4]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.7.3...0.7.4 +[0.8.0]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.7.4...0.8.0 +[unreleased changes]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.8.0...branch%2Fdefault diff --git a/doc/release_process.md b/doc/release_process.md index e714a048..c9c83d3d 100644 --- a/doc/release_process.md +++ b/doc/release_process.md @@ -1,14 +1,14 @@ # Release process -- [ ] Extended tests in doc/examples (`make tests` and `make tests_mpi`) +- [ ] Extended tests in doc/examples () - [ ] Check builds of the "official" articles in -- [ ] Topic for the release candidate +- [ ] Topic/MR for the release candidate - - [ ] Change version in `lib/fluidsim_core/_version.py` (`0.6.1rc0`) + - [ ] Change versions in `pyproject.toml` AND `lib/pyproject.toml` (`0.6.1rc0`) - - [ ] Update changelog in `CHANGES.rst` + - [ ] Update changelog in `CHANGES.md` - Take into account `doc/newsfragments` + remove the fragments @@ -16,25 +16,7 @@ - Study `hg log -G -r "tag(0.6.0):tip"` -- [ ] Tag `0.6.1rc0` in the repo - -- [ ] Push `fluidsim-core` release candidates to PyPI - - ```bash - cd lib - rm -rf dist - python -m build - twine upload dist/* - ``` - -- [ ] Push `fluidsim` release candidates to PyPI (no wheel!) - - ```bash - cd .. - rm -rf dist - python -m build -s - twine upload dist/* - ``` +- [ ] Once merged, update, tag and push with `nox -s add-tag-for-release`. - [ ] PR on (rc channel) @@ -66,18 +48,16 @@ Create new environment with ```bash - conda create -n env_fluidsim_rc \ + mamba create -n env_fluidsim_rc \ -c conda-forge/label/fluidsim-core_rc -c conda-forge/label/fluidsim_rc \ fluidsim "fluidfft[build=mpi*]" "h5py[build=mpi*]" ``` - [ ] Communicate to the community... -- [ ] Topic for the release of the stable version (delete "rc0" in `lib/fluidsim_core/_version.py`) - -- [ ] Tag `0.6.1` in the repo +- [ ] Topic/MR for the release of the stable version (delete "rc0" in the `pyproject.toml` files) -- [ ] Push to PyPI (no wheel for fluidsim!) +- [ ] New tag with `nox -s add-tag-for-release` - [ ] PR on diff --git a/lib/pyproject.toml b/lib/pyproject.toml index 38232b1e..a35a9acf 100644 --- a/lib/pyproject.toml +++ b/lib/pyproject.toml @@ -4,6 +4,8 @@ build-backend = "flit_core.buildapi" [project] name = 'fluidsim-core' +version = "0.8.0rc0" +description = "Pure-Python core library for FluidSim framework" requires-python = ">=3.9" authors = [ {name = "pierre.augier", email = "pierre.augier@univ-grenoble-alpes.fr"}, @@ -12,7 +14,6 @@ dependencies = [ "fluiddyn", "importlib_metadata; python_version < '3.10'", ] -dynamic = ['version', 'description'] [project.entry-points."fluidsim_core.tests"] test = "fluidsim_core.tests.solver" diff --git a/noxfile.py b/noxfile.py index 04d5069a..555aff9e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -53,7 +53,7 @@ def test_with_fft_and_pythran(session): _install_fluidfft(session) command = "pdm sync --clean -G dev -G test -G fft -G mpi --no-self" session.run_always(*command.split(), external=True) - session.install(".", "--no-deps", "-C", "setup-args=-Dnative=true") + session.install(".", "-v", "--no-deps", "-C", "setup-args=-Dnative=true") _test(session) @@ -70,3 +70,60 @@ def doc(session): session.chdir("doc") session.run("make", "cleanall", external=True) session.run("make", external=True) + + +def _get_version_from_pyproject(path=Path.cwd()): + if isinstance(path, str): + path = Path(path) + + if not path.name == "pyproject.toml": + path /= "pyproject.toml" + + in_project = False + version = None + with open(path, encoding="utf-8") as file: + for line in file: + if line.startswith("[project]"): + in_project = True + if line.startswith("version =") and in_project: + version = line.split("=")[1].strip() + version = version[1:-1] + break + + assert version is not None + return version + + +@nox.session(name="add-tag-for-release", venv_backend="none") +def add_tag_for_release(session): + session.run("hg", "pull", external=True) + + result = session.run(*"hg log -r default -G".split(), external=True, silent=True) + if result[0] != "@": + session.run("hg", "update", "default", external=True) + + version = _get_version_from_pyproject() + version_core = _get_version_from_pyproject("lib") + + print(f"{version = }, {version_core = }") + if version != version_core: + session.error("version != version_core") + + result = session.run("hg", "tags", "-T", "{tag},", external=True, silent=True) + last_tag = result.split(",", 2)[1] + print(f"{last_tag = }") + + if last_tag == version: + session.error("last_tag == version") + + answer = input( + f'Do you really want to add and push the new tag "{version}"? (yes/[no]) ' + ) + + if answer != "yes": + print("Maybe next time then. Bye!") + return + + print("Let's go!") + session.run("hg", "tag", version, external=True) + session.run("hg", "push", external=True) diff --git a/pyproject.toml b/pyproject.toml index e88dfd5f..d5d0784b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,10 +18,10 @@ keywords = [ authors = [ {name = "pierre.augier", email = "pierre.augier@univ-grenoble-alpes.fr"}, ] -version = '0.7.4' +version = '0.8.0rc0' requires-python = ">=3.9" dependencies = [ - "fluidsim-core>=0.7.4", + "fluidsim-core>=0.8.0rc0", "h5py", "h5netcdf", "transonic>=0.6.0",