Skip to content

Commit

Permalink
Refactoring documentation, updating spec, switching repo to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
cmungall committed Jul 18, 2022
1 parent f07db10 commit 14e3da6
Show file tree
Hide file tree
Showing 24 changed files with 1,453 additions and 1,141 deletions.
113 changes: 61 additions & 52 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,67 @@
name: Build
# Built from:
# https://docs.github.com/en/actions/guides/building-and-testing-python
# https://github.com/snok/install-poetry#workflows-and-tips

on:
push:
branches: [ main ]
name: Build and test linkml-runtime

on: [pull_request]

jobs:
unittests-n-commits:
test:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Update requirements files and test
run: |
python -m pip install --upgrade pip
pip install pipenv-to-requirements
pipenv_to_requirements
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Run make file
run: |
make
- name: Run unit tests over output
run: |
pip install pipenv
pipenv install --dev
pipenv run python -m unittest discover -p 'test_*.py'
- name: Check in changes to requirements files
run: |
git add requirements*.txt
if [[ ! -z $(git status -s requirements*.txt) ]]
then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'Automatically generated requirements.txt and requirements-dev.txt' requirements*.txt
git push
fi
- name: Check updated content
run: |
find linkml_model -name __pycache__ -type d -prune -exec rm -rf '{}' '+'
git add --force docs linkml_model
if [[ ! -z $(git status -s .) ]]
then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'Updating generated outputs' .
git push
fi

#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v2

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

#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction

#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
run: make test

18 changes: 11 additions & 7 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@ jobs:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v2.2.2
with:
python-version: 3.8

- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
run: poetry install --no-interaction

- name: build a binary wheel dist
- name: Build source and wheel archives
run: |
rm -fr dist
python setup.py bdist_wheel sdist
poetry version $(git describe --tags --abbrev=0)
poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
Expand Down
4 changes: 0 additions & 4 deletions AUTHORS

This file was deleted.

131 changes: 0 additions & 131 deletions ChangeLog

This file was deleted.

35 changes: 0 additions & 35 deletions MAINTAINERS.md

This file was deleted.

Loading

0 comments on commit 14e3da6

Please sign in to comment.