Skip to content

Commit

Permalink
Merge branch 'mitsuhiko:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesChen0823 authored Feb 21, 2024
2 parents a598261 + 2b6c270 commit a7c6c4a
Show file tree
Hide file tree
Showing 52 changed files with 1,446 additions and 968 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ on:
push:
paths:
- 'docs/**'
- 'CHANGELOG.md'
- 'mkdocs.yml'
- 'scripts/install.sh'
branches:
- main
workflow_dispatch:

jobs:
build:
if: github.repository == 'mitsuhiko/rye'
name: Deploy docs
runs-on: ubuntu-latest
steps:
Expand All @@ -16,7 +21,6 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
if: github.repository == 'mitsuhiko/rye'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yml
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/sync-python-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# For this action to work you must explicitly allow GitHub Actions to create pull requests.
# This setting can be found in a repository's settings under Actions > General > Workflow permissions.
# For repositories belonging to an organization, this setting can be managed by
# admins in organization settings under Actions > General > Workflow permissions.
name: Sync Python Releases
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

permissions:
contents: write
pull-requests: write

jobs:
sync:
if: github.repository == 'mitsuhiko/rye'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rye
uses: eifinger/setup-rye@v1
with:
enable-cache: true
- name: Sync Python Releases
run: make sync-python-releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Sync latest Python releases"
add-paths: "rye/src/downloads.inc"
branch: "sync-python-releases"
title: "Sync Python Releases"
body: |
- Synced latest Python releases
<sup>Auto-generated by [sync-python-releases.yml](https://github.com/mitsuhiko/rye/blob/main/.github/workflows/sync-python-releases.yml)</sup>
34 changes: 30 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,33 @@
This file contains tracks the changes landing in Rye. It includes changes
that were not yet released.

## 0.25.0
## 0.26.0

_Unreleased_

- Bumped `uv` to 0.1.6. #719

- Bumped `ruff` to 0.2.2. #700

- Prevent `rye toolchain remove` from removing the currently active toolchain. #693

- Sync latest PyPy releases. #683

- Fixes an issue where when `uv` is enabled, `add` did not honor custom sources. #720

- When `uv` is enabled, rye will now automatically sync on `add` and `remove`. #677

- Rename `rye tools list` flags: `-i, --include-scripts` to `-s, --include-scripts` and `-v, --version-show` to `-v, --include-version`. #722

<!-- released start -->

## 0.25.0

Released on 2024-02-19

- Improved the error message if `config` is invoked without arguments. #660

- Bump `uv` to 0.1.3. #665, #675
- Bump `uv` to 0.1.5. #665, #675, #698

- When `uv` is enabled, `rye add` now uses `uv` instead of `unearth`
internally. #667
Expand All @@ -22,7 +42,13 @@ _Unreleased_

- Fixed the `-q` parameter not working for the `init` command. #686

<!-- released start -->
- `rye tools list` shows broken tools if the toolchain was removed. #692

- Configure the ruff cache directory to be located within the workspace root. #689

- Use default toolchain to install tools. #666

- `rye --version` now shows if `uv` is enabled. #699

## 0.24.0

Expand Down Expand Up @@ -160,7 +186,7 @@ Released on 2024-01-15

- Fixed default generated script reference. #527

- Correctly fall back to home folder if HOME is unset. #533
- Correctly fall back to home folder if HOME is unset. #533

## 0.16.0

Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ lint:

.venv:
@rye sync

.PHONY: sync-python-releases
sync-python-releases: .venv
@rye run find-downloads > rye/src/downloads.inc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Rye picks and ships the right tools so you can get started in minutes:
* **Managing Virtualenvs:** it uses the well established virtualenv library under the hood.
* **Building Wheels:** it delegates that work largely to [build](https://pypi.org/project/build/).
* **Publishing:** its publish command uses [twine](https://pypi.org/project/twine/) to accomplish this task.
* **Locking and Dependency Installation:** is today implemented by using [unearth](https://pypi.org/project/unearth/) and [pip-tools](https://github.com/jazzband/pip-tools/).
* **Locking and Dependency Installation:** is today implemented by using [uv](https://github.com/astral-sh/uv) with a fallback to [unearth](https://pypi.org/project/unearth/) and [pip-tools](https://github.com/jazzband/pip-tools/).
* **Workspace support:** Rye lets you work with complex projects consisting
of multiple libraries.

Expand Down
21 changes: 18 additions & 3 deletions docs/guide/commands/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ but provides additional helper arguments to make this process more user friendly
instance instead of passing git references within the requiement string, the `--git`
parameter can be used.

After a dependency is added it's not automatically installed. To do that, you need to
invoke the [`sync`](sync.md) command. To remove a dependency again use the [`remove`](remove.md)
command.
If auto sync is disabled, after a dependency is added it's not automatically
installed. To do that, you need to invoke the [`sync`](sync.md) command or pass
`--sync`. To remove a dependency again use the [`remove`](remove.md) command.

+++ 0.26.0

Added support for auto-sync and the `--sync` / `--no-sync` flags.

## Example

Expand All @@ -32,6 +36,13 @@ $ rye add flask --git https://github.com/pallets/flask
Added flask @ git+https://github.com/pallets/flask as regular dependency
```

Add a local dependency:

```
$ rye add packagename --path path/to/packagename
Added packagename @ file:///path/to/packagename as regular dependency
```

## Arguments

* `<REQUIREMENTS>...`: The package to add as PEP 508 requirement string. e.g. 'flask==2.2.3'
Expand Down Expand Up @@ -64,6 +75,10 @@ Added flask @ git+https://github.com/pallets/flask as regular dependency

* `--pin <PIN>`: Overrides the pin operator [possible values: `equal`, `tilde-equal``, `greater-than-equal``]

* `--sync`: Runs `sync` automatically even if auto-sync is disabled.

* `--no-sync`: Does not run `sync` automatically even if auto-sync is enabled.

* `-v, --verbose`: Enables verbose diagnostics

* `-q, --quiet`: Turns off all output
Expand Down
12 changes: 12 additions & 0 deletions docs/guide/commands/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Removes a package from this project. This removes a package from the `pyproject.toml`
dependency list.

If auto sync is disabled, after a dependency is removed it's not automatically
uninstalled. To do that, you need to invoke the [`sync`](sync.md) command or pass
`--sync`.

+++ 0.26.0

Added support for auto-sync and the `--sync` / `--no-sync` flags.

## Example

```
Expand All @@ -20,6 +28,10 @@ Removed flask>=3.0.1

* `--optional <OPTIONAL>`: Remove this from the optional dependency group

* `--sync`: Runs `sync` automatically even if auto-sync is disabled.

* `--no-sync`: Does not run `sync` automatically even if auto-sync is enabled.

* `-v, --verbose`: Enables verbose diagnostics

* `-q, --quiet`: Turns off all output
Expand Down
1 change: 1 addition & 0 deletions docs/guide/commands/toolchain/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ Removed installed toolchain [email protected]

## Options

* `-f, --force`: Force removal even if the toolchain is in use
* `-h, --help`: Print help (see a summary with '-h')
2 changes: 2 additions & 0 deletions docs/guide/commands/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Helper utility to manage global tool installations.
* [`install`](install.md): installs a tool globally.

* [`uninstall`](uninstall.md): uninstalls a globally installed tool.

* [`list`](list.md): lists all globally installed tools.
41 changes: 41 additions & 0 deletions docs/guide/commands/tools/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# `list`

Lists all already installed global tools.

For more information see [Tools](/guide/tools/).

## Example

List installed tools:

```
$ rye tools list
pycowsay
```

List installed tools with version:

```
$ rye tools list --include-version
pycowsay 0.0.0.2 ([email protected])
```

## Arguments

*no arguments*

## Options

* `-s, --include-scripts`: Show all the scripts installed by the tools

+/- 0.26.0

Renamed from `-i, --include-scripts` to `-s, --include-scripts`.

* `-v, --include-version`: Show the version of tools

+/- 0.26.0

Renamed from `-v, --version-show` to `-v, --include-version`.

* `-h, --help`: Print help
4 changes: 4 additions & 0 deletions docs/guide/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ global-python = false
# for pip-tools. Learn more about uv here: https://github.com/astral-sh/uv
use-uv = false

# Enable or disable automatic `sync` after `add` and `remove`. This defaults
# to `true` when uv is enabled and `false` otherwise.
autosync = true

# Marks the managed .venv in a way that cloud based synchronization systems
# like Dropbox and iCloud Files will not upload it. This defaults to true
# as a .venv in cloud storage typically does not make sense. Set this to
Expand Down
8 changes: 4 additions & 4 deletions docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ opt-out, or you run a custom shell you will need to do this manually.
```

In some setups `.profile` is not sourced, in which case you can add it to your
`.bashrc` instead:
`.bashrc`:

```bash
echo 'source "$HOME/.rye/env"' >> ~/.bashrc
Expand All @@ -81,15 +81,15 @@ opt-out, or you run a custom shell you will need to do this manually.
```

In some setups `.profile` is not sourced, in which case you can add it to your
`.zprofile` instead:
`.zprofile`:

```bash
echo 'source "$HOME/.rye/env"' >> ~/.zprofile
```

=== "Fish"

Since fish does not support `env` files, you instead need to add
Since fish does not support `env` files, you need to add
the shims directly. This can be accomplished by running this
command once:

Expand All @@ -99,7 +99,7 @@ opt-out, or you run a custom shell you will need to do this manually.

=== "Nushell"

Since nushell does not support `env` files, you instead need to add
Since nushell does not support `env` files, you need to add
the shims directly. This can be accomplished by adding this to your
`env.nu` file:

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ devserver = { cmd = "flask run --debug", env = { FLASK_APP = "./hello.py" } }

This is a special key that can be set instead of `cmd` to make a command invoke multiple
other commands. Each command will be executed one after another. If any of the commands
fails the rest of the commands won't be executed and instead the chain fails.
fails, the rest of the commands won't be executed and the chain fails.

```toml
[tool.rye.scripts]
Expand Down
27 changes: 21 additions & 6 deletions docs/guide/sync.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Syncing and Locking

Rye currently uses [pip-tools](https://github.com/jazzband/pip-tools) to download and install
dependencies. For this purpose it creates two "lockfiles" (called `requirements.lock` and
`requirements-dev.lock`). These are not real lockfiles but they fulfill a similar purpose
until a better solution has been implemented.
Rye supports two systems to manage dependencies:
[uv](https://github.com/astral-sh/uv) and
[pip-tools](https://github.com/jazzband/pip-tools). It currently defaults to
`pip-tools` but will offer you the option to use `uv` instead. `uv` will become
the default choice once it stabilzes as it offers significantly better performance.

Whenever `rye sync` is called, it will update lockfiles as well as the virtualenv. If you only
want to update the lockfiles, then `rye lock` can be used.
In order to download dependencies rye creates two "lockfiles" (called
`requirements.lock` and `requirements-dev.lock`). These are not real lockfiles
but they fulfill a similar purpose until a better solution has been implemented.

Whenever `rye sync` is called, it will update lockfiles as well as the
virtualenv. If you only want to update the lockfiles, then `rye lock` can be
used.

## Lock

Expand Down Expand Up @@ -93,3 +99,12 @@ lockfile (`requirements-dev.lock`).
```
rye sync --no-dev
```

## Limitations

Lockfiles depend on the platform they were generated on. This is a known limitation
in pip-tools.

For example, if your project relies on platform-specific packages and you generate
lockfiles on Windows, these lockfiles will include Windows-specific projects.
Consequently, they won't be compatible with other platforms like Linux or macOS.
Loading

0 comments on commit a7c6c4a

Please sign in to comment.