-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pyproject.toml * Remove setup files * Remove unnecessary tables in the pyproject.toml * Move tox config to pyproject.toml * Add build workflow * Add Pipfile * Update aidbox launch config * Skip aiohttp.request mocking tests Fix once #93 is done * Remove pytest-mock * Add mised import to test * Update build workflow config * Remove python required version in Pipfile * Add docker services to build workflow * Pass env vars for Aidbox container * Fix typo in the build config * Fix typoes * Disable aidbox healthcheck service * Remove services description * Move test command to the shell script * Remove setup python step
- Loading branch information
1 parent
682db6b
commit 1b7c062
Showing
18 changed files
with
851 additions
and
202 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 @@ | ||
AIDBOX_LICENSE= |
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,34 @@ | ||
name: fhirpy | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- python-version: 3.8 | ||
- python-version: 3.9 | ||
- python-version: "3.10" | ||
- python-version: "3.11" | ||
env: | ||
PYTHON: ${{ matrix.python-version }} | ||
AIDBOX_LICENSE: ${{ secrets.AIDBOX_LICENSE}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run tests | ||
run: ./run_test.sh | ||
shell: bash | ||
# - name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v3 | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# env_vars: PYTHON | ||
# fail_ci_if_error: true | ||
# files: ./coverage.xml | ||
# flags: unittests | ||
# name: codecov-umbrella | ||
# verbose: true |
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,16 @@ | ||
ARG PYTHON_VERSION | ||
FROM python:$PYTHON_VERSION | ||
RUN pip install pipenv | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
COPY Pipfile Pipfile.lock ./ | ||
RUN pipenv install --dev | ||
|
||
# SQLAlchemy vulnerability - https://pyup.io/v/51668/742 | ||
# Remove ignore option once fix is released or upgrade to version 2 | ||
# RUN pipenv check -i 51668 | ||
COPY . . | ||
|
||
EXPOSE 8081 |
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,17 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
|
||
[dev-packages] | ||
requests = "==2.25.1" | ||
pytest = ">=6.2.4" | ||
pytest-cov = "==2.12.0" | ||
aiohttp = "==3.7.4" | ||
pytest-asyncio = "==0.15.1" | ||
responses = "==0.13.3" | ||
pytz = "==2021.1" | ||
black = "==22.10.0" | ||
pre-commit = "==2.20.0" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,15 +1,12 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "${AIDBOX_LICENSE_KEY_TESTS}" ]; then | ||
echo "AIDBOX_LICENSE_KEY_TESTS is required to run tests" | ||
exit 1 | ||
if [ -f ".env" ]; then | ||
export `cat .env` | ||
fi | ||
|
||
if [ -z "${AIDBOX_LICENSE_ID_TESTS}" ]; then | ||
echo "AIDBOX_LICENSE_ID_TESTS is required to run tests" | ||
if [ -z "${AIDBOX_LICENSE}" ]; then | ||
echo "AIDBOX_LICENSE is required to run tests" | ||
exit 1 | ||
fi | ||
|
||
docker-compose -f docker-compose.tests.yaml pull | ||
docker-compose -f docker-compose.tests.yaml run dockerize | ||
docker compose -f docker-compose.tests.yaml up --exit-code-from devbox devbox | ||
exit $? |
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,47 @@ | ||
services: | ||
devbox: | ||
image: "healthsamurai/aidboxone:edge" | ||
depends_on: | ||
- devbox-db | ||
ports: | ||
- 8080:8080 | ||
links: | ||
- "devbox-db:database" | ||
env_file: | ||
- env_tests | ||
environment: | ||
AIDBOX_LICENSE: ${AIDBOX_LICENSE} | ||
devbox-db: | ||
image: healthsamurai/aidboxdb:14.5 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: devbox | ||
devbox-healthcheck: | ||
image: curlimages/curl | ||
entrypoint: /bin/sleep 10000 | ||
links: | ||
- devbox | ||
depends_on: | ||
- devbox | ||
healthcheck: | ||
test: curl --fail http://devbox:8080/__healthcheck || exit 1 | ||
interval: 1s | ||
timeout: 20s | ||
retries: 100 | ||
app: | ||
build: | ||
context: . | ||
args: | ||
PYTHON_VERSION: ${PYTHON:-3.11} | ||
command: ["pipenv", "run", "pytest"] | ||
depends_on: | ||
devbox-healthcheck: | ||
condition: | ||
service_healthy | ||
links: | ||
- devbox | ||
ports: | ||
- "8081:8081" | ||
volumes: | ||
- .:/app |
File renamed without changes.
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,99 @@ | ||
[build-system] | ||
requires = ["flit_core >=3.2,<4"] | ||
build-backend = "flit_core.buildapi" | ||
|
||
[project] | ||
name = "fhirpy" | ||
description = "FHIR client for python" | ||
readme = "README.md" | ||
license = { file = "LICENSE.md" } | ||
keywords = ["fhir"] | ||
dynamic = ["version"] | ||
authors = [{ name = "beda.software", email = "[email protected]" }] | ||
dependencies = ["requests>=2.25.1", "aiohttp>=3.6.3", "pytz"] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Web Environment", | ||
"Intended Audience :: Developers", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Internet :: WWW/HTTP", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
requires-python = ">=3.8" | ||
|
||
[project.optional-dependencies] | ||
test = ["pytest>=6.2.4", "pytest-asyncio>=0.15.1", "responses>=0.13.3"] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/beda-software/fhir-py" | ||
Documentation = "https://github.com/beda-software/fhir-py#readme" | ||
Source = "https://github.com/beda-software/fhir-py.git" | ||
|
||
[tool.tox] | ||
legacy_tox_ini = """ | ||
[pytest] | ||
addopts=--tb=short | ||
[tox] | ||
envlist = | ||
py38 | ||
py39 | ||
py310 | ||
py311 | ||
skip_missing_interpreters = true | ||
requires = | ||
virtualenv>=16.7.8 | ||
pip>=19.3.1 | ||
[gh-actions] | ||
python = | ||
3.8: py38 | ||
3.9: py39 | ||
3.10: py310 | ||
3.11: py311 | ||
[testenv] | ||
passenv = | ||
TOXENV | ||
CI | ||
CODECOV_* | ||
commands = | ||
pytest --doctest-modules --cov=./fhirpy tests | ||
setenv = | ||
PYTHONDONTWRITEBYTECODE=1 | ||
PYTHONWARNINGS=once | ||
deps = | ||
-r requirements.txt | ||
""" | ||
|
||
[tool.black] | ||
line-length = 100 | ||
target-version = ['py311'] | ||
exclude = ''' | ||
( | ||
/( | ||
| \.git | ||
| \.pytest_cache | ||
| pyproject.toml | ||
| dist | ||
)/ | ||
) | ||
''' | ||
|
||
[tool.isort] | ||
profile = "black" | ||
line_length = 100 | ||
skip = [".gitignore"] | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = "-ra -q --color=yes" | ||
testpaths = ["tests"] | ||
log_cli = true | ||
log_cli_level = "INFO" |
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
#!/bin/bash | ||
|
||
docker compose -f docker-compose.tests.yaml up --quiet-pull --exit-code-from app app |
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
Oops, something went wrong.