Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ git clone git@github.com:NHSDigital/clinical-data-gateway-api.git
cd clinical-data-gateway-api.git
```

### External Dependencies

This project depends on the [clinical-data-common](https://github.com/NHSDigital/clinical-data-common) library, which provides shared code and utilities used across various clinical data API products. The dependency is managed via Poetry and installed directly from the GitHub repository.

The library is referenced in `gateway-api/pyproject.toml` as a git dependency. The CI/CD pipeline is currently configured to pull the latest version from the specified branch automatically.

The project can then be built within a [Dev Container](https://containers.dev/) as defined within the file outlined under `.devcontainer/devcontainer.json`. When opening the project within Visual Studio Code, if the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) is installed, you should be prompted to re-open the folder within a Dev Container if you wish. If accepted, this should build the Dev Container locally which will include all required libraries and tools for development.

> [!NOTE]<br>
Expand Down
19 changes: 19 additions & 0 deletions gateway-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,22 @@ gateway-api/
├── pyproject.toml # Dependencies and config
└── README.md
```

## External Dependencies

This module depends on the [clinical-data-common](https://github.com/NHSDigital/clinical-data-common) library for shared utilities and code. The dependency is specified as a git poetry dependency in `pyproject.toml`:

```toml
[tool.poetry.dependencies]
clinical-data-common = { git = "https://github.com/NHSDigital/clinical-data-common.git", branch = "main" }
```

### Updating the Dependency

To pull the latest version of the common library:

```bash
poetry update clinical-data-common
```

The CI/CD pipeline automatically updates this dependency on each run to ensure the latest code from the specified branch is used during active development.
33 changes: 32 additions & 1 deletion gateway-api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion gateway-api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "gateway-api"
version = "0.1.0"
description = ""
description = "Clinical Data Gateway API - Provides GP Connect APIs over the internet via the API Management platform"
authors = [
{name = "Your Name", email = "you@example.com"}
]
Expand All @@ -10,6 +10,9 @@ requires-python = ">3.13,<4.0.0"
dependencies = [
]

[tool.poetry.dependencies]
clinical-data-common = { git = "https://github.com/NHSDigital/clinical-data-common.git", tag = "v0.1.0" }

[tool.poetry]
packages = [{include = "gateway_api", from = "src"}]

Expand Down Expand Up @@ -45,6 +48,7 @@ dev = [
"pytest-cov (>=7.0.0,<8.0.0)",
"pytest-html (>=4.1.1,<5.0.0)",
"pact-python>=2.0.0",
"python-dotenv>=1.0.0",
"requests>=2.31.0",
"schemathesis>=4.4.1",
"types-requests (>=2.32.4.20250913,<3.0.0.0)",
Expand Down
6 changes: 5 additions & 1 deletion gateway-api/src/gateway_api/handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from clinical_data_common import get_hello


class User:
def __init__(self, name: str):
self._name = name
Expand All @@ -10,4 +13,5 @@ def name(self) -> str:
def greet(user: User) -> str:
if user.name == "nonexistent":
raise ValueError("nonexistent user provided.")
return f"Hello, {user.name}!"
hello = get_hello()
return f"{hello}{user.name}!"
5 changes: 5 additions & 0 deletions gateway-api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

import pytest
import requests
from dotenv import find_dotenv, load_dotenv

# Load environment variables from .env file in the workspace root
# find_dotenv searches upward from current directory for .env file
load_dotenv(find_dotenv())


class Client:
Expand Down
Loading