Skip to content

Commit 0760b9f

Browse files
committed
Converted Repo to pyproject.toml Syntax and Poetry (#136)
* 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
1 parent fc8b9b0 commit 0760b9f

File tree

14 files changed

+896
-282
lines changed

14 files changed

+896
-282
lines changed

.github/workflows/deploy.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
name: Deploy
1+
name: Poetry Deployment
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
8-
deploy:
8+
all:
99

10-
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
python-version: ["3.8"]
14+
poetry-version: ["1.4"]
15+
os: ["ubuntu-latest"]
1116

17+
runs-on: ${{ matrix.os }}
1218
steps:
13-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
1420

1521
- name: Set up Python
16-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v4
1723
with:
18-
python-version: '3.x'
24+
python-version: ${{ matrix.python-version }}
1925

20-
- name: Install dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install build
26+
- name: Run Poetry Image
27+
uses: abatilo/actions-poetry@v2
28+
with:
29+
poetry-version: ${{ matrix.poetry-version }}
2430

25-
- name: Build package
26-
run: python -m build
31+
- name: Configure PyPI
32+
run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
2733

2834
- name: Publish package
29-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
30-
with:
31-
user: __token__
32-
password: ${{ secrets.PYPI_API_TOKEN }}
35+
run: poetry publish --build --no-interaction

.github/workflows/linter.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,43 @@
1-
name: PyTest & Doctest
1+
name: Poetry Testing
22

33
on:
44
pull_request:
55
branches: [main]
66

77
jobs:
8-
test:
8+
all:
99

10-
runs-on: ubuntu-latest
1110
strategy:
11+
fail-fast: true
1212
matrix:
1313
python-version: ["3.8", "3.9", "3.10", "3.11"]
14+
poetry-version: ["1.4"]
15+
os: [ubuntu-latest, macos-latest, windows-latest]
1416

17+
runs-on: ${{ matrix.os }}
1518
steps:
16-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
1720

1821
- name: Set up Python
19-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v4
2023
with:
2124
python-version: ${{ matrix.python-version }}
2225

23-
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install -r requirements.txt
27-
pip install -r docs/requirements.txt
26+
- name: Run Poetry Image
27+
uses: abatilo/actions-poetry@v2
28+
with:
29+
poetry-version: ${{ matrix.poetry-version }}
30+
31+
- name: Install Dependencies
32+
run: poetry install
2833

2934
- name: PyTest
30-
run: coverage run --source=snakemd -m pytest
35+
run: poetry run coverage run -m pytest
3136

3237
- name: Coverage
33-
run: coverage report
38+
run: poetry run coverage report
3439

3540
- name: Doctest
3641
run: |
3742
cd docs
38-
make doctest
43+
poetry run make doctest

.readthedocs.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ build:
44
os: ubuntu-22.04
55
tools:
66
python: "3.10"
7+
jobs:
8+
post_create_environment:
9+
- pip install poetry
10+
- poetry config virtualenvs.create false
11+
post_install:
12+
- poetry install --with docs
713

814
sphinx:
915
configuration: docs/conf.py
1016
builder: dirhtml
1117

1218
formats: all
13-
14-
python:
15-
install:
16-
- requirements: docs/requirements.txt

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
'sphinx.ext.autodoc',
3131
'sphinx_issues',
3232
'sphinx.ext.intersphinx',
33-
'sphinx.ext.doctest'
33+
'sphinx.ext.doctest',
34+
"sphinxcontrib.jquery",
3435
]
3536

3637
# Add any paths that contain templates here, relative to this directory.

0 commit comments

Comments
 (0)