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

Remove requests dependency #89

Merged
merged 3 commits into from
Dec 18, 2023
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: 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