pyselfupdate 0.5.1__tar.gz → 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/PKG-INFO +1 -1
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/github.py +3 -4
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/install.py +0 -3
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/notifier.py +13 -11
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/.gitignore +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/LICENSE +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/README.md +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/pyproject.toml +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/__init__.py +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/config.py +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/errors.py +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/py.typed +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/source.py +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/state.py +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/typercmd.py +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/updater.py +0 -0
- {pyselfupdate-0.5.1 → pyselfupdate-0.5.2}/src/pyselfupdate/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pyselfupdate
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: Self-update and update notification for Python CLIs installed with uv tool
|
|
5
5
|
Project-URL: Repository, https://github.com/datapointchris/pyselfupdate
|
|
6
6
|
Project-URL: Issues, https://github.com/datapointchris/pyselfupdate/issues
|
|
@@ -88,10 +88,9 @@ DEFAULT_TOKEN_COMMAND = 'gh auth token' # nosec B105
|
|
|
88
88
|
|
|
89
89
|
Authenticating is the default because the alternative is not "no credential" but
|
|
90
90
|
"sixty requests an hour, charged per IP address and shared by every host behind
|
|
91
|
-
one egress".
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
nobody sets, and eleven of fourteen tools here had not.
|
|
91
|
+
one egress". Two machines checking on a timer can hold that pool at zero for
|
|
92
|
+
whole hours, and every tool behind the same address that asks anonymously is
|
|
93
|
+
then refused. A default that has to be opted into is a default nobody sets.
|
|
95
94
|
"""
|
|
96
95
|
|
|
97
96
|
|
|
@@ -83,9 +83,6 @@ class Installation:
|
|
|
83
83
|
# raises NotInstalledError on them instead of dropping them.
|
|
84
84
|
_unrebuildable: tuple[str, ...] = field(default=(), repr=False)
|
|
85
85
|
|
|
86
|
-
def is_updatable(self) -> bool:
|
|
87
|
-
return self.kind is not InstallKind.LOCAL
|
|
88
|
-
|
|
89
86
|
|
|
90
87
|
def tool_dir() -> Path:
|
|
91
88
|
"""uv's tool directory.
|
|
@@ -28,11 +28,12 @@ from pyselfupdate.updater import installed_from_release
|
|
|
28
28
|
|
|
29
29
|
DEFAULT_INTERVAL = dt.timedelta(hours=24)
|
|
30
30
|
|
|
31
|
-
#
|
|
31
|
+
# The environment variables every tool honors, beside its own `<TOOL>_` forms.
|
|
32
|
+
# The disable switch is presence-only, any value including empty -- the
|
|
32
33
|
# NO_COLOR convention -- so that NO_AUTO_UPDATE=0 cannot mean "on". The interval
|
|
33
34
|
# gets its own name precisely so presence and value never share one variable.
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
_SHARED_DISABLE_VARIABLE = 'NO_AUTO_UPDATE'
|
|
36
|
+
_SHARED_INTERVAL_VARIABLE = 'AUTO_UPDATE_INTERVAL'
|
|
36
37
|
|
|
37
38
|
CI_VARIABLES = ('CI', 'BUILD_NUMBER', 'RUN_ID', 'GITHUB_ACTIONS', 'CODESPACES')
|
|
38
39
|
|
|
@@ -97,9 +98,10 @@ def notify(
|
|
|
97
98
|
def enabled(config: Config, *, interactive: bool | None = None) -> tuple[bool, Skip | None]:
|
|
98
99
|
"""Whether a check would run, without touching the network or the clock.
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
For a caller that reports why a tool does or does not check, such as a
|
|
102
|
+
dashboard listing installed tools or a `<tool> update --why`. The interval
|
|
103
|
+
is deliberately not consulted: this answers "is this tool opted in", not "is
|
|
104
|
+
it due".
|
|
103
105
|
"""
|
|
104
106
|
if _disabled_by_env(config.tool):
|
|
105
107
|
return False, Skip.DISABLED
|
|
@@ -122,9 +124,9 @@ def _asking_for_help() -> bool:
|
|
|
122
124
|
screen. Nothing a notice is for happens on a help screen, and the check
|
|
123
125
|
costs a releases-API call and a state write every time.
|
|
124
126
|
|
|
125
|
-
It lands hardest on a reader that walks a tool's help.
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
It lands hardest on a reader that walks a tool's help. Reading every
|
|
128
|
+
command's help is one invocation per command plus one for the root, and
|
|
129
|
+
each of them reaches this.
|
|
128
130
|
|
|
129
131
|
A `--` ends the scan, because everything after it is the command's own
|
|
130
132
|
argument. Skipping when it should not have costs a missed notice, which is
|
|
@@ -201,7 +203,7 @@ def _emit(message: str, *, out: TextIO | None, defer: bool) -> None:
|
|
|
201
203
|
|
|
202
204
|
|
|
203
205
|
def _disabled_by_env(tool: str) -> bool:
|
|
204
|
-
return
|
|
206
|
+
return _SHARED_DISABLE_VARIABLE in os.environ or _tool_variable(tool, 'NO_AUTO_UPDATE') in os.environ
|
|
205
207
|
|
|
206
208
|
|
|
207
209
|
def _in_ci() -> bool:
|
|
@@ -250,7 +252,7 @@ def _is_local_install(config: Config) -> bool:
|
|
|
250
252
|
def _interval(tool: str, override: dt.timedelta | None) -> dt.timedelta:
|
|
251
253
|
if override is not None:
|
|
252
254
|
return override
|
|
253
|
-
for name in (_tool_variable(tool, 'AUTO_UPDATE_INTERVAL'),
|
|
255
|
+
for name in (_tool_variable(tool, 'AUTO_UPDATE_INTERVAL'), _SHARED_INTERVAL_VARIABLE):
|
|
254
256
|
raw = os.environ.get(name)
|
|
255
257
|
if raw:
|
|
256
258
|
parsed = parse_interval(raw)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|