Skip to content

Take the package getting started examples' settings from the environment - #167

Merged
jwrosewell merged 2 commits into
rcfrom
fix/package-examples-settings
Nov 15, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
fix/package-examples-settings

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The getting started examples in the fiftyone_devicedetection and fiftyone_ipintelligence packages took their data file and Resource Key only by editing the source. Each now takes its data file from the environment variable every other example reads, before finding the free file, and its Resource Key from _51DEGREES_RESOURCE_KEY.

Problem

device-detection/fiftyone_devicedetection/examples/gettingstarted.py and ip-intelligence/fiftyone_ipintelligence/examples/gettingstarted.py (lines 46 to 49 at 8d05fe2f) found the free Lite data file in the folders above them and set resource_key = "!!YOUR_RESOURCE_KEY!!", so a person could choose another data file or give a Resource Key only by changing the example. The examples package's own examples read _51DEGREES_DD_PATH, _51DEGREES_IPI_PATH and _51DEGREES_RESOURCE_KEY.

What the specification says

device-detection-specification/required-examples.md lines 29 and 30 at 706de1f0:

It MUST be possible to programmatically supply any necessary configuration or parameters, such as cloud resource keys, or device detection license keys.

What changed

  1. Each example takes the data file named in _51DEGREES_DD_PATH or _51DEGREES_IPI_PATH (or its deprecated old name) when one is set, and otherwise finds or downloads the free Lite file as before. The Resource Key for the commented Cloud line comes from _51DEGREES_RESOURCE_KEY, with the placeholder kept when it is unset, so the line still reads as an instruction.
  2. The IP Intelligence ExampleUtils gains get_data_file_path(), as the Device Detection one has.
  3. Tests in each product's test_package_gettingstarted_from_root.py. test_reads_the_data_file_from_the_environment names a file that is not there in the variable and checks the example stops naming it, which shows the variable was read. test_runs_from_the_repository_root now sets the variable aside, because CI names the Enterprise file there and that test is of the free file.

How it was verified

  • Red, full build 43652063732 on 7d1dd74, the tests alone on rc 8d05fe2. In the jobs that finished, test_reads_the_data_file_from_the_environment failed in both the Device Detection and IP Intelligence examples ("1 failed, 70 passed" and "1 failed, 51 passed"), as the examples ignored the variable and ran on the free file. The other jobs were cancelled to free runners once that was shown.
  • Green, full build 43654797409 on the head fb00330, from rc 28e5bf2, is green. Its ten Build and Test jobs, Python 3.10 to 3.14 on Ubuntu and Windows, each passed, with both tests of test_package_gettingstarted_from_root.py and test_packagegettingstarted.py passing for each product in each job. The 11 Setting 'PullRequestSha' lines all name fb00330, and Configure printed "Left out 5 macOS entries". macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.

What it releases

Nothing. The getting started examples sit in each package's examples folder, which no wheel holds, and ExampleUtils is in the examples package, which is never published.

What remains

Nothing.

@jwrosewell
jwrosewell marked this pull request as ready for review November 15, 2026 01:02
@jwrosewell
jwrosewell merged commit 6602d73 into rc Nov 15, 2026
3 checks passed
@jwrosewell
jwrosewell deleted the fix/package-examples-settings branch November 15, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant