Skip to content

Commit 352a15a

Browse files
authored
Merge pull request #90 from stackhpc/upstream/2025.1-2026-05-04
Synchronise 2025.1 with upstream
2 parents 773aed6 + 5dbc016 commit 352a15a

5 files changed

Lines changed: 19 additions & 7 deletions

File tree

build-constraints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
setuptools<82

cloudkittydashboard/dashboards/project/rating/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_data(self):
5252

5353
def quote(request):
5454
pricing = 0.0
55-
if request.is_ajax():
55+
if request.headers.get('x-requested-with') == 'XMLHttpRequest':
5656
if request.method == 'POST':
5757
json_data = json.loads(request.body)
5858

cloudkittydashboard/tests/test_predictive_pricing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def setUp(self):
3636
def _test_quote_request_not_ajax_post(self, arg):
3737
request = mock.MagicMock()
3838
if arg == 'ajax':
39-
request.is_ajax.return_value = False
39+
request.headers.get.return_value = None # Not an AJAX request
4040
elif arg == 'method':
4141
request.method == 'POST'
4242
resp = self.quote(request)
@@ -57,7 +57,7 @@ def test_quote_does_update_request_dict(self, api_mock):
5757
{'other_key': None, 'service': 'test_service'}]
5858

5959
request = mock.MagicMock()
60-
request.is_ajax.return_value = True
60+
request.headers.get.return_value = 'XMLHttpRequest'
6161
request.method = 'POST'
6262
request.body = json.dumps(body)
6363

tools/pip.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
pip install 'pip==25.3'
3+
pip install "$@"

tox.ini

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ ignore_basepython_conflict = True
77
[testenv]
88
basepython = python3
99
usedevelop = True
10-
install_command = pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2025.1} -U {opts} {packages}
10+
install_command = {toxinidir}/tools/pip.sh --build-constraint={toxinidir}/build-constraints.txt {opts} {packages}
1111
setenv =
1212
VIRTUAL_ENV={envdir}
13-
deps = -r{toxinidir}/requirements.txt
13+
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2025.1}
14+
-r{toxinidir}/requirements.txt
1415
-r{toxinidir}/test-requirements.txt
16+
pip==25.3 # Needed for build-constraints.txt
17+
setuptools<82 # Due to deprecation of pkg_resources
18+
allowlist_externals =
19+
{toxinidir}/tools/pip.sh
1520
commands =
1621
stestr run --slowest {posargs}
1722

@@ -32,13 +37,16 @@ commands =
3237
coverage xml -o cover/coverage.xml
3338

3439
[testenv:docs]
35-
deps = -r{toxinidir}/doc/requirements.txt
40+
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2025.1}
41+
-r{toxinidir}/doc/requirements.txt
42+
setuptools<82 # Due to deprecation of pkg_resources
3643
commands = sphinx-build -W --keep-going -b html doc/source doc/build/html
3744

3845
[testenv:pdf-docs]
3946
deps = {[testenv:docs]deps}
4047
allowlist_externals =
4148
make
49+
{toxinidir}/tools/pip.sh
4250
commands =
4351
sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
4452
make -C doc/build/pdf
@@ -55,6 +63,6 @@ builtins = _
5563
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject,releasenotes
5664

5765
[testenv:releasenotes]
58-
deps = -r{toxinidir}/doc/requirements.txt
66+
deps = {[testenv:docs]deps}
5967
commands =
6068
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html

0 commit comments

Comments
 (0)