diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a2ab5a..0361692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,5 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/vyperlang/vvm/) +## [0.0.2](https://github.com/vyperlang/vvm/tree/v0.0.2) - 2020-08-26 +### Fixed +- Ignore `.exe` when handling versions on Windows + ## [0.0.1](https://github.com/vyperlang/vvm/tree/v0.0.1) - 2020-08-25 - Initial release diff --git a/setup.cfg b/setup.cfg index f4e8d51..e17a68f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,12 +1,12 @@ [bumpversion] -current_version = 0.0.1 +current_version = 0.0.2 [bumpversion:file:setup.py] [flake8] max-line-length = 100 ignore = E203,W503 -per-file-ignores = +per-file-ignores = */__init__.py: F401 [mypy] @@ -23,4 +23,3 @@ use_parentheses = True [tool:pytest] addopts = --cov=vvm --cov-branch --cov-report xml - diff --git a/setup.py b/setup.py index aaaf44a..6a3d960 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name="vvm", - version="0.0.1", # don't change this manually, use bumpversion instead + version="0.0.2", # don't change this manually, use bumpversion instead description="Vyper version management tool", long_description_markdown_filename="README.md", author="Ben Hauser", diff --git a/tests/test_install.py b/tests/test_install.py new file mode 100644 index 0000000..21dea44 --- /dev/null +++ b/tests/test_install.py @@ -0,0 +1,6 @@ +import vvm + + +def test_get_installed_vyper_versions(all_versions): + assert "exe" not in str(all_versions) + assert all_versions in vvm.install.get_installed_vyper_versions() diff --git a/vvm/install.py b/vvm/install.py index 97b8e30..2af15df 100644 --- a/vvm/install.py +++ b/vvm/install.py @@ -103,7 +103,7 @@ def get_executable( version = to_vyper_version(version) vyper_bin = get_vvm_install_folder(vvm_binary_path).joinpath(f"vyper-{version}") if _get_os_name() == "windows": - vyper_bin = vyper_bin.with_suffix(".exe") + vyper_bin = vyper_bin.with_name(f"{vyper_bin.name}.exe") if not vyper_bin.exists(): raise VyperNotInstalled( @@ -198,7 +198,11 @@ def get_installed_vyper_versions(vvm_binary_path: Union[Path, str] = None) -> Li List of Version objects of installed `vyper` versions. """ install_path = get_vvm_install_folder(vvm_binary_path) - return sorted([Version(i.name[6:]) for i in install_path.glob("vyper-*")], reverse=True) + if _get_os_name() == "windows": + version_list = [i.stem[6:] for i in install_path.glob("vyper-*")] + else: + version_list = [i.name[6:] for i in install_path.glob("vyper-*")] + return sorted([Version(i) for i in version_list], reverse=True) def install_vyper( @@ -250,7 +254,7 @@ def install_vyper( install_path = get_vvm_install_folder(vvm_binary_path).joinpath(f"vyper-{version}") if os_name == "windows": - install_path = install_path.with_suffix(".exe") + install_path = install_path.with_name(f"{install_path.name}.exe") url = BINARY_DOWNLOAD_BASE.format(version, asset["name"]) content = _download_vyper(url, headers, show_progress)