forked from galaxyproject/galaxy-release-util
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request galaxyproject#19 from jdavcs/dev_rewrite_bootstrap…
…ping Misc. refactoring and enhancements to bootstrap_history
- Loading branch information
Showing
13 changed files
with
624 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
mypy | ||
ruff | ||
black | ||
flake8 | ||
isort | ||
|
||
# For release | ||
build | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import pytest | ||
from click.testing import CliRunner | ||
from packaging.version import Version | ||
|
||
from galaxy_release_util import bootstrap_history | ||
from galaxy_release_util.bootstrap_history import ( # _get_release_date, | ||
_get_next_release_version, | ||
_get_previous_release_version, | ||
_get_release_version_strings, | ||
create_changelog, | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def release_files_dir(): | ||
return Path(".") / "tests" / "test_data" | ||
|
||
|
||
@pytest.fixture | ||
def release_file(release_files_dir): | ||
with open(release_files_dir / "98.2.rst") as f: | ||
return f.read() | ||
|
||
|
||
@pytest.fixture | ||
def announcement_file(release_files_dir): | ||
with open(release_files_dir / "98.2_announce.rst") as f: | ||
return f.read() | ||
|
||
|
||
@pytest.fixture | ||
def user_announcement_file(release_files_dir): | ||
with open(release_files_dir / "98.2_announce_user.rst") as f: | ||
return f.read() | ||
|
||
|
||
@pytest.fixture | ||
def next_release_announcement_file(release_files_dir): | ||
with open(release_files_dir / "99.0_announce.rst") as f: | ||
return f.read() | ||
|
||
|
||
@pytest.fixture | ||
def prs_file(release_files_dir): | ||
with open(release_files_dir / "98.2_prs.rst") as f: | ||
return f.read() | ||
|
||
|
||
def test_get_previous_release_version(monkeypatch): | ||
monkeypatch.setattr( | ||
bootstrap_history, "_get_release_version_strings", lambda x: sorted(["22.01", "22.05", "23.0", "23.1"]) | ||
) | ||
|
||
assert _get_previous_release_version(None, Version("15.1")) is None | ||
assert _get_previous_release_version(None, Version("22.01")) is None | ||
assert _get_previous_release_version(None, Version("22.05")) == Version("22.01") | ||
assert _get_previous_release_version(None, Version("23.0")) == Version("22.05") | ||
assert _get_previous_release_version(None, Version("23.1")) == Version("23.0") | ||
assert _get_previous_release_version(None, Version("23.2")) == Version("23.1") | ||
assert _get_previous_release_version(None, Version("99.99")) == Version("23.1") | ||
|
||
|
||
def test_get_next_release_version(): | ||
assert _get_next_release_version(Version("25.0")) == Version("25.1") | ||
assert _get_next_release_version(Version("26.1")) == Version("26.2") | ||
|
||
|
||
def test_get_release_version_strings(monkeypatch): | ||
filenames = [ | ||
"15.0.not_rst", | ||
"22.01.rst", | ||
"22.05.rst", | ||
"23.0.rst", | ||
"23.1.rst", | ||
"23.not_a_release.rst", | ||
"not_a_release.23.rst", | ||
] | ||
monkeypatch.setattr(bootstrap_history, "_get_release_documentation_filenames", lambda x: sorted(filenames)) | ||
assert _get_release_version_strings(None) == ["22.01", "22.05", "23.0", "23.1"] | ||
|
||
|
||
def test_create_changelog( | ||
monkeypatch, | ||
release_file, | ||
announcement_file, | ||
user_announcement_file, | ||
prs_file, | ||
next_release_announcement_file, | ||
): | ||
monkeypatch.setattr( | ||
bootstrap_history, "_load_prs", lambda x, y, z: None | ||
) # We don't want to call github's API on test data. | ||
runner = CliRunner() | ||
with runner.isolated_filesystem(): | ||
os.makedirs("doc/source/releases") | ||
result = runner.invoke( | ||
create_changelog, ["98.2", "--galaxy-root", ".", "--release-date", "2099-1-15", "--next-version", "99.0"] | ||
) # version 98.2 to be released on January 15, 2099 | ||
assert result.exit_code == 0 | ||
|
||
releases_path = Path("doc") / "source" / "releases" | ||
|
||
with open(releases_path / "98.2.rst") as f: | ||
assert f.read() == release_file | ||
with open(releases_path / "98.2_announce.rst") as f: | ||
assert f.read() == announcement_file | ||
with open(releases_path / "98.2_announce_user.rst") as f: | ||
assert f.read() == user_announcement_file | ||
with open(releases_path / "98.2_prs.rst") as f: | ||
assert f.read() == prs_file | ||
with open(releases_path / "99.0_announce.rst") as f: | ||
assert f.read() == next_release_announcement_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
.. to_doc | ||
98.2 | ||
=============================== | ||
|
||
.. announce_start | ||
Enhancements | ||
------------------------------- | ||
|
||
.. major_feature | ||
.. feature | ||
.. enhancement_tag_viz | ||
.. enhancement_tag_datatypes | ||
.. enhancement_tag_tools | ||
.. enhancement_tag_workflows | ||
.. enhancement_tag_ui | ||
.. enhancement_tag_jobs | ||
.. enhancement_tag_admin | ||
.. enhancement | ||
.. small_enhancement | ||
Fixes | ||
------------------------------- | ||
|
||
.. major_bug | ||
.. bug_tag_viz | ||
.. bug_tag_datatypes | ||
.. bug_tag_tools | ||
.. bug_tag_workflows | ||
.. bug_tag_ui | ||
.. bug_tag_jobs | ||
.. bug_tag_admin | ||
.. bug | ||
.. include:: 98.2_prs.rst | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
|
||
=========================================================== | ||
98.2 Galaxy Release (January 2099) | ||
=========================================================== | ||
|
||
.. include:: _header.rst | ||
|
||
Highlights | ||
=========================================================== | ||
|
||
Feature1 | ||
-------- | ||
|
||
Feature description. | ||
|
||
Feature2 | ||
-------- | ||
|
||
Feature description. | ||
|
||
Feature3 | ||
-------- | ||
|
||
Feature description. | ||
|
||
Also check out the `98.2 user release notes <98.2_announce_user.html>`__. | ||
Are you an admin? Check out `some admin relevant PRs <https://github.com/galaxyproject/galaxy/pulls?q=label%3Ahighlight%2Fadmin+milestone%3A98.2+is%3Aclosed+is%3Apr>`__. | ||
|
||
Get Galaxy | ||
=========================================================== | ||
|
||
The code lives at `GitHub <https://github.com/galaxyproject/galaxy>`__ and you should have `Git <https://git-scm.com/>`__ to obtain it. | ||
|
||
To get a new Galaxy repository run: | ||
.. code-block:: shell | ||
$ git clone -b release_98.2 https://github.com/galaxyproject/galaxy.git | ||
To update an existing Galaxy repository run: | ||
.. code-block:: shell | ||
$ git fetch origin && git checkout release_98.2 && git pull --ff-only origin release_98.2 | ||
See the `community hub <https://galaxyproject.org/develop/source-code/>`__ for additional details on source code locations. | ||
|
||
|
||
Administration Notes | ||
=========================================================== | ||
Add content or drop section. | ||
|
||
Configuration Changes | ||
=========================================================== | ||
Add content or drop section. | ||
|
||
Deprecation Notices | ||
=========================================================== | ||
Add content or drop section. | ||
|
||
Release Notes | ||
=========================================================== | ||
|
||
.. include:: 98.2.rst | ||
:start-after: announce_start | ||
|
||
.. include:: _thanks.rst |
Oops, something went wrong.