Skip to content

Commit 018ea13

Browse files
MESH-2092 support up to py3.13 - required changed to SSL certs as 3.13 is more security conscious. Pulled out tox config into tox.ini to permit running from pycharm. Use ASDF python versions. Update Sonar version
1 parent 009fed3 commit 018ea13

17 files changed

Lines changed: 237 additions & 362 deletions

.github/workflows/merge-develop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: provision sonar-scanner
6767
if: github.actor != 'dependabot[bot]' && (success() || failure())
6868
run: |
69-
export SONAR_VERSION="4.7.0.2747"
69+
export SONAR_VERSION="5.0.1.3006"
7070
wget -q "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_VERSION}.zip" -O sonar-scanner.zip
7171
unzip -q ./sonar-scanner.zip
7272
mv ./sonar-scanner-${SONAR_VERSION} ./sonar-scanner

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
- name: provision sonar-scanner
147147
if: github.actor != 'dependabot[bot]' && (success() || failure())
148148
run: |
149-
export SONAR_VERSION="4.7.0.2747"
149+
export SONAR_VERSION="5.0.1.3006"
150150
wget -q "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_VERSION}.zip" -O sonar-scanner.zip
151151
unzip -q ./sonar-scanner.zip
152152
mv ./sonar-scanner-${SONAR_VERSION} ./sonar-scanner

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
poetry 2.1.3
2-
python 3.10.18 3.9.23 3.11.13 3.12.11 3.13.5
2+
python 3.13.5 3.12.11 3.11.13 3.10.18 3.9.23

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ black-check:
9393
black:
9494
poetry run black .
9595

96-
9796
coverage-cleanup:
9897
rm -f .coverage* || true
9998

@@ -121,7 +120,7 @@ tox:
121120
down:
122121
docker compose down --remove-orphans || true
123122

124-
up:
123+
up: create-test-certs-keys
125124
docker compose up -d --remove-orphans --build
126125

127126
coverage-ci: coverage-cleanup coverage-ci-test coverage-report
@@ -134,3 +133,6 @@ check-secrets-all:
134133

135134
export-requirements:
136135
poetry export --only main -f requirements.txt --output ./requirements.txt
136+
137+
create-test-certs-keys:
138+
./scripts/create-test-certs-keys.sh

mesh_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def increment(
220220
error: Optional[Exception] = None,
221221
_pool: Optional[ConnectionPool] = None,
222222
_stacktrace: Optional[TracebackType] = None,
223-
) -> Retry:
223+
) -> "MeshRetry":
224224
if method != "POST" or not url or not url.endswith("/outbox"):
225225
return super().increment(method, url, response, error, _pool, _stacktrace)
226226

pyproject.toml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -109,36 +109,6 @@ include = '\.pyi?$'
109109

110110

111111

112-
[tool.tox]
113-
legacy_tox_ini = """
114-
[tox]
115-
envlist = py39,py310,py311,py312,py313
116-
117-
[gh-actions]
118-
python =
119-
3.9: py39
120-
3.10: py310
121-
3.11: py311
122-
3.12: py312
123-
3.13: py313
124-
125-
[testenv:.pkg]
126-
set_env =
127-
RELEASE_VERSION=1.2.3
128-
129-
[testenv]
130-
wheel_build_env = .pkg
131-
use_develop = true
132-
package = wheel
133-
deps =
134-
requests>=2.26.0
135-
mock
136-
pytest
137-
pytest-httpserver
138-
commands =
139-
python -m pytest
140-
141-
"""
142112

143113
[tool.coverage.run]
144114
branch = true
@@ -189,7 +159,7 @@ check_untyped_defs = true
189159

190160

191161
[tool.poetry-dynamic-versioning]
192-
enable = false
162+
enable = true
193163
metadata = false
194164
vcs = "git"
195165
style = "pep440"

