Skip to content

Commit

Permalink
'update version to 0.37.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorshea committed Feb 28, 2022
1 parent a66eae4 commit e6e9190
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 57 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.36.3
0.37.0
2 changes: 1 addition & 1 deletion docs/source/_custom_js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions docs/source/about/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ scheme for the project adheres to `Semantic Versioning <https://semver.org/>`__.
Unreleased
----------

Nothing yet...


0.37.0
------

Added:

- Support for keys in HTML fragments - :issue:`682`
Expand Down
28 changes: 17 additions & 11 deletions docs/source/about/contributor-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,29 +268,35 @@ Where you can then navigate to http://localhost:5000..
Release Process
---------------

1. Update version
2. Add changelog entry

- Include merged pull requests
- Include closed issues

3. Commit final release changes
4. Create a release tag
5. Manually author a release in GitHub
1. :ref:`Update version <Update Release Version>`
2. Create a release tag
3. Manually author a release in GitHub


Update Release Version
......................

To update the version for all core Javascript and Python packages in IDOM run:
To simultaneously update the version for:

- Python packages
- Javascript packages
- The :ref:`changelog`

Run the following command:

.. code-block:: bash
nox -s update_version -- <new-version>
.. note::

The new version must adhere to `SemVer <https://semver.org/>`__.
The ``<new-version>`` must adhere to `SemVer <https://semver.org/>`__.

Then commit those changes:

.. code-block:: bash
git commit -m 'update version to <new-version>'
Creating The Release
Expand Down
66 changes: 34 additions & 32 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,35 @@ def build_js(session: Session) -> None:
@nox.session
def tag(session: Session) -> None:
"""Create a new git tag"""
if len(session.posargs) > 1:
session.error("To many arguments")

try:
new_version = session.posargs[0]
except IndexError:
session.error("No version tag given")

install_requirements_file(session, "make-release")

# check that version is valid semver
session.run("pysemver", "check", new_version)

old_version = get_version()
session.log(f"Old version: {old_version}")
session.log(f"New version: {new_version}")
set_version(new_version)

session.run("python", "scripts/update_versions.py")

# trigger npm install to update package-lock.json
session.install("-e", ".")

try:
session.run(
"git",
"diff",
"--cached",
"--exit-code",
silent=True,
external=True,
)
except Exception:
Expand All @@ -305,7 +327,7 @@ def tag(session: Session) -> None:
install_requirements_file(session, "make-release")
session.run("pysemver", "check", version)

changelog_file = ROOT / "docs" / "source" / "developing-idom" / "changelog.rst"
changelog_file = ROOT / "docs" / "source" / "about" / "changelog.rst"
for line in changelog_file.read_text().splitlines():
if line == version:
session.log(f"Found changelog section for version {version}")
Expand All @@ -316,37 +338,17 @@ def tag(session: Session) -> None:
f"make sure you have a title section called {version}."
)

session.run("git", "tag", version, external=True)

if "push" in session.posargs:
session.run("git", "push", "--tags", external=True)
if session.interactive:
session.log()
response = input("confirm (yes/no): ").lower()
if response != "yes":
return None


@nox.session
def update_version(session: Session) -> None:
"""Update the version of all Python and Javascript packages in this repo"""
if len(session.posargs) > 1:
session.error("To many arguments")

try:
new_version = session.posargs[0]
except IndexError:
session.error("No version tag given")

install_requirements_file(session, "make-release")

# check that version is valid semver
session.run("pysemver", "check", new_version)

old_version = get_version()
session.log(f"Old version: {old_version}")
session.log(f"New version: {new_version}")
set_version(new_version)

session.run("python", "scripts/update_versions.py")

# trigger npm install to update package-lock.json
session.install("-e", ".")
# stage, commit, tag, and push version bump
session.run("git", "add", "--all")
session.run("git", "commit", "-m", repr(f"update version to {new_version}"))
session.run("git", "tag", version, external=True)
session.run("git", "push", "--tags", external=True)


@nox.session(reuse_venv=True)
Expand Down
8 changes: 4 additions & 4 deletions scripts/update_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ def update_changelog_version(new_version: str) -> None:
old_content = CHANGELOG_FILE.read_text().split("\n")

new_content = []
for index in range(0, len(old_content), 2):
for index in range(len(old_content) - 1):
if index == len(old_content) - 2:
# reached end of file
continue

old_lines = old_content[index : index + 2]
if old_lines[0] == "Unreleased" and old_lines[1] == ("-" * len(old_lines[0])):
this_line, next_line = old_content[index : index + 2]
if this_line == "Unreleased" and next_line == ("-" * len(this_line)):
new_content.append(_UNRELEASED_SECTION)
new_content.append(new_version)
new_content.append("-" * len(new_version))
new_content.extend(old_content[index + 2 :])
break
else:
new_content.extend(old_lines)
new_content.append(this_line)
else:
raise ValueError(f"Did not find 'Unreleased' section in {CHANGELOG_FILE}")

Expand Down
8 changes: 4 additions & 4 deletions src/client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"publish": "npm --workspaces publish",
"test": "npm --workspaces test"
},
"version": "0.36.3",
"version": "0.37.0",
"workspaces": [
"./packages/*"
]
Expand Down
2 changes: 1 addition & 1 deletion src/client/packages/idom-app-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
"format": "prettier --write ./src",
"test": "echo 'no tests'"
},
"version": "0.36.3"
"version": "0.37.0"
}
2 changes: 1 addition & 1 deletion src/client/packages/idom-client-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
"test": "uvu tests"
},
"type": "module",
"version": "0.36.3"
"version": "0.37.0"
}
2 changes: 1 addition & 1 deletion src/idom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


__author__ = "idom-team"
__version__ = "0.36.3" # DO NOT MODIFY
__version__ = "0.37.0" # DO NOT MODIFY

__all__ = [
"component",
Expand Down

0 comments on commit e6e9190

Please sign in to comment.