Skip to content

Commit

Permalink
Remove poetry (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
moble authored Nov 28, 2023
1 parent 074b626 commit 4e7edb8
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 1,335 deletions.
91 changes: 33 additions & 58 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
name: tests

on: [push]
on:
push:
branches:
- main
tags: ['*']
pull_request:

concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:

build:
name: ${{ matrix.os }} python ${{ matrix.python-version }}
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}

runs-on: ${{ matrix.os }}

Expand All @@ -21,38 +34,22 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
shell: bash
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME="$HOME/.poetry" python -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Build and install with poetry
shell: bash
run: |
poetry run python -m pip install --upgrade pip
poetry env info
rm poetry.lock
poetry update
poetry build
poetry install --no-interaction
- name: Install Hatch
run: pip install --upgrade hatch

- name: Run tests
shell: bash
run: |
poetry run pytest -s --cov=quaternionic --cov-branch --cov-report=xml --durations=0
run: hatch run test

- name: Upload coverage
if: "matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'"
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3


release:
Expand All @@ -66,35 +63,15 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install toml
if: ${{ env.skipping_build_and_test_replicate != 'true' }}
shell: bash
run: |
python -m pip install --upgrade pip toml
- name: Install poetry
shell: bash
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME="$HOME/.poetry" python -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Build and install with poetry
if: ${{ env.skipping_build_and_test_replicate != 'true' }}
shell: bash
run: |
$HOME/.poetry/bin/poetry run python -m pip install --upgrade pip
$HOME/.poetry/bin/poetry env info
rm poetry.lock
$HOME/.poetry/bin/poetry update
$HOME/.poetry/bin/poetry build
$HOME/.poetry/bin/poetry install --no-interaction --no-dev
- name: Install Hatch
run: pip install --upgrade hatch

- name: Bump version
shell: bash
Expand All @@ -103,10 +80,10 @@ jobs:
run: |
export version_bump_rule=$(python .github/scripts/parse_bump_rule.py)
echo "version_bump_rule: '${version_bump_rule}'"
$HOME/.poetry/bin/poetry version "${version_bump_rule}"
export new_version=$(python .github/scripts/parse_version.py pyproject.toml)
hatch version "${version_bump_rule}"
export new_version=$(hatch version)
echo "new_version: '${new_version}'"
echo "new_version=${new_version}" >> $GITHUB_ENV
echo "new_version=${new_version}" >> $GITHUB_ENV # Save env variable for later steps
- name: Tag and push new version
shell: bash
Expand Down Expand Up @@ -136,10 +113,8 @@ jobs:
env:
# 1) Get key from https://pypi.org/manage/account/token/
# 2) Copy it to Github > repo > Settings > Secrets
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
shell: bash
run: |
# Do these first two steps again to ensure the version is right
$HOME/.poetry/bin/poetry build
$HOME/.poetry/bin/poetry install --no-interaction --no-dev
$HOME/.poetry/bin/poetry publish
hatch publish
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Michael Boyle
Copyright (c) 2023 Michael Boyle

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 4e7edb8

Please sign in to comment.