scripts/create-test-certs-keys.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
6+
OUTPUT_DIR="$SCRIPT_DIR/../tests"
7+
8+
######################### CA #########################
9+
10+
echo "Generating CA private key and certificate..."
11+
12+
openssl genpkey -algorithm RSA -out "$OUTPUT_DIR"/ca.key.pem
13+
14+
openssl req -new -x509 -days 73050 -key "$OUTPUT_DIR"/ca.key.pem -out "$OUTPUT_DIR"/ca.cert.pem \
15+
-config "$SCRIPT_DIR"/openssl.cnf -extensions v3_ca -subj "/CN=Test Self-Signed CA"
16+
17+
echo "CA certificate and key created successfully."
18+
19+
######################### SERVER #########################
20+
21+
echo "Generating server private key and CSR..."
22+
23+
openssl genpkey -algorithm RSA -out "$OUTPUT_DIR"/server.key.pem
24+
25+
openssl req -new -key "$OUTPUT_DIR"/server.key.pem -out "$OUTPUT_DIR"/server.csr \
26+
-config "$SCRIPT_DIR"/openssl.cnf -subj "/CN=localhost/O=Test Server"
27+
28+
echo "Signing the server CSR with the CA certificate..."
29+
30+
openssl x509 -req -in "$OUTPUT_DIR"/server.csr -CA "$OUTPUT_DIR"/ca.cert.pem -CAkey "$OUTPUT_DIR"/ca.key.pem \
31+
-CAcreateserial -out "$OUTPUT_DIR"/server.cert.pem -days 73050 -extensions v3_req \
32+
-extfile "$SCRIPT_DIR"/openssl.cnf
33+
34+
echo "Server certificate signed successfully."
35+
36+
######################### CLIENT #########################
37+
38+
echo "Generating client private key and CSR..."
39+
40+
openssl genpkey -algorithm RSA -out "$OUTPUT_DIR"/client.key.pem
41+
42+
openssl req -new -key "$OUTPUT_DIR"/client.key.pem -out "$OUTPUT_DIR"/client.csr \
43+
-config "$SCRIPT_DIR"/openssl.cnf -subj "/CN=localhost/O=Test Client"
44+
45+
echo "Signing the client CSR with the CA certificate..."
46+
47+
openssl x509 -req -in "$OUTPUT_DIR"/client.csr -CA "$OUTPUT_DIR"/ca.cert.pem -CAkey "$OUTPUT_DIR"/ca.key.pem \
48+
-CAcreateserial -out "$OUTPUT_DIR"/client.cert.pem -days 73050 -extensions v3_req \
49+
-extfile "$SCRIPT_DIR"/openssl.cnf
50+
51+
echo "Client certificate signed successfully."
52+
53+
######################### COMPLETE #########################
54+
55+
rm -f "$OUTPUT_DIR"/server.csr "$OUTPUT_DIR"/client.csr
56+
57+
echo "Complete."
58+

scripts/openssl.cnf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[ req ]
2+
distinguished_name = req_distinguished_name
3+
prompt = no
4+
5+
[ req_distinguished_name ]
6+
C = GB
7+
ST = Test State
8+
L = Test Locality
9+
O = Test Org
10+
CN = Test Self-Signed CA
11+
12+
[ v3_ca ]
13+
# Extensions for a self-signed CA
14+
subjectKeyIdentifier = hash
15+
authorityKeyIdentifier = keyid:always,issuer
16+
basicConstraints = critical,CA:true
17+
keyUsage = critical,digitalSignature,keyCertSign,cRLSign
18+
19+
[ v3_req ]
20+
# Extensions for a server/client certificate
21+
basicConstraints = CA:false
22+
keyUsage = digitalSignature, keyEncipherment
23+
extendedKeyUsage = serverAuth, clientAuth
24+
subjectAltName = @alt_names
25+
26+
[ alt_names ]
27+
DNS.1 = localhost
28+
IP.1 = 127.0.0.1

tests/ca.cert.pem

Lines changed: 0 additions & 31 deletions
This file was deleted.

tests/ca.key.pem

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)