Repository navigation
Take the package getting started examples' settings from the environment - #167
Merged
Merged
Conversation
…ed in the environment
… from the environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The getting started examples in the
fiftyone_devicedetectionandfiftyone_ipintelligencepackages 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.pyandip-intelligence/fiftyone_ipintelligence/examples/gettingstarted.py(lines 46 to 49 at 8d05fe2f) found the free Lite data file in the folders above them and setresource_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_PATHand_51DEGREES_RESOURCE_KEY.What the specification says
device-detection-specification/required-examples.md lines 29 and 30 at 706de1f0:
What changed
_51DEGREES_DD_PATHor_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.ExampleUtilsgainsget_data_file_path(), as the Device Detection one has.test_package_gettingstarted_from_root.py.test_reads_the_data_file_from_the_environmentnames 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_rootnow sets the variable aside, because CI names the Enterprise file there and that test is of the free file.How it was verified
rc8d05fe2. In the jobs that finished,test_reads_the_data_file_from_the_environmentfailed 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.rc28e5bf2, is green. Its ten Build and Test jobs, Python 3.10 to 3.14 on Ubuntu and Windows, each passed, with both tests oftest_package_gettingstarted_from_root.pyandtest_packagegettingstarted.pypassing for each product in each job. The 11Setting '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
examplesfolder, which no wheel holds, andExampleUtilsis in the examples package, which is never published.What remains
Nothing.