-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1673873
Showing
18 changed files
with
571 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main, staging] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
GITHUB_EVENT_NAME: ${{ github.event_name }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10"] | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: laminlabs/lndocs | ||
ssh-key: ${{ secrets.READ_LNDOCS }} | ||
path: lndocs | ||
ref: main | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- run: pip install -U laminci | ||
- run: sudo apt-get -y install graphviz | ||
|
||
- uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: eu-central-1 | ||
- run: nox -s lint | ||
- run: nox -s build | ||
|
||
- uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
- uses: nwtgck/[email protected] | ||
with: | ||
publish-dir: "_build/html" | ||
production-deploy: ${{ github.event_name == 'push' }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
enable-commit-comment: false | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{pr.title}} | [{{pr.number}}]({{pr.html_url}}) | [{{pr.user.login}}]({{pr.user.html_url}}) | {{pr.closed_at.date().isoformat()}} | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: latest-changes | ||
|
||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
workflow_dispatch: | ||
inputs: | ||
number: | ||
description: PR number | ||
required: true | ||
|
||
jobs: | ||
latest-changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker://tiangolo/latest-changes:0.0.3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
latest_changes_file: docs/changelog.md | ||
latest_changes_header: '--- \| --- \| --- \| --- \| ---\n' | ||
template_file: ./.github/workflows/latest-changes.jinja2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# macOS | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# dotenv | ||
.env | ||
|
||
# virtualenv | ||
.venv | ||
venv/ | ||
ENV/ | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# IDE settings | ||
.vscode/ | ||
.idea/ | ||
|
||
# Lamin | ||
_build | ||
docs/omop.* | ||
lamin_sphinx | ||
docs/conf.py | ||
_docs_tmp* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
fail_fast: false | ||
default_language_version: | ||
python: python3 | ||
default_stages: | ||
- commit | ||
- push | ||
minimum_pre_commit_version: 2.12.0 | ||
repos: | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v4.0.0-alpha.4 | ||
hooks: | ||
- id: prettier | ||
exclude: | | ||
(?x)( | ||
docs/changelog.md | ||
) | ||
- repo: https://github.com/kynan/nbstripout | ||
rev: 0.6.1 | ||
hooks: | ||
- id: nbstripout | ||
exclude: | | ||
(?x)( | ||
docs/examples/| | ||
docs/notes/ | ||
) | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.7 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes] | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: detect-private-key | ||
- id: check-ast | ||
- id: end-of-file-fixer | ||
exclude: | | ||
(?x)( | ||
.github/workflows/latest-changes.jinja2 | ||
) | ||
- id: mixed-line-ending | ||
args: [--fix=lf] | ||
- id: trailing-whitespace | ||
- id: check-case-conflict | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.7.1 | ||
hooks: | ||
- id: mypy | ||
args: [--no-strict-optional, --ignore-missing-imports] | ||
additional_dependencies: | ||
["types-pkg-resources", "types-requests", "types-attrs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# OMOP: OMOP Common Data Model | ||
|
||
## Contributing | ||
|
||
Please run `pre-commit install` and `gitmoji -i` on the CLI before starting to work on this repository! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
<!-- prettier-ignore --> | ||
Name | PR | Developer | Date | Version | ||
--- | --- | --- | --- | --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Guide | ||
|
||
```{toctree} | ||
:maxdepth: 1 | ||
quickstart | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
```{include} ../README.md | ||
:start-line: 0 | ||
:end-line: 1 | ||
``` | ||
|
||
```{toctree} | ||
:maxdepth: 1 | ||
:hidden: | ||
guide | ||
reference | ||
changelog | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "7f26a335-cf1c-4e69-be3b-0c26b154606a", | ||
"metadata": {}, | ||
"source": [ | ||
"# Quickstart" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a51faaf3-ee27-43c6-b48d-13be1adb5c46", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from omop import ExampleClass, example_function" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "fa758625-efb0-4047-9a03-aa534bf6f78e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"example_function(\"A\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ad22eec0-8f75-4e0b-a132-8a43ccb09b37", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ex = ExampleClass(1)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "8bf01623-742e-425a-973d-132fc61c3d9c", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"assert ex.bar() == \"hello\"" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.12" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Reference | ||
|
||
```{eval-rst} | ||
.. automodule:: omop | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
project_name: OMOP | ||
description: OMOP Common Data Model | ||
project_slug: omop | ||
repository_name: omop | ||
package_name: omop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import nox | ||
from laminci.nox import build_docs, login_testuser1, run_pre_commit, run_pytest | ||
|
||
# we'd like to aggregate coverage information across sessions | ||
# and for this the code needs to be located in the same | ||
# directory in every github action runner | ||
# this also allows to break out an installation section | ||
nox.options.default_venv_backend = "none" | ||
|
||
|
||
@nox.session | ||
def lint(session: nox.Session) -> None: | ||
run_pre_commit(session) | ||
|
||
|
||
@nox.session() | ||
def build(session): | ||
session.run(*"uv pip install --system -e .[dev]".split()) | ||
login_testuser1(session) | ||
run_pytest(session) | ||
build_docs(session, strict=True) |
Oops, something went wrong.