Disclose usage reporting: README, environment opt-out, notice link - #1
Merged
Merged
Conversation
…bump to 0.2.0
The constructor now checks the two environment opt-outs shared by every
trace client -- TRACE_USAGE_REPORTING=off (off/false/0/no) and
DO_NOT_TRACK=1 (1/true/yes), case-insensitive -- before the program's own
enabled flag, so a user can switch off every trace-reporting program at
once. TraceClient.disabled_reason says why a client reports nothing
("environment", "config", "no key"; None when on) so programs can log it.
Adds tests/__init__.py: without it `python -m unittest -v` discovered no
tests at all (CI has been failing with "NO TESTS RAN" on 3.12 and passing
vacuously on 3.8 since the first commit). 21 tests now run on 3.8 and 3.11.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Part of the trace disclosure pass. Usage reporting was rolled out without a loud enable or a one-step exit; this release gives the Python client the environment opt-out shared by every trace client, a way for programs to say why reporting is off, and README wording that points at the public details page. Nothing about what is sent changes.
trace_client/trace_client.py,trace_client/__init__.py:TRACE_USAGE_REPORTING=off(accepted:off,false,0,no, case-insensitive) andDO_NOT_TRACK=1(accepted:1,true,yes) are checked in the constructor before the program's ownenabledflag;environment_opts_out()and the variable/reason constants are exported. Adisabled_reasonattribute is set once at construction to"environment","config"or"no key"(first match wins), orNonewhen the client reports. Header,__version__and therefore theUser-Agentare bumped to 0.2.0. Existing behaviour (returns immediately, never raises, bounded queue,close()drains) is untouched; Python 3.8+ and the standard library only.pyproject.toml: version 0.2.0.tests/test_trace_client.py,tests/__init__.py: tests for each variable, each accepted value, the values that must not opt out, precedence overenabled=Falseand over a missing key,disabled_reasonin every state, and the 0.2.0 User-Agent. Every test now starts from an environment scrubbed of both variables so a host that has opted out cannot break the suite.tests/__init__.pyis new: without itpython -m unittest -v(the documented and CI command) discovered nothing, so CI had been failing withNO TESTS RANon 3.12 and passing vacuously on 3.8 since the first commit. 21 tests now run and pass on 3.8 and 3.11.README.md: the opt-out paragraph becomes a## Turning it offsection listing every way to switch reporting off in precedence order,disabled_reason, and the first-run notice now namesTRACE_USAGE_REPORTING=offand links https://github.com/Stephenson-Software/trace#usage-reporting.🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson