Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.1.2 #95

Merged
merged 54 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b747f7e
Add support for UUIDs in request payloads
samamorgan Sep 19, 2023
8e399d9
Refactor util tests
samamorgan Sep 19, 2023
ab9bfe2
Merge pull request #86 from Lightmatter/feature/uuid-parsing
samamorgan Sep 19, 2023
5caec44
Unify parent accessor methods
samamorgan Oct 27, 2023
3e36785
Implement `delattr`
samamorgan Oct 27, 2023
8b50af1
temp commit
jdiaz5513 Oct 3, 2023
5b3275f
Add Program formations
samamorgan Oct 5, 2023
96dab5e
WIP
samamorgan Oct 27, 2023
690031d
Remove decorators
samamorgan Oct 27, 2023
c30f217
Fix bug in `find_model_id` and improve docs
samamorgan Oct 27, 2023
0cee096
Fix type hint for backwards-compatibility
samamorgan Oct 27, 2023
d6a7a66
Fix cache for older versions of Python
samamorgan Oct 27, 2023
e1f854a
Fix type annotation for function
samamorgan Oct 27, 2023
e4eefb3
Fix another type annotation
samamorgan Oct 27, 2023
b451953
Chain all `AttributeErrors` for better traceback
samamorgan Oct 27, 2023
4a00a23
Fix parent recursion
samamorgan Oct 27, 2023
3a32fd4
Clean up paths
samamorgan Oct 27, 2023
54417f8
Add dynamic patient fixture
samamorgan Oct 27, 2023
eaf20c9
WIP - `Program` read tested
samamorgan Oct 28, 2023
f870433
Remove tests from coverage check
samamorgan Oct 31, 2023
730e1d6
Fix patient fixture cassette dir
samamorgan Oct 31, 2023
2daf528
Finish program tests
samamorgan Oct 31, 2023
fb49196
Finish tests
samamorgan Oct 31, 2023
e56ec4a
Remove .envrc
samamorgan Oct 31, 2023
bc41a26
Revert import change
samamorgan Oct 31, 2023
dd8b754
Remove old shelve dbm on error
samamorgan Nov 3, 2023
e658124
Add `pre-commit`
samamorgan Nov 3, 2023
e08a09d
Bump test matrix version
samamorgan Nov 3, 2023
c37ab88
Fix coverage comment
samamorgan Nov 3, 2023
41ed3d7
Fix permissions
samamorgan Nov 3, 2023
b0ac959
Use lesser permissions
samamorgan Nov 3, 2023
f19c70c
Fix coverage report txt
samamorgan Nov 3, 2023
985bc41
Remove doc8 from precommit
samamorgan Nov 3, 2023
d8ef8b6
Rename models to avoid naming conflict
samamorgan Nov 3, 2023
f15eef7
Revert "Use lesser permissions"
samamorgan Nov 3, 2023
80f1c99
Merge pull request #90 from zest-derm/samm/parent-accessors
samamorgan Feb 28, 2024
1ae997c
Merge remote-tracking branch 'Lightmatter/develop' into juliand/zst-1157
samamorgan Feb 28, 2024
d764dd0
Fix `PatientProgram` parent accessors
samamorgan Feb 28, 2024
ebfee7b
Run all matrix jobs even if one fails
samamorgan Feb 28, 2024
8d2eb93
Add concurrency limiter
samamorgan Feb 28, 2024
69d0296
Merge pull request #92 from zest-derm/juliand/zst-1157
samamorgan Feb 28, 2024
c062822
Revamp test/publish actions
samamorgan Feb 28, 2024
ff714c9
Bump semver
samamorgan Feb 28, 2024
ce802ec
Fix package groups
samamorgan Feb 28, 2024
65c25b5
Update RTD command
samamorgan Feb 28, 2024
f7315db
Add Python version to coverage comment
samamorgan Feb 28, 2024
368671e
Add dynamic package metadata
samamorgan Feb 28, 2024
06ec959
Get rid of Tomli
samamorgan Feb 28, 2024
6686882
Move welkin import
samamorgan Feb 28, 2024
916aa9c
Update sphinx deps
samamorgan Feb 28, 2024
0e249ea
Update RTD config
samamorgan Feb 28, 2024
3557658
Merge pull request #94 from Lightmatter/feature/actions-revamp
samamorgan Feb 28, 2024
d14f6ad
Merge branch 'main' into develop
samamorgan Feb 28, 2024
0c0eb5b
Suggested fixes
samamorgan Feb 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Publish Python 🐍 package 📦 to PyPI

