Skip to content

Commit ac49d7c

Browse files
chore(internal): migrate from Poetry to Rye (#136)
1 parent 2e278bd commit ac49d7c

11 files changed

+152
-1104
lines changed

.github/workflows/create-releases.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ jobs:
1919
repo: ${{ github.event.repository.full_name }}
2020
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
2121

22-
- name: Set up Python
22+
- name: Install Rye
2323
if: ${{ steps.release.outputs.releases_created }}
24-
uses: actions/setup-python@v4
25-
with:
26-
python-version: '3.7'
24+
run: |
25+
curl -sSf https://rye-up.com/get | bash
26+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
27+
env:
28+
RYE_VERSION: 0.15.2
29+
RYE_INSTALL_OPTION: "--yes"
2730

2831
- name: Publish to PyPI
2932
if: ${{ steps.release.outputs.releases_created }}
3033
run: |
31-
pipx install poetry
3234
bash ./bin/publish-pypi
3335
env:
3436
PYPI_TOKEN: ${{ secrets.FINCH_PYPI_TOKEN }}

.github/workflows/publish-pypi.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v3
1414

15-
- name: Set up Python
16-
uses: actions/setup-python@v4
17-
with:
18-
python-version: '3.7'
15+
- name: Install Rye
16+
run: |
17+
curl -sSf https://rye-up.com/get | bash
18+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
19+
env:
20+
RYE_VERSION: 0.15.2
21+
RYE_INSTALL_OPTION: "--yes"
1922

2023
- name: Publish to PyPI
2124
run: |
22-
pipx install poetry
2325
bash ./bin/publish-pypi
2426
env:
2527
PYPI_TOKEN: ${{ secrets.FINCH_PYPI_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ __pycache__
66

77
dist
88

9+
.venv
10+
911
.env
1012
codegen.log

bin/publish-pypi

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22

33
set -eux
4-
poetry config pypi-token.pypi $PYPI_TOKEN
5-
poetry publish --build
4+
mkdir dist
5+
rye build --clean
6+
rye publish --yes --token=$PYPI_TOKEN

bin/test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
bin/check-test-server && poetry run pytest "$@"
3+
bin/check-test-server && rye run pytest "$@"

noxfile.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import nox
2-
import nox_poetry
32

43

5-
@nox_poetry.session(reuse_venv=True, name="test-pydantic-v1")
4+
@nox.session(reuse_venv=True, name="test-pydantic-v1")
65
def test_pydantic_v1(session: nox.Session) -> None:
7-
session.run_always("poetry", "install", external=True)
8-
9-
# https://github.com/cjolowicz/nox-poetry/issues/1116
10-
session._session.run("python", "-m", "pip", "install", "pydantic<2", external=True) # type: ignore
6+
session.install("-r", "requirements-dev.lock")
7+
session.install("pydantic<2")
118

129
session.run("pytest", "--showlocals", "--ignore=tests/functional", *session.posargs)

0 commit comments

Comments
 (0)