Skip to content

Commit 61fd4f7

Browse files
author
Ilyas Gasanov
committed
Merge branch 'develop'
2 parents 13341ba + 4332b0a commit 61fd4f7

File tree

12 files changed

+91
-42
lines changed

12 files changed

+91
-42
lines changed

.env.docker

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
# Postgres
2-
POSTGRES_DB=horizon
3-
POSTGRES_USER=horizon
4-
POSTGRES_PASSWORD=I8p4E2mULz6v
5-
6-
# Horizon
7-
HORIZON__DATABASE__URL=postgresql+asyncpg://horizon:I8p4E2mULz6v@db:5432/horizon
8-
HORIZON__AUTH__ACCESS_TOKEN__SECRET_KEY=bae1thahr8Iyaisai0kohvoh1aeg5quu
9-
HORIZON__AUTH__PROVIDER=horizon.backend.providers.auth.dummy.DummyAuthProvider
10-
HORIZON__SERVER__LOGGING__PRESET=colored
11-
HORIZON__SERVER__DEBUG=false
12-
131
# envs for Horizon integration tests
142
HORIZON_HOST=horizon
153
HORIZON_PORT=8000
164
HORIZON_USER=horizon
17-
HORIZON_PASSWORD=password
5+
HORIZON_PASSWORD=345UsedForTestOnly
186
HORIZON_NAMESPACE=namespace

.env.local

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Horizon
1+
# envs for Horizon integration tests
22
export HORIZON_HOST=localhost
33
export HORIZON_PORT=8000
44
export HORIZON_USER=horizon
5-
export HORIZON_PASSWORD=password
5+
export HORIZON_PASSWORD=345UsedForTestOnly
66
export HORIZON_NAMESPACE=namespace

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,5 @@ jobs:
111111
name: ${{ steps.release-name.outputs.name }}
112112
body_path: changelog.md
113113
files: |
114-
dist/*
114+
dist/*.tar.gz
115+
dist/*.whl

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ repos:
4343
- --no-extra-eol
4444

4545
- repo: https://github.com/codespell-project/codespell
46-
rev: v2.4.0
46+
rev: v2.4.1
4747
hooks:
4848
- id: codespell
4949
args: [-w]
@@ -88,7 +88,7 @@ repos:
8888
- id: add-trailing-comma
8989

9090
- repo: https://github.com/pycqa/bandit
91-
rev: 1.8.2
91+
rev: 1.8.3
9292
hooks:
9393
- id: bandit
9494
args:
@@ -98,7 +98,7 @@ repos:
9898
require_serial: true
9999

100100
- repo: https://github.com/psf/black-pre-commit-mirror
101-
rev: 24.10.0
101+
rev: 25.1.0
102102
hooks:
103103
- id: black
104104

@@ -120,7 +120,7 @@ repos:
120120
- id: isort
121121

122122
- repo: https://github.com/pycqa/bandit
123-
rev: 1.8.2
123+
rev: 1.8.3
124124
hooks:
125125
- id: bandit
126126
args:

conftest.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
KeyValueIntHWM,
1616
)
1717
from horizon.client.auth import LoginPassword
18-
from horizon.commons.schemas.v1 import NamespaceCreateRequestV1
1918
from packaging.version import Version
2019

2120
from horizon_hwm_store import HorizonHWMStore
@@ -149,6 +148,11 @@ def file_with_mtime(mtime: datetime) -> Path:
149148

150149

151150
@pytest.fixture(params=HWMS_WITH_VALUE)
151+
def hwm_new_values(request):
152+
return request.param
153+
154+
155+
@pytest.fixture(params=[HWMS_WITH_VALUE[0]])
152156
def hwm_new_value(request):
153157
return request.param
154158

@@ -164,16 +168,9 @@ def hwm_store():
164168

165169
@pytest.fixture(scope="module")
166170
def ensure_namespace():
167-
from requests.exceptions import HTTPError
168171

169-
store = HorizonHWMStore(
172+
HorizonHWMStore(
170173
api_url=HORIZON_URL,
171174
auth=LoginPassword(login=HORIZON_USER, password=HORIZON_PASSWORD),
172175
namespace=HORIZON_NAMESPACE,
173-
)
174-
175-
try:
176-
store.client.create_namespace(NamespaceCreateRequestV1(name=HORIZON_NAMESPACE)) # noqa: WPS437
177-
except HTTPError:
178-
# exception: 409 Client Error: Conflict for url: http://horizon/v1/namespaces/ - namespace already exists
179-
pass
176+
).force_create_namespace()

docker-compose.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ services:
33
db:
44
image: postgres:15-alpine
55
restart: unless-stopped
6-
env_file: .env.docker
6+
environment:
7+
POSTGRES_DB: horizon
8+
POSTGRES_USER: horizon
9+
POSTGRES_PASSWORD: 123UsedForTestOnly
710
ports:
811
- 5432:5432
912
volumes:
@@ -18,7 +21,12 @@ services:
1821
backend:
1922
image: mtsrus/horizon-backend:latest
2023
restart: unless-stopped
21-
env_file: .env.docker
24+
environment:
25+
HORIZON__DATABASE__URL: postgresql+asyncpg://horizon:123UsedForTestOnly@db:5432/horizon
26+
HORIZON__AUTH__ACCESS_TOKEN__SECRET_KEY: 234UsedForTestOnly
27+
HORIZON__AUTH__PROVIDER: horizon.backend.providers.auth.dummy.DummyAuthProvider
28+
HORIZON__SERVER__LOGGING__PRESET: colored
29+
HORIZON__SERVER__DEBUG: 'false'
2230
ports:
2331
- 8000:8000
2432
depends_on:

docs/changelog/1.1.0.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
3+
4+
1.1.0 (2025-02-26)
5+
==================
6+
7+
Features
8+
--------
9+
10+
- Add ``force_create_namespace`` method (:github:pull:`44`)

docs/changelog/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
:caption: Changelog
44

55
DRAFT
6+
1.1.0
67
1.0.2
78
1.0.1
89
1.0.0

docs/horizon-hwm-store.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Horizon HWM Store
66
.. currentmodule:: horizon_hwm_store.horizon_hwm_store
77

88
.. autoclass:: HorizonHWMStore
9-
:members: get_hwm, set_hwm
9+
:members: get_hwm, set_hwm, force_create_namespace, check

horizon_hwm_store/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.2
1+
1.1.0

0 commit comments

Comments
 (0)