on:
push:
branches:
- master
workflow_dispatch:

jobs:
get-package-version:
name: Get ${{ github.ref_name }} package version
runs-on: ubuntu-latest
outputs:
package-version: ${{ steps.package-version.outputs.package-version }}
version-compairson: ${{ steps.semver.outputs.comparison-result}}
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Get package version
id: package-version
run: echo "package-version=v$(poetry version --short)" >> $GITHUB_OUTPUT

- name: Get release version
id: release-version
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}

- name: Analyze semver
id: semver
uses: madhead/semver-utils@latest
with:
lenient: false
version: ${{ steps.package-version.outputs.package-version }}
compare-to: ${{ steps.release-version.outputs.release }}

- name: Check pre-release
if: ${{ steps.semver.outputs.prerelease != '' }}
run: |
echo "Checking if version is a pre-release"
echo "::error::Skipping pre-release version: ${{ steps.package-version.outputs.package-version}}"
exit 1

deploy:
name: Deploy Python 🐍 distributions 📦 to PyPI
needs: [get-package-version]
runs-on: ubuntu-latest
if: ${{ needs.get-package-version.outputs.version-compairson != '=' }}

steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v3

- name: Build and publish to PyPI
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}

- name: Create release ${{ needs.get-package-version.outputs.package-version }}
uses: ncipollo/release-action@v1
with:
commit: ${{ github.ref_name }}
tag: ${{ needs.get-package-version.outputs.package-version }}
generateReleaseNotes: true
artifacts: |
dist/*.whl
dist/*.tar.gz
77 changes: 77 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

on: [pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
get-python-versions:
name: Get Python versions
runs-on: ubuntu-latest
outputs:
python-matrix: ${{ steps.get-python-versions-action.outputs.latest-python-versions }}
steps:
- name: Get Python version matrix
uses: snok/latest-python-versions@v1
id: get-python-versions-action
with:
min-version: 3.8

ci:
name: CI
needs: [get-python-versions]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-matrix) }}

steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached environment
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
id: poetry-install
run: poetry install --no-interaction --no-root

- name: Run pre-commit
run: poetry run pre-commit run --all-files

- name: Run Tests
run: |
poetry run pytest \
--junitxml=pytest.xml \
--cov-report=term-missing:skip-covered \
--cov=welkin | tee pytest-coverage.txt

- name: Add coverage comment
uses: MishaKav/pytest-coverage-comment@main
continue-on-error: true
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
report-only-changed-files: true
title: Coverage Report (Python ${{ matrix.python-version }})
unique-id-for-comment: ${{ matrix.python-version }}
remove-link-from-badge: true
26 changes: 26 additions & 0 deletions .github/workflows/pre-commit-autoupdate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pre-commit auto-update

on:
# every day at midnight
schedule:
- cron: "0 0 * * *"
# on demand
workflow_dispatch:

jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2

- uses: browniebroke/pre-commit-autoupdate-action@main

- uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-hooks
title: Update pre-commit hooks
commit-message: "chore: update pre-commit hooks"
body: Update versions of pre-commit hooks to latest version.
18 changes: 0 additions & 18 deletions .github/workflows/publish.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/test.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
pytest-coverage.txt
pytest.xml

# Translations
*.mo
Expand Down
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
args: [--unsafe]
- id: debug-statements
- id: mixed-line-ending

## Python
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
types: [python]

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
types: [python]
10 changes: 5 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
version: 2

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3"
python: "3.8"
jobs:
post_install:
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
- poetry install --with docs
post_install:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install

sphinx:
configuration: docs/conf.py
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
}
},
"editor.formatOnSave": true,
Expand Down
Loading