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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "polyswarm"
version = "4.2.0"
version = "4.2.1"
description = "CLI for using the PolySwarm Customer APIs"
readme = "README.md"
authors = [{ name = "PolySwarm Developers", email = "info@polyswarm.io" }]
Expand Down Expand Up @@ -51,7 +51,7 @@ include-package-data = true
where = ["src"]

[tool.bumpversion]
current_version = "4.2.0"
current_version = "4.2.1"
commit = true
tag = false
sign_tags = true
Expand Down
2 changes: 1 addition & 1 deletion src/polyswarm/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.2.0'
__version__ = '4.2.1'
10 changes: 5 additions & 5 deletions src/polyswarm/client/polyswarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
PROD_API_URI = 'https://api.polyswarm.network/v3'

# Convenience environment shortcuts so callers can write `--stage` instead of
# `--api-uri https://api.stage-v3.polyswarm.network/v3`. Keys are the click
# `--api-uri https://api.stage-blue.polyswarm.network/v3`. Keys are the click
# parameter names (click maps `--prod-eu` -> `prod_eu`).
API_URI_SHORTCUTS = {
'prod': PROD_API_URI,
'stage': 'https://api.stage-v3.polyswarm.network/v3',
'stage': 'https://api.stage-blue.polyswarm.network/v3',
'local': 'http://localhost:9696/v3',
'prod_eu': 'https://api.prod-eu-v3.polyswarm.network/v3',
'stage_eu': 'https://api.stage-eu-v3.polyswarm.network/v3',
'stage_eu': 'https://api.stage-eu-blue.polyswarm.network/v3',
}

_SHORTCUT_FLAGS = {
Expand Down Expand Up @@ -184,13 +184,13 @@ def invoke(self, ctx):
@click.option('--prod', is_flag=True, default=False,
help='Target the production API (https://api.polyswarm.network/v3) — same as the default.')
@click.option('--stage', is_flag=True, default=False,
help='Target the US staging API (https://api.stage-v3.polyswarm.network/v3).')
help='Target the US staging API (https://api.stage-blue.polyswarm.network/v3).')
@click.option('--local', is_flag=True, default=False,
help='Target a local API (http://localhost:9696/v3).')
@click.option('--prod-eu', 'prod_eu', is_flag=True, default=False,
help='Target the EU production API (https://api.prod-eu-v3.polyswarm.network/v3).')
@click.option('--stage-eu', 'stage_eu', is_flag=True, default=False,
help='Target the EU staging API (https://api.stage-eu-v3.polyswarm.network/v3).')
help='Target the EU staging API (https://api.stage-eu-blue.polyswarm.network/v3).')
@click.option('-o', '--output-file', type=click.File('w', encoding='utf8'), help='Path to output file.')
@click.option('--output-format', '--fmt', default='text', type=click.Choice(formatters.keys()),
help='Output format. Human-readable text or JSON.')
Expand Down
8 changes: 4 additions & 4 deletions tests/api_uri_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def test_env_api_uri_used_when_no_flag(self):
def test_each_shortcut_resolves(self):
expected = {
'prod': 'https://api.polyswarm.network/v3',
'stage': 'https://api.stage-v3.polyswarm.network/v3',
'stage': 'https://api.stage-blue.polyswarm.network/v3',
'local': 'http://localhost:9696/v3',
'prod_eu': 'https://api.prod-eu-v3.polyswarm.network/v3',
'stage_eu': 'https://api.stage-eu-v3.polyswarm.network/v3',
'stage_eu': 'https://api.stage-eu-blue.polyswarm.network/v3',
}
# guard against the constant drifting from the verified ingress hosts
assert API_URI_SHORTCUTS == expected
Expand Down Expand Up @@ -124,7 +124,7 @@ def test_shortcut_beats_env_var(self):

# --- each shortcut ---
def test_stage_shortcut(self):
assert self._resolved_base('--stage') == 'https://api.stage-v3.polyswarm.network/v3'
assert self._resolved_base('--stage') == 'https://api.stage-blue.polyswarm.network/v3'

def test_local_shortcut(self):
assert self._resolved_base('--local') == 'http://localhost:9696/v3'
Expand All @@ -133,7 +133,7 @@ def test_prod_eu_shortcut(self):
assert self._resolved_base('--prod-eu') == 'https://api.prod-eu-v3.polyswarm.network/v3'

def test_stage_eu_shortcut(self):
assert self._resolved_base('--stage-eu') == 'https://api.stage-eu-v3.polyswarm.network/v3'
assert self._resolved_base('--stage-eu') == 'https://api.stage-eu-blue.polyswarm.network/v3'

def test_prod_shortcut_matches_default(self):
assert self._resolved_base('--prod') == 'https://api.polyswarm.network/v3'
Expand Down
Loading