From f7f0cdfe0e96e8b3d85d9b5fe21aef8e2ce1fd33 Mon Sep 17 00:00:00 2001 From: Oleksandr Lazarenko Date: Tue, 23 Jun 2026 09:35:07 +0200 Subject: [PATCH 1/5] FIX: UTM query parameters --- fiftyone_devicedetection_cloud/tests/test_cloud.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fiftyone_devicedetection_cloud/tests/test_cloud.py b/fiftyone_devicedetection_cloud/tests/test_cloud.py index f16dcbe88..b2c63dce4 100644 --- a/fiftyone_devicedetection_cloud/tests/test_cloud.py +++ b/fiftyone_devicedetection_cloud/tests/test_cloud.py @@ -22,6 +22,7 @@ import unittest import os +import re import time from fiftyone_devicedetection_cloud.devicedetection_cloud_pipelinebuilder import DeviceDetectionCloudPipelineBuilder @@ -103,6 +104,9 @@ def test_missing_property_service_element_not_found(self): except Exception as e: result = str(e) + # The explainer URL may carry UTM query parameters; ignore them. + result = re.sub(r'\?utm_[^\s]*', '', result) + self.assertEqual( result, "Your resource key does not include access to any properties under notpresent. For more details on resource keys, see our explainer: https://51degrees.com/documentation/_info__resource_keys.html Available element data keys are: ['device']") @@ -157,6 +161,9 @@ def test_missing_property_service_not_found_anywhere(self): self.maxDiff = None + # The explainer URL may carry UTM query parameters; ignore them. + result = re.sub(r'\?utm_[^\s]*', '', result) + self.assertEqual( result, "Property notpresent not found in data for element device. This is because your resource key does not include access to this property. Properties that are included for this key under device are " + ', '.join(list(pipeline.get_element("device").get_properties().keys())) + ". For more details on resource keys, see our explainer: https://51degrees.com/documentation/_info__resource_keys.html") From 9442cce99bc3a90a1755238ce98c2ddc119b510e Mon Sep 17 00:00:00 2001 From: Oleksandr Lazarenko Date: Tue, 23 Jun 2026 13:23:42 +0200 Subject: [PATCH 2/5] FIX: removed UTM params --- .../devicedetection_onpremise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/devicedetection_onpremise.py b/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/devicedetection_onpremise.py index f57992026..d1f1c264a 100644 --- a/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/devicedetection_onpremise.py +++ b/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/devicedetection_onpremise.py @@ -148,7 +148,7 @@ def __init__( self.data = data if not licence_keys and licence_keys != "": - raise Exception("licence key is required. A key can be obtained from the 51Degrees website: https://51degrees.com/pricing?utm_source=code&utm_medium=comment&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_onpremise-src-fiftyone_devicedetection_onpremise-devicedetection_onpremise.py&utm_term=licence-key-required. If you do not wish to use a key then you can specify an empty string, but this will cause automatic updates to be disabled.") + raise Exception("licence key is required. A key can be obtained from the 51Degrees website: https://51degrees.com/pricing. If you do not wish to use a key then you can specify an empty string, but this will cause automatic updates to be disabled.") # Create SWIG wrapper vector for restricted properties and add From 1d3bd37a37243acfe18aa26f41974b2f309bd727 Mon Sep 17 00:00:00 2001 From: Automation51D <60396166+Automation51D@users.noreply.github.com> Date: Tue, 23 Jun 2026 13:36:57 +0100 Subject: [PATCH 3/5] Merged Pull Request '#323 update-submodules/fix/utm-parameters->fix/utm-parameters: Update submodules' Co-authored-by: Automation51D <51DCI@51Degrees.com> --- .../src/fiftyone_devicedetection_onpremise/cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/cxx b/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/cxx index 81caa3b1f..93318c996 160000 --- a/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/cxx +++ b/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/cxx @@ -1 +1 @@ -Subproject commit 81caa3b1f0e093f0bc0e392b7e7be4e6986284c5 +Subproject commit 93318c996948b0e431180c7c9ff3abdefe65dcd1 From ba2773297708b07de86c375f7be38ccb8eece113 Mon Sep 17 00:00:00 2001 From: Oleksandr Lazarenko Date: Tue, 23 Jun 2026 17:54:46 +0200 Subject: [PATCH 4/5] FIX: Ci/CD pipeline --- ci/build-package.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ci/build-package.ps1 b/ci/build-package.ps1 index a9eddc798..54cc835b5 100644 --- a/ci/build-package.ps1 +++ b/ci/build-package.ps1 @@ -5,6 +5,19 @@ param ( [string]$Version ) +# GitVersion emits a SemVer string. For `main` this is a clean release (e.g. +# 4.6.0) and for `version/*` branches a recognised prerelease (e.g. 4.6.0-alpha.1) +# - both of which setuptools/PEP 440 accept. Any other branch produces an +# arbitrary prerelease label taken from the branch name (e.g. +# 4.6.0-fix-utm-parameters.1), which is NOT a valid PEP 440 version, so modern +# setuptools rejects it and `python -m build` fails. Convert such a label into a +# PEP 440 local-version segment so the package still builds on any branch. +if ($Version -match '^(\d+\.\d+\.\d+)-(?!(?:alpha|beta|rc)[.0-9]*$)(.+)$') { + $local = ($Matches[2] -replace '[^0-9A-Za-z]+', '.').Trim('.') + $Version = "$($Matches[1])+$local" + Write-Output "Normalized non-PEP 440 branch version to '$Version'" +} + $packages = "fiftyone_devicedetection_shared", "fiftyone_devicedetection_cloud", "fiftyone_devicedetection_onpremise", "fiftyone_devicedetection" ./python/build-package-pypi.ps1 -RepoName $RepoName -Version $Version -Packages $packages From 88b8572880a0f27accd8842d50d02615fe2ea705 Mon Sep 17 00:00:00 2001 From: Oleksandr Lazarenko Date: Wed, 24 Jun 2026 11:28:30 +0200 Subject: [PATCH 5/5] FIX: reverrt CI changes and fix tests --- ci/build-package.ps1 | 13 ------------- .../devicedetection_onpremise.py | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/ci/build-package.ps1 b/ci/build-package.ps1 index 54cc835b5..a9eddc798 100644 --- a/ci/build-package.ps1 +++ b/ci/build-package.ps1 @@ -5,19 +5,6 @@ param ( [string]$Version ) -# GitVersion emits a SemVer string. For `main` this is a clean release (e.g. -# 4.6.0) and for `version/*` branches a recognised prerelease (e.g. 4.6.0-alpha.1) -# - both of which setuptools/PEP 440 accept. Any other branch produces an -# arbitrary prerelease label taken from the branch name (e.g. -# 4.6.0-fix-utm-parameters.1), which is NOT a valid PEP 440 version, so modern -# setuptools rejects it and `python -m build` fails. Convert such a label into a -# PEP 440 local-version segment so the package still builds on any branch. -if ($Version -match '^(\d+\.\d+\.\d+)-(?!(?:alpha|beta|rc)[.0-9]*$)(.+)$') { - $local = ($Matches[2] -replace '[^0-9A-Za-z]+', '.').Trim('.') - $Version = "$($Matches[1])+$local" - Write-Output "Normalized non-PEP 440 branch version to '$Version'" -} - $packages = "fiftyone_devicedetection_shared", "fiftyone_devicedetection_cloud", "fiftyone_devicedetection_onpremise", "fiftyone_devicedetection" ./python/build-package-pypi.ps1 -RepoName $RepoName -Version $Version -Packages $packages diff --git a/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/devicedetection_onpremise.py b/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/devicedetection_onpremise.py index d1f1c264a..f57992026 100644 --- a/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/devicedetection_onpremise.py +++ b/fiftyone_devicedetection_onpremise/src/fiftyone_devicedetection_onpremise/devicedetection_onpremise.py @@ -148,7 +148,7 @@ def __init__( self.data = data if not licence_keys and licence_keys != "": - raise Exception("licence key is required. A key can be obtained from the 51Degrees website: https://51degrees.com/pricing. If you do not wish to use a key then you can specify an empty string, but this will cause automatic updates to be disabled.") + raise Exception("licence key is required. A key can be obtained from the 51Degrees website: https://51degrees.com/pricing?utm_source=code&utm_medium=comment&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_onpremise-src-fiftyone_devicedetection_onpremise-devicedetection_onpremise.py&utm_term=licence-key-required. If you do not wish to use a key then you can specify an empty string, but this will cause automatic updates to be disabled.") # Create SWIG wrapper vector for restricted properties and add