Skip to content

Commit

Permalink
Add Pyston
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Mar 5, 2024
1 parent d2ae893 commit 195f6b0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/system-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ jobs:
- name: "Validate global Python install"
run: pypy scripts/check_system_python.py --uv ./target/debug/uv

install-pyston:
name: "Install Pyston"
runs-on: ubuntu-latest
container: pyston/pyston:2.3.5
steps:
- uses: actions/checkout@v4

- name: "Install Rust toolchain"
run: apt-get update && apt-get install -y curl build-essential && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

- uses: Swatinem/rust-cache@v2

- name: "Build"
run: $HOME/.cargo/bin/cargo build --no-default-features

- name: "Print Python path"
run: echo $(which pyston)

- name: "Validate global Python install"
run: pyston scripts/check_system_python.py --uv ./target/debug/uv

install-macos:
name: "Install Python on macOS"
runs-on: macos-14
Expand Down
12 changes: 12 additions & 0 deletions crates/platform-tags/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ impl TryFrom<usize> for TagPriority {
pub enum Implementation {
CPython,
PyPy,
Pyston,
}

impl Implementation {
Expand All @@ -267,6 +268,8 @@ impl Implementation {
Self::CPython => format!("cp{}{}", python_version.0, python_version.1),
// Ex) `pp39`
Self::PyPy => format!("pp{}{}", python_version.0, python_version.1),
// Ex) `pt38``
Self::Pyston => format!("pt{}{}", python_version.0, python_version.1),
}
}

Expand All @@ -288,6 +291,14 @@ impl Implementation {
implementation_version.0,
implementation_version.1
),
// Ex) `pyston38-pyston_23`
Self::Pyston => format!(
"pyston{}{}-pyston_{}{}",
python_version.0,
python_version.1,
implementation_version.0,
implementation_version.1
),
}
}
}
Expand All @@ -300,6 +311,7 @@ impl FromStr for Implementation {
// Known and supported implementations.
"cpython" => Ok(Self::CPython),
"pypy" => Ok(Self::PyPy),
"pyston" => Ok(Self::Pyston),
// Known but unsupported implementations.
"python" => Err(TagsError::UnsupportedImplementation(s.to_string())),
"ironpython" => Err(TagsError::UnsupportedImplementation(s.to_string())),
Expand Down

0 comments on commit 195f6b0

Please sign in to comment.