Skip to content

Commit

Permalink
Merge pull request #1 from smkent/poetry
Browse files Browse the repository at this point in the history
Migrate from pipenv to Poetry
  • Loading branch information
smkent authored Feb 25, 2022
2 parents b81eb54 + c739a60 commit 870885e
Show file tree
Hide file tree
Showing 13 changed files with 966 additions and 872 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
exclude = ./.*

# vim: ft=cfg
43 changes: 28 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,67 @@ name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
build-test-publish:
name: "Python ${{ matrix.python-version }}"
name: Python ${{ matrix.python-version }}, Poetry ${{ matrix.poetry-version }}
runs-on: ubuntu-latest
env:
ENABLE_PYPI_PUBLISH: true
ENABLE_TEST_PYPI_PUBLISH: true
ENABLE_COVERAGE: true

strategy:
matrix:
python-version:
- "3.10"
poetry-version:
- "1.1.11"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "${{ matrix.python-version }}"
python-version: ${{ matrix.python-version }}

- name: 🐍 Install dependencies
run: python -m pip install --upgrade pip pipenv
- name: ✨ Install Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ matrix.poetry-version }}

- name: 🛠 Build
run: make
- name: 🐍 Install dependencies
run: poetry install

- name: 🔥 Test
run: make test
run: poetry run tox

- name: 📊 Upload coverage to Codecov
uses: codecov/codecov-action@v2
if: env.ENABLE_COVERAGE
with:
fail_ci_if_error: true

- name: 📦 Build package
run: make dist
if: env.ENABLE_PYPI_PUBLISH
run: poetry build

- name: 🔼 Upload to Test PyPI
- name: 🔼 Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
if: env.ENABLE_TEST_PYPI_PUBLISH
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

# - name: ☢ Upload to PyPI
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
- name: ☢️ Publish to PyPI
if: |
env.ENABLE_PYPI_PUBLISH &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}

concurrency:
group: ci-tests-${{ github.ref }}-1
Expand Down
49 changes: 0 additions & 49 deletions Makefile

This file was deleted.

26 changes: 0 additions & 26 deletions Pipfile

This file was deleted.

Loading

0 comments on commit 870885e

Please sign in to comment.