Skip to content

Commit

Permalink
rtx -> mise
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 11, 2024
2 parents 5c8b3d5 + e2a3c34 commit 5231815
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 25 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: jdxcode/rtx-action@v1
- uses: jdxcode/mise-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: mkdir -p ~/.local/share/rtx/plugins
- run: ln -s $PWD ~/.local/share/rtx/plugins/poetry
- run: rtx i poetry@latest
- run: rtx x poetry@latest -- poetry --version
- run: mkdir -p ~/.local/share/mise/plugins
- run: ln -s $PWD ~/.local/share/mise/plugins/poetry
- run: mise i poetry@latest
- run: mise x poetry@latest -- poetry --version

lint:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ fmt:
shfmt -w $(SHFMT_BASE_FLAGS) $(SH_SRCFILES)
.PHONY: fmt

fmt-check:
format-check:
shfmt -d $(SHFMT_BASE_FLAGS) $(SH_SRCFILES)
.PHONY: fmt-check
.PHONY: format-check

lint:
shellcheck $(SH_SRCFILES)
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# rtx-poetry
# mise-poetry

[Poetry](https://github.com/python-poetry/poetry) plugin for rtx version
[Poetry](https://github.com/python-poetry/poetry) plugin for mise version
manager

## Build History

[![Build history](https://buildstats.info/github/chart/rtx-plugins/rtx-poetry?branch=main)](https://github.com/rtx-plugins/rtx-poetry/actions)
[![Build history](https://buildstats.info/github/chart/mise-plugins/mise-poetry?branch=main)](https://github.com/mise-plugins/mise-poetry/actions)

## Installation

```bash
rtx plugin add poetry
mise plugin add poetry
```

## Usage

Check [rtx](https://github.com/jdxcode/rtx) readme for instructions on how to
Check [mise](https://github.com/jdx/mise) readme for instructions on how to
install & manage versions.

### Overriding installer
Expand All @@ -28,16 +28,16 @@ the hosted installer of your choosing, e.g. `get-poetry.py` or the new `install-
For example, to force `install-poetry.py` on 1.1.9:

```
MISE_POETRY_INSTALL_URL=https://install.python-poetry.org rtx install poetry 1.1.9
MISE_POETRY_INSTALL_URL=https://install.python-poetry.org mise install poetry 1.1.9
```

Doing so is not recommended and may result in poetry installations which
disregard the `rtx-python` plugin. See [issue #10](https://github.com/rtx-plugins/rtx-poetry/issues/10).
disregard the `mise-python` plugin. See [issue #10](https://github.com/mise-plugins/mise-poetry/issues/10).

## Virtualenv Activation

Automatically activate the poetry virtualenv when entering the directory with the following
`.rtx.toml`:
`.mise.toml`:

```toml
[tools]
Expand All @@ -48,4 +48,4 @@ python = '3.11' # must be after poetry so the poetry bin is first in PATH
## License

Licensed under the
[MIT license](https://github.com/rtx-plugins/rtx-poetry/blob/main/LICENSE).
[MIT license](https://github.com/mise-plugins/mise-poetry/blob/main/LICENSE).
2 changes: 1 addition & 1 deletion bin/exec-env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ setup_virtualenv() {
fi

if [[ ! -d $VIRTUAL_ENV ]]; then
echoerr "rtx-poetry: No virtualenv exists. Executing \`poetry install\` to create one."
echoerr "mise-poetry: No virtualenv exists. Executing \`poetry install\` to create one."
"$(poetry_bin)" install
VIRTUAL_ENV="$("$(poetry_bin)" env info --path)"
fi
Expand Down
8 changes: 4 additions & 4 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ install_poetry() {
config_vercomp="lt"
fi

if [[ -n ${MISE_POETRY_INSTALL_URL-} ]]; then
if [[ -n ${MISE_POETRY_INSTALL_URL:-} ]]; then
install_url=$MISE_POETRY_INSTALL_URL
elif [ "$install_vercomp" == "ge" ]; then
install_url="https://install.python-poetry.org"
Expand All @@ -52,13 +52,13 @@ install_poetry() {
fi

if [ "$config_vercomp" == "ge" ]; then
# Ensure that poetry behaves as expected with rtx python (pyenv)
echo Configuring poetry to behave properly with rtx ...
# Ensure that poetry behaves as expected with mise python (pyenv)
echo Configuring poetry to behave properly with mise ...
echo Running: \"poetry config virtualenvs.prefer-active-python true\".
echo ""
"$install_path"/bin/poetry config virtualenvs.prefer-active-python true
else
echo Warning: Poetry versions prior to 1.2.0 may not work properly with rtx.
echo Warning: Poetry versions prior to 1.2.0 may not work properly with mise.
echo Consider upgrading to a later version.
echo https://github.com/asdf-community/asdf-poetry/issues/10
fi
Expand Down
3 changes: 3 additions & 0 deletions bin/list-legacy-filenames
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

echo ".poetry-version"
2 changes: 1 addition & 1 deletion bin/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ poetry_venv() {
pyproject="${MISE_PROJECT_ROOT-}/$pyproject"
fi
if [[ ! -f $pyproject ]]; then
echoerr "rtx-poetry: No pyproject.toml found. Execute \`poetry init\` to create \`$pyproject\` first."
echoerr "mise-poetry: No pyproject.toml found. Execute \`poetry init\` to create \`$pyproject\` first."
return
fi
"$(poetry_bin)" env info --path 2>/dev/null
Expand Down
2 changes: 1 addition & 1 deletion rtx.plugin.toml → mise.plugin.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#:schema https://rtx.pub/schema/rtx.plugin.json
#:schema https://mise.jdx.dev/schema/mise.plugin.json

[exec-env]
cache-key = [
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "rtx-poetry"
name = "mise-poetry"
version = "0.1.0"
description = ""
authors = ["Jeff Dickey <[email protected]>"]
Expand Down
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "schedule:daily"]
}

0 comments on commit 5231815

Please sign in to comment.