Skip to content

Commit

Permalink
Project: Change to rye
Browse files Browse the repository at this point in the history
  • Loading branch information
gutzbenj committed Jul 23, 2024
1 parent c9e4b25 commit 50a78ce
Show file tree
Hide file tree
Showing 6 changed files with 984 additions and 301 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,9 @@ set -e
set -x

if [ "${flavor}" = "testing" ]; then
poetry install --verbose --no-interaction \
--with=test,dev \
--extras=bufr \
--extras=explorer \
--extras=export \
--extras=import \
--extras=interpolation \
--extras=ipython \
--extras=radar \
--extras=radarplus \
--extras=restapi \
--extras=sql
uv pip install .[bufr,explorer,export,import,interpolation,ipython,radar,radarplus,restapi,sql]

elif [ "${flavor}" = "docs" ]; then
poetry install --verbose --no-interaction --with=docs --extras=interpolation
uv pip install .[interpolation]

fi
35 changes: 20 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,27 @@ jobs:
- name: Acquire sources
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Setup Python
id: python-setup
uses: actions/setup-python@v5
- name: Install Rye
uses: eifinger/setup-rye@v4
with:
python-version: "3.12"
architecture: x64
cache: poetry
cache-dependency-path: |
pyproject.toml
poetry.lock
enable-cache: true

# - name: Setup Python
# id: python-setup
# uses: actions/setup-python@v5
# with:
# python-version: "3.12"
# architecture: x64
# cache: poetry
# cache-dependency-path: |
# pyproject.toml
# requirements.txt

- name: Pin python version
run: rye pin 3.12

- name: Install project tooling
run: poetry install --no-interaction --no-root --with=dev
- name: Install project
run: rye sync

- name: Run code-style checks
run: poetry run poe lint
run: rye run poe lint
62 changes: 34 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,41 @@ jobs:
# Workaround until pipx is available on M1 machines
# - https://github.com/actions/runner-images/issues/9256
# We install poetry using brew instead of pipx
- name: Install Poetry (Mac M1 only)
if: ${{ startsWith(matrix.os, 'macos-14') }}
run: brew install poetry
# - name: Install Poetry (Mac M1 only)
# if: ${{ startsWith(matrix.os, 'macos-14') }}
# run: brew install poetry
#
# - name: Install Poetry
# if: ${{ !startsWith(matrix.os, 'macos-14') }}
# run: pipx install poetry
#
# - name: Setup Python
# if: ${{ !startsWith(matrix.os, 'macos-14') }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# architecture: x64
# cache: poetry
# cache-dependency-path: |
# pyproject.toml
# poetry.lock
#
# - name: Setup Python (Mac M1 only)
# if: ${{ startsWith(matrix.os, 'macos-14') }}
# run: |
# brew install pyenv
# pyenv install ${{ matrix.python-version }}
# pyenv global ${{ matrix.python-version }}
#
# export PYENV_ROOT="$HOME/.pyenv"
# [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
# eval "$(pyenv init -)"

- name: Pin python version
run: rye pin ${{ matrix.python-version }}

- name: Install Poetry
if: ${{ !startsWith(matrix.os, 'macos-14') }}
run: pipx install poetry

- name: Setup Python
if: ${{ !startsWith(matrix.os, 'macos-14') }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: poetry
cache-dependency-path: |
pyproject.toml
poetry.lock
- name: Setup Python (Mac M1 only)
if: ${{ startsWith(matrix.os, 'macos-14') }}
run: |
brew install pyenv
pyenv install ${{ matrix.python-version }}
pyenv global ${{ matrix.python-version }}
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
- name: Install project
run: rye sync

- name: Install eccodes (Mac only)
if: ${{ startsWith(matrix.os, 'macos-') }}
Expand Down
Loading

0 comments on commit 50a78ce

Please sign in to comment.