Skip to content

Commit

Permalink
Merge pull request #402 from jhonabreul/regression-tests-workflow
Browse files Browse the repository at this point in the history
Update development version to conform to SemVer
  • Loading branch information
jhonabreul authored Jan 23, 2024
2 parents 757dbac + c2281ff commit cb4a6fb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: pip install wheel

- name: Update version
run: sed -i 's/__version__ = "dev"/__version__ = "'"${GITHUB_REF##*/}"'"/g' lean/__init__.py
run: sed -i 's/__version__ = "0.0.0-dev"/__version__ = "'"${GITHUB_REF##*/}"'"/g' lean/__init__.py

- name: Build package
run: python setup.py sdist bdist_wheel
Expand Down Expand Up @@ -201,4 +201,4 @@ jobs:
aws cloudfront create-invalidation --distribution-id EATCOTHB6KFQP --paths /${{ secrets.AWS_BUCKET }}/lean-latest-ubuntu.zip
aws cloudfront create-invalidation --distribution-id EATCOTHB6KFQP --paths /${{ secrets.AWS_BUCKET }}/lean-latest-macos.zip
aws cloudfront create-invalidation --distribution-id EATCOTHB6KFQP --paths /${{ secrets.AWS_BUCKET }}/lean-latest-windows.zip
shell: bash
shell: bash
2 changes: 1 addition & 1 deletion lean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# The version is always set to "dev" in the Git repository. When a new release is ready,
# a maintainer will push a new Git tag which will trigger GitHub Actions to publish a new
# package to PyPI with the version of the tag.
__version__ = "dev"
__version__ = "0.0.0-dev"
2 changes: 1 addition & 1 deletion lean/components/api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _request(self, method: str, endpoint: str, options: Dict[str, Any] = {}, ret
}

version = __version__
if __version__ == 'dev':
if "dev" in version:
version = 99999999
headers["User-Agent"] = f"Lean CLI {version}"

Expand Down
2 changes: 1 addition & 1 deletion lean/components/util/update_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def warn_if_cli_outdated(self, force: bool = False) -> None:
current_version = __version__

# A development version is never considered outdated
if current_version == "dev":
if "dev" in current_version:
return

if not force and not self._should_check_for_updates("cli", UPDATE_CHECK_INTERVAL_CLI):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_version() -> str:


def get_stubs_version_range() -> str:
if get_version() == "dev":
if "dev" in get_version():
return ""

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/components/util/test_update_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_warn_if_cli_outdated_warns_when_pypi_version_newer_than_current_version
logger.warn.assert_called()


@mock.patch.object(lean, "__version__", "dev")
@mock.patch.object(lean, "__version__", "0.0.0-dev")
def test_warn_if_cli_outdated_does_nothing_when_running_dev_version(requests_mock: RequestsMock) -> None:
logger, storage, docker_manager, update_manager = create_objects()

Expand Down

0 comments on commit cb4a6fb

Please sign in to comment.