Skip to content

Commit

Permalink
Remove requests dependency (#89)
Browse files Browse the repository at this point in the history
* Drop requests dependency

* Bump version

* Update README
  • Loading branch information
lkuchenb authored Dec 18, 2023
1 parent 75e9acd commit 8be275b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ We recommend using the provided Docker container.

A pre-build version is available at [docker hub](https://hub.docker.com/repository/docker/ghga/ghga-connector):
```bash
docker pull ghga/ghga-connector:1.1.1
docker pull ghga/ghga-connector:1.1.2
```

Or you can build the container yourself from the [`./Dockerfile`](./Dockerfile):
```bash
# Execute in the repo's root dir:
docker build -t ghga/ghga-connector:1.1.1 .
docker build -t ghga/ghga-connector:1.1.2 .
```

For production-ready deployment, we recommend using Kubernetes, however,
for simple use cases, you could execute the service using docker
on a single server:
```bash
# The entrypoint is preconfigured:
docker run -p 8080:8080 ghga/ghga-connector:1.1.1 --help
docker run -p 8080:8080 ghga/ghga-connector:1.1.2 --help
```

If you prefer not to use containers, you may install the service from source:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ghga_connector"
version = "1.1.1"
version = "1.1.2"
description = "GHGA Connector - A CLI client application for interacting with the GHGA system."
readme = "README.md"
authors = [
Expand Down
25 changes: 10 additions & 15 deletions src/ghga_connector/core/api_calls/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from typing import Union

import httpx
from requests.structures import CaseInsensitiveDict

from ghga_connector.core import exceptions
from ghga_connector.core.api_calls.work_package import WorkPackageAccessor
Expand Down Expand Up @@ -55,13 +54,11 @@ def get_download_url(

# build url and headers
url = f"{work_package_accessor.dcs_api_url}/objects/{file_id}"
headers = CaseInsensitiveDict(
{
"Accept": "application/json",
"Authorization": f"Bearer {decrypted_token}",
"Content-Type": "application/json",
}
)
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {decrypted_token}",
"Content-Type": "application/json",
}

# Make function call to get download url
try:
Expand Down Expand Up @@ -180,13 +177,11 @@ def get_file_header_envelope(
# build url and headers
url = f"{work_package_accessor.dcs_api_url}/objects/{file_id}/envelopes"

headers = CaseInsensitiveDict(
{
"Accept": "application/json",
"Authorization": f"Bearer {decrypted_token}",
"Content-Type": "application/json",
}
)
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {decrypted_token}",
"Content-Type": "application/json",
}

# Make function call to get envelope
try:
Expand Down

0 comments on commit 8be275b

Please sign in to comment.