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

v1.2.9 #103

Merged
merged 3 commits into from
Nov 2, 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [1.2.9] - 2023/10/04

### Changed
- Increased DownloadsAPI sleep time to 20

## [1.2.8] - 2023/10/04

### Added
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = osdatahub
version = 1.2.8
version = 1.2.9
author = OS Rapid Prototyping
author_email = [email protected]
classifiers =
Expand Down
2 changes: 1 addition & 1 deletion src/osdatahub/DownloadsAPI/downloads_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def download(self, output_dir: Union[str, Path], overwrite: bool = False, pbar:

except HTTPError as exc:
if int(exc.response.status_code) == 429:
time.sleep(1)
time.sleep(20)
continue
raise

Expand Down
2 changes: 1 addition & 1 deletion src/osdatahub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def set_proxies(proxies):
def get_proxies():
return json.loads(os.environ["_OSDATAHUB_PROXIES"])

__version__ = "1.2.8"
__version__ = "1.2.9"

from osdatahub.extent import Extent
from osdatahub.FeaturesAPI import FeaturesAPI
Expand Down
7 changes: 3 additions & 4 deletions tests/test_downloads_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,14 @@ def data_package(self):
@pytest.mark.skipif(API_KEY is None, reason="Test API key not available")
def test_download_pass(self):
# Arrange
product_package = DataPackageDownload(API_KEY, "98")
files_to_download = product_package.product_list("156")
product_package = DataPackageDownload(API_KEY, "97")

# Act
with tempfile.TemporaryDirectory() as tmpdirname:
downloaded = product_package.download("156", tmpdirname)
downloaded = product_package.download("17094", tmpdirname, "bld_fts_buildingpart_orderSummary.json")

# Assert
assert len(downloaded) == len(files_to_download["downloads"])
assert len(downloaded) == 1

def test_download_list_pass(self):
# TODO: implement download_list_pass
Expand Down