Skip to content

Commit

Permalink
Prepare 0.8.0rc0
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 29, 2024
1 parent 46b7e6c commit 582ef03
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 36 deletions.
14 changes: 10 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

% ---------------
Expand All @@ -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)

Expand Down Expand Up @@ -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
36 changes: 8 additions & 28 deletions doc/release_process.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
# Release process

- [ ] Extended tests in doc/examples (`make tests` and `make tests_mpi`)
- [ ] Extended tests in doc/examples (<https://foss.heptapod.net/fluiddyn/fluidsim/-/pipeline_schedules>)

- [ ] Check builds of the "official" articles in <https://foss.heptapod.net/fluiddyn/fluiddyn_papers>

- [ ] 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

- Visit <https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.6.0...branch%2Fdefault>

- 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 <https://github.com/conda-forge/fluidsim-core-feedstock> (rc channel)

Expand Down Expand Up @@ -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 <https://github.com/conda-forge/fluidsim-core-feedstock>

Expand Down
3 changes: 2 additions & 1 deletion lib/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"},
Expand All @@ -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"
59 changes: 58 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ keywords = [
authors = [
{name = "pierre.augier", email = "[email protected]"},
]
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",
Expand Down

0 comments on commit 582ef03

Please sign in to comment.