Change Prettier settings (#36)

## Summary

I know this is a little tedious but I'd prefer to use the same settings
as in Ruff.
This commit is contained in:
Charlie Marsh 2024-09-05 08:06:45 -04:00 committed by GitHub
parent 1785c7bde0
commit 182c9c7e92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 5536 additions and 5497 deletions

View file

@ -23,7 +23,8 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
## Usage
Example workflow in a real world project can be found [here](https://github.com/eifinger/hass-weenect/blob/main/.github/workflows/ci.yml)
Example workflow in a real world project can be found
[here](https://github.com/eifinger/hass-weenect/blob/main/.github/workflows/ci.yml)
### Install specific version
@ -33,47 +34,46 @@ You can also specify a specific version of uv
- name: Install a specific version
uses: astral-sh/setup-uv@v1
with:
version: '0.4.4'
version: "0.4.4"
```
### Install latest version
By default this action installs the version defined as `default` in `action.yml`.
This gets automatically updated in a new release of this action when a new version of uv is released.
If you don't want to wait for a new release of this action you can use `version: latest`.
By default this action installs the version defined as `default` in `action.yml`. This gets
automatically updated in a new release of this action when a new version of uv is released. If you
don't want to wait for a new release of this action you can use `version: latest`.
> [!WARNING]
> Using the `latest` version means that the uv executable gets downloaded every single time instead of loaded from the tools cache.
> This can take up to 20s depending on the download speed.
> This does not affect the uv cache.
> Using the `latest` version means that the uv executable gets downloaded every single time instead
> of loaded from the tools cache. This can take up to 20s depending on the download speed. This does
> not affect the uv cache.
```yaml
- name: Install a specific version
uses: astral-sh/setup-uv@v1
with:
version: 'latest'
version: "latest"
```
### Validate checksum
You can also specify a checksum to validate the downloaded file.
Checksums up to the default version are automatically verified by this action.
The sha265 hashes can be found on the [releases page](https://github.com/astral-sh/uv/releases)
of the uv repo.
You can also specify a checksum to validate the downloaded file. Checksums up to the default version
are automatically verified by this action. The sha265 hashes can be found on the
[releases page](https://github.com/astral-sh/uv/releases) of the uv repo.
```yaml
- name: Install a specific version and validate the checksum
uses: astral-sh/setup-uv@v1
with:
version: '0.3.1'
checksum: 'e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8'
version: "0.3.1"
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
```
### Enable caching
If you enable caching the [uv cache](https://docs.astral.sh/uv/concepts/cache/) will
be cached to the GitHub Actions Cache. This can speed up runs which can reuse the cache
by several minutes. The cache will always be reused on self-hosted runners.
If you enable caching the [uv cache](https://docs.astral.sh/uv/concepts/cache/) will be cached to
the GitHub Actions Cache. This can speed up runs which can reuse the cache by several minutes. The
cache will always be reused on self-hosted runners.
You can optionally define a custom cache key suffix.
@ -83,11 +83,11 @@ You can optionally define a custom cache key suffix.
uses: astral-sh/setup-uv@v1
with:
enable-cache: true
cache-suffix: 'optional-suffix'
cache-suffix: "optional-suffix"
```
When the cache was successfully restored the output `cache-hit` will be set to `true` and you can use it in subsequent steps.
For the example above you can use it like this:
When the cache was successfully restored the output `cache-hit` will be set to `true` and you can
use it in subsequent steps. For the example above you can use it like this:
```yaml
- name: Do something if the cache was restored
@ -105,21 +105,21 @@ you can specify the path with the `cache-local-path` input.
uses: astral-sh/setup-uv@v1
with:
enable-cache: true
cache-local-path: '/path/to/cache'
cache-local-path: "/path/to/cache"
```
#### Cache dependency glob
If you want to control when the cache is invalidated you can specify a glob pattern with the `cache-dependency-glob` input.
The cache will be invalidated if any file matching the glob pattern changes.
The glob matches files relative to the repository root.
If you want to control when the cache is invalidated you can specify a glob pattern with the
`cache-dependency-glob` input. The cache will be invalidated if any file matching the glob pattern
changes. The glob matches files relative to the repository root.
```yaml
- name: Define a cache dependency glob
uses: astral-sh/setup-uv@v1
with:
enable-cache: true
cache-dependency-glob: 'uv.lock'
cache-dependency-glob: "uv.lock"
```
```yaml
@ -127,12 +127,13 @@ The glob matches files relative to the repository root.
uses: astral-sh/setup-uv@v1
with:
enable-cache: true
cache-dependency-glob: '**requirements*.txt'
cache-dependency-glob: "**requirements*.txt"
```
### API rate limit
To avoid hitting the error `API rate limit exceeded` you can supply a GitHub token with the `github-token` input.
To avoid hitting the error `API rate limit exceeded` you can supply a GitHub token with the
`github-token` input.
```yaml
- name: Install uv and supply a GitHub token
@ -143,9 +144,12 @@ To avoid hitting the error `API rate limit exceeded` you can supply a GitHub tok
## How it works
This action downloads uv from the releases of the [uv repo](https://github.com/astral-sh/uv) and uses the [GitHub Actions Toolkit](https://github.com/actions/toolkit) to cache it as a tool to speed up consecutive runs on self-hosted runners.
This action downloads uv from the releases of the [uv repo](https://github.com/astral-sh/uv) and
uses the [GitHub Actions Toolkit](https://github.com/actions/toolkit) to cache it as a tool to speed
up consecutive runs on self-hosted runners.
The installed version of uv is then added to the runner path so other steps can just use it by calling `uv`.
The installed version of uv is then added to the runner path so other steps can just use it by
calling `uv`.
## FAQ
@ -166,7 +170,8 @@ A simple example workflow could look like this:
run: uv run --frozen pytest
```
If you want to have a specific python version installed you can use the command [`uv python install`](https://docs.astral.sh/uv/guides/install-python/):
If you want to have a specific python version installed you can use the command
[`uv python install`](https://docs.astral.sh/uv/guides/install-python/):
```yaml
- name: Install the latest version of uv
@ -179,10 +184,12 @@ If you want to have a specific python version installed you can use the command
### What is the default version?
By default, this action installs the version defined as `default` in `action.yml`.
When a new release of uv is published this triggers an automatic release of this action with the new version as `default`.
By default, this action installs the version defined as `default` in `action.yml`. When a new
release of uv is published this triggers an automatic release of this action with the new version as
`default`.
If you have to know the version installed for other steps of your workflow you can use the `uv-version` output:
If you have to know the version installed for other steps of your workflow you can use the
`uv-version` output:
```yaml
- name: Checkout the repository
@ -197,8 +204,9 @@ If you have to know the version installed for other steps of your workflow you c
## Acknowledgements
`setup-uv` was initially written and published by [Kevin Stillhammer](https://github.com/eifinger)
before moving under the official [Astral](https://github.com/astral-sh) GitHub organization. You
can support Kevin's work in open source on [Buy me a coffee](https://www.buymeacoffee.com/eifinger) or [PayPal](https://paypal.me/kevinstillhammer).
before moving under the official [Astral](https://github.com/astral-sh) GitHub organization. You can
support Kevin's work in open source on [Buy me a coffee](https://www.buymeacoffee.com/eifinger) or
[PayPal](https://paypal.me/kevinstillhammer).
## License