diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1ddc693..8fd078b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 \ No newline at end of file + shell: bash diff --git a/lean/__init__.py b/lean/__init__.py index 0fb9ff80..76fc3e58 100644 --- a/lean/__init__.py +++ b/lean/__init__.py @@ -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" diff --git a/lean/components/api/api_client.py b/lean/components/api/api_client.py index 162ee573..c6787c75 100644 --- a/lean/components/api/api_client.py +++ b/lean/components/api/api_client.py @@ -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}" diff --git a/lean/components/util/update_manager.py b/lean/components/util/update_manager.py index 6a608a26..e8411b38 100644 --- a/lean/components/util/update_manager.py +++ b/lean/components/util/update_manager.py @@ -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): diff --git a/setup.py b/setup.py index 84aaa974..e0698cb2 100644 --- a/setup.py +++ b/setup.py @@ -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: diff --git a/tests/components/util/test_update_manager.py b/tests/components/util/test_update_manager.py index 9c14177d..4144c476 100644 --- a/tests/components/util/test_update_manager.py +++ b/tests/components/util/test_update_manager.py @@ -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()