Skip to content

Commit

Permalink
feat: switch python to new installer (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante authored Oct 26, 2024
1 parent e3888a5 commit 67e36d7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions crates/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
```
cargo build
cargo install --path .
marzano --help
grit --help
```

## Usage

1. check to run a pattern on a file

```
marzano check --pattern=test_jsx.grit test_jsx.js
grit check --pattern=test_jsx.grit test_jsx.js
```

## Tests
Expand Down
6 changes: 3 additions & 3 deletions python/gritql/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def find_install() -> Path:
install_dir = dir_name / ".install"
target_dir = install_dir / "bin"

target_path = target_dir / "marzano"
temp_file = target_dir / "marzano.tmp"
target_path = target_dir / "grit"
temp_file = target_dir / "grit.tmp"

if target_path.exists():
_debug(f"{target_path} already exists")
Expand All @@ -67,7 +67,7 @@ def find_install() -> Path:
arch = _get_arch()
_debug(f"Using architecture {arch}")

file_name = f"marzano-{arch}-{platform}"
file_name = f"grit-{arch}-{platform}"
download_url = f"https://github.com/getgrit/gritql/releases/latest/download/{file_name}.tar.gz"

sys.stdout.write(f"Downloading Grit CLI from {download_url}\n")
Expand Down
8 changes: 4 additions & 4 deletions python/gritql/tests/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def test_find_install_download_grit_macos():

result = find_install()
assert isinstance(result, Path)
assert result.name == 'marzano'
assert result.name == 'grit'

# Test the URL that is called
expected_url = "https://github.com/getgrit/gritql/releases/latest/download/marzano-aarch64-apple-darwin.tar.gz"
expected_url = "https://github.com/getgrit/gritql/releases/latest/download/grit-aarch64-apple-darwin.tar.gz"
mock_client.return_value.__enter__.return_value.get.assert_called_once_with(expected_url, follow_redirects=True)

def test_find_install_download_grit_linux():
Expand All @@ -43,10 +43,10 @@ def test_find_install_download_grit_linux():

result = find_install()
assert isinstance(result, Path)
assert result.name == 'marzano'
assert result.name == 'grit'

# Test the URL that is called
expected_url = "https://github.com/getgrit/gritql/releases/latest/download/marzano-x86_64-unknown-linux-gnu.tar.gz"
expected_url = "https://github.com/getgrit/gritql/releases/latest/download/grit-x86_64-unknown-linux-gnu.tar.gz"
mock_client.return_value.__enter__.return_value.get.assert_called_once_with(expected_url, follow_redirects=True)

def test_find_install_windows():
Expand Down
4 changes: 2 additions & 2 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
version = "0.1.5"
version = "0.2.0"
dependencies = ["typer>=0.9.0", "httpx>=0.18.2"]

[project.optional-dependencies]
Expand All @@ -15,7 +15,7 @@ dev = ["pytest>=7.0"]

[tool.poetry]
name = "gritql"
version = "0.1.5"
version = "0.2.0"
description = "Python bindings for GritQL"
authors = ["Grit <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 67e36d7

Please sign in to comment.