Skip to content

Commit

Permalink
chore: update github action versions
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Mar 25, 2024
1 parent d91c2cd commit 7cc1e55
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
arch: x86

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- run: npx changelogithub
continue-on-error: true
Expand All @@ -27,8 +27,7 @@ jobs:
python-version: "3.10"
- name: Build artifacts
run: |
pip install build
python -m build
pipx run build
- name: Test Build
run: |
python -m venv fresh_env
Expand All @@ -37,5 +36,4 @@ jobs:
findpython --all
- name: Upload to Pypi
run: |
pip install twine
twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*
pipx run twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*
15 changes: 7 additions & 8 deletions src/findpython/providers/rye.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import shutil
import os
import typing as t
from pathlib import Path

Expand All @@ -10,19 +10,18 @@


class RyeProvider(BaseProvider):
def __init__(self) -> None:
self.root = Path.home() / ".rye"
self.rye_bin = shutil.which("rye")
def __init__(self, root: Path) -> None:
self.root = root

@classmethod
def create(cls) -> t.Self | None:
return cls()
root = Path(os.getenv("RYE_PY_ROOT", "~/.rye/py")).expanduser()
return cls(root)

def find_pythons(self) -> t.Iterable[PythonVersion]:
py_root = self.root / "py"
if not py_root.exists():
if not self.root.exists():
return
for child in safe_iter_dir(py_root):
for child in safe_iter_dir(self.root):
if child.is_symlink(): # registered an existing python
continue
for intermediate in ("", "install/"):
Expand Down
4 changes: 2 additions & 2 deletions src/findpython/providers/winreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def find_pythons(self) -> t.Iterable[PythonVersion]:
except AttributeError:
continue
if path.exists():
version = getattr(version.info, "version", None)
py_version = getattr(version.info, "version", None)
py_ver = self.version_maker(
path,
Version(version) if version else None,
Version(py_version) if py_version else None,
getattr(version.info, "sys_architecture", SYS_ARCHITECTURE),
path,
)
Expand Down

0 comments on commit 7cc1e55

Please sign in to comment.