Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch python to new installer #565

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading