Skip to content

Commit

Permalink
Merge pull request #495 from cunarist/uv-package-manager
Browse files Browse the repository at this point in the history
Switch to `uv` for Python dependency resolution
  • Loading branch information
temeddix authored Jan 3, 2025
2 parents 29ab804 + 0534146 commit df301c3
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _Please describe the exact steps to reproduce the error._

_Please provide the output from the command below, using markdown codeblock syntax._

```bash
```shell
rustc --version
flutter doctor
```
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ target/
# Others
*.lock
/documentation/site/
.python-version
24 changes: 6 additions & 18 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
# Documentation

In order to preview and build this documentation, you need to have Python and [Poetry](https://python-poetry.org/docs/) installed on your system.

Activate the virtual environment.

```bash
poetry shell
```

Install Python dependencies.

```bash
poetry install
```
In order to preview and build this documentation, ensure you have [`uv`](https://docs.astral.sh/uv/getting-started/installation/), the modern Python package manager, installed on your system.

Activate test server during development.

```bash
mkdocs serve
```shell
uv run mkdocs serve
```

Activate test server during development.
Build the documentation.

```bash
mkdocs build
```shell
uv run mkdocs build
```
6 changes: 3 additions & 3 deletions documentation/docs/applying-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

First of all, add this framework to your Flutter project.

```bash title="CLI"
```shell title="CLI"
flutter pub add rinf
```

Now install the command executable to easily run Rinf commands in the CLI.[^1]

[^1]: If you're curious about all the available commands, use `rinf --help`.

```bash title="CLI"
```shell title="CLI"
cargo install rinf
```

Then, simply run this in the command-line[^2] from your Flutter project's directory.

[^2]: If you encounter issues with the automated `protoc` installation, likely due to GitHub API access restrictions, you can [manually install it](https://grpc.io/docs/protoc-installation/) on your machine and add it to PATH. You can verify the installation by running the command `protoc --version` to ensure that the Protobuf compiler is ready on your machine. Rinf will detect and use the manually installed `protoc` if it exists.

```bash title="CLI"
```shell title="CLI"
rinf template
```

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rinf:
You can check the current configuration status by running the command below in the CLI.
```bash title="CLI"
```shell title="CLI"
rinf config
```

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/detailed-techniques.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ When you generate message code using the `rinf message` command, the resulting D

If you add the optional argument `-w` or `--watch` to the `rinf message` command, the message code will be automatically generated when `.proto` files are modified. If you add this argument, the command will not exit on its own.

```bash title="CLI"
```shell title="CLI"
rinf message --watch
```

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/frequently-asked-questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Ensure that you import the necessary well-known type(s) at the beginning of your

Open your terminal and navigate to the root directory of your Dart project. Then, use the `protoc` command to compile the well-known type to Dart. For example, to compile the `Timestamp` type, you can run the following command:

