Skip to content

Commit

Permalink
dotenv: remove dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
gauteh committed Jun 29, 2023
1 parent 3881dac commit 02c6ad1
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 22 deletions.
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies:
- click
- tabulate
- tqdm
- python-dotenv
- coloredlogs
- xarray
- netcdf4
Expand Down
3 changes: 0 additions & 3 deletions sfy-processing/.env-example

This file was deleted.

10 changes: 1 addition & 9 deletions sfy-processing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ $ pip install -e .

## Usage

Specify the server and read-token in a [`.env`](./.env-example) file:

```
SFY_SERVER="http://wavebug.met.no:3000/"
SFY_READ_TOKEN="secret"
SFY_DATA_CACHE="/tmp/sfy-cache"
```

Or set them as environment variables in e.g. `.bashrc`:
Specify the server and read-token in environment variables, e.g. in `.bashrc`:

```
export SFY_SERVER='http://wavebug.met.no:3000'
Expand Down
3 changes: 0 additions & 3 deletions sfy-processing/sfy/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ def __init__(self, endpoint, key, cache=None):
@staticmethod
def from_env():
from urllib.parse import urljoin
from dotenv import load_dotenv

load_dotenv()

API = os.getenv('SFY_SERVER')
KEY = os.getenv('SFY_READ_TOKEN')
Expand Down
7 changes: 1 addition & 6 deletions sfy-processing/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import pytest
import os
from dotenv import load_dotenv
from sfy import hub

def has_hub():
load_dotenv()

API = os.getenv('SFY_SERVER')
KEY = os.getenv('SFY_READ_TOKEN')

print(API, KEY)

if API is None or KEY is None:
return False

return True

needs_hub = pytest.mark.skipif(not has_hub(), reason="A data hub must be configured.")
needs_hub = pytest.mark.skipif(not has_hub(), reason="No data hub must configured.")

@pytest.fixture
def sfyhub(tmpdir):
Expand Down

0 comments on commit 02c6ad1

Please sign in to comment.