Skip to content

Commit

Permalink
Converted Repo to pyproject.toml Syntax and Poetry (#136)
Browse files Browse the repository at this point in the history
* Created empty project file

* Migrated existing setup file over

* Added project URLs

* Shifted over to poetry format

* Added pytest options

* Added the lock file

* Deleted requirements files

* Deleted setup file

* Incremented project version

* Toying around with coverage settings

* Maxed out coverage

* Deleted linter

* Incorporated poetry into CI workflow

* Added the installing command

* Trying the two lines instead

* Setup deployment script for pypi

* Reworked docs to include poetry
  • Loading branch information
jrg94 committed May 3, 2023
1 parent fc8b9b0 commit 0760b9f
Show file tree
Hide file tree
Showing 14 changed files with 896 additions and 282 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
name: Deploy
name: Poetry Deployment

on:
release:
types: [published]

jobs:
deploy:
all:

runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.8"]
poetry-version: ["1.4"]
os: ["ubuntu-latest"]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Run Poetry Image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Build package
run: python -m build
- name: Configure PyPI
run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: poetry publish --build --no-interaction
53 changes: 0 additions & 53 deletions .github/workflows/linter.yml

This file was deleted.

31 changes: 18 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
name: PyTest & Doctest
name: Poetry Testing

on:
pull_request:
branches: [main]

jobs:
test:
all:

runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
poetry-version: ["1.4"]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r docs/requirements.txt
- name: Run Poetry Image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Install Dependencies
run: poetry install

- name: PyTest
run: coverage run --source=snakemd -m pytest
run: poetry run coverage run -m pytest

- name: Coverage
run: coverage report
run: poetry run coverage report

- name: Doctest
run: |
cd docs
make doctest
poetry run make doctest
10 changes: 6 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ build:
os: ubuntu-22.04
tools:
python: "3.10"
jobs:
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry install --with docs

sphinx:
configuration: docs/conf.py
builder: dirhtml

formats: all

python:
install:
- requirements: docs/requirements.txt
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
'sphinx.ext.autodoc',
'sphinx_issues',
'sphinx.ext.intersphinx',
'sphinx.ext.doctest'
'sphinx.ext.doctest',
"sphinxcontrib.jquery",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
Loading

0 comments on commit 0760b9f

Please sign in to comment.