```bash title="CLI"
```shell title="CLI"
protoc --dart_out=./lib/messages google/protobuf/timestamp.proto
```

Expand Down Expand Up @@ -161,7 +161,7 @@ Exception: Unable to generate build files

This error can simply be fixed with the command below.

```bash title="CLI"
```shell title="CLI"
flutter clean
cargo clean
```
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/installing-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To get started, you need to have [Flutter SDK](https://docs.flutter.dev/get-star

Once you're done with the installations, verify your system's readiness with the following commands. Make sure you have installed all the subcomponents that Flutter suggests. If there are no issues in the output, you are good to go onto the next step!

```bash title="CLI"
```shell title="CLI"
rustc --version
flutter doctor
```
8 changes: 4 additions & 4 deletions documentation/docs/running-and-building.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ The following commands are just enough to run and build apps for native platform

To run the app:

```bash title="CLI"
```shell title="CLI"
flutter run
```

To build the app for a specific platform:

```bash title="CLI"
```shell title="CLI"
flutter build [platform] # Replace it with a platform name
```

Expand All @@ -30,7 +30,7 @@ To serve[^3] the web application[^4]:

[^4]: Since repeatedly writing web header arguments during development can be overwhelming, Rinf provides a convenient command `rinf server` that prints the full Flutter web command.

```bash title="CLI"
```shell title="CLI"
rinf wasm
flutter run --web-header=Cross-Origin-Opener-Policy=same-origin --web-header=Cross-Origin-Embedder-Policy=require-corp
```
Expand All @@ -39,7 +39,7 @@ To build the optimized release version of the web application[^5]:

[^5]: Rinf supports hosting a Flutter app at a [non-root location](https://docs.flutter.dev/ui/navigation/url-strategies#hosting-a-flutter-app-at-a-non-root-location). For example, you can place your Flutter app in `https://mywebsite.com/subpath/deeperpath/`.

```bash title="CLI"
```shell title="CLI"
rinf wasm --release
flutter build web
```
Expand Down
6 changes: 3 additions & 3 deletions documentation/docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ message MyPreciousData {

Next, generate Dart and Rust message code from `.proto` files.

```bash title="CLI"
```shell title="CLI"
rinf message
```

Expand Down Expand Up @@ -113,7 +113,7 @@ message MyAmazingNumber { int32 current_number = 1; }

Generate Dart and Rust message code from `.proto` files.

```bash title="CLI"
```shell title="CLI"
rinf message
```

Expand Down Expand Up @@ -183,7 +183,7 @@ message MyTreasureInput {}
message MyTreasureOutput { int32 current_value = 1; }
```

```bash title="CLI"
```shell title="CLI"
rinf message
```

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ use crate::messages::*;

When you need to run a Flutter web server, use `rinf server` to get the complete Flutter command with the necessary arguments.

```bash title="CLI"
```shell title="CLI"
rinf server
```
21 changes: 11 additions & 10 deletions documentation/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[tool.poetry]
package-mode = false

[tool.poetry.dependencies]
python = "^3.10"
mkdocs = "^1.6.1"
mkdocs-material = "^9.5.34"
mkdocs-awesome-pages-plugin = "^2.9.3"
mkdocs-glightbox = "^0.4.0"
mkdocs-git-revision-date-localized-plugin = "^1.2.9"
[project]
name = "rinf-documentation"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = [
"mkdocs~=1.6.1",
"mkdocs-material~=9.5.34",
"mkdocs-awesome-pages-plugin~=2.9.3",
"mkdocs-glightbox~=0.4.0",
"mkdocs-git-revision-date-localized-plugin~=1.2.9",
]
8 changes: 4 additions & 4 deletions flutter_package/bin/src/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ installed on your system.
You can check that your system is ready with the commands below.
Note that all the Flutter subcomponents should be installed.
```bash
```shell
rustc --version
flutter doctor
```
You also need to have the CLI tool for Rinf ready.
```bash
```shell
cargo install rinf
```
Expand All @@ -121,13 +121,13 @@ If you have newly cloned the project repository
or made changes to the `.proto` files in the `./messages` directory,
run the following command:
```bash
```shell
rinf message
```
Now you can run and build this app just like any other Flutter projects.
```bash
```shell
flutter run
```
Expand Down
8 changes: 4 additions & 4 deletions flutter_package/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ installed on your system.
You can check that your system is ready with the commands below.
Note that all the Flutter subcomponents should be installed.

```bash
```shell
rustc --version
flutter doctor
```

You also need to have the CLI tool for Rinf ready.

```bash
```shell
cargo install rinf
```

Expand All @@ -31,13 +31,13 @@ If you have newly cloned the project repository
or made changes to the `.proto` files in the `./messages` directory,
run the following command:

```bash
```shell
rinf message
```

Now you can run and build this app just like any other Flutter projects.

```bash
```shell
flutter run
```

Expand Down

0 comments on commit df301c3

Please sign in to comment.