Repository navigation
feat(config)!: make the default list of sources from three variables - #668
Merged
Merged
Conversation
This was referenced Nov 4, 2026
karhu
force-pushed
the
tnet-157/15-defaults
branch
2 times, most recently
from
November 5, 2026 08:16
2c0272a to
ff315f6
Compare
karhu
force-pushed
the
tnet-157/15-defaults
branch
2 times, most recently
from
November 5, 2026 14:05
970f476 to
adaf910
Compare
karhu
commented
Nov 5, 2026
karhu
force-pushed
the
tnet-157/15-defaults
branch
from
November 7, 2026 17:40
e5fc235 to
bd04749
Compare
karhu
force-pushed
the
tnet-157/15-defaults
branch
from
November 7, 2026 20:26
bd04749 to
85a756a
Compare
karhu
force-pushed
the
tnet-157/15-defaults
branch
from
November 7, 2026 22:40
85a756a to
06f05d1
Compare
karhu
force-pushed
the
tnet-157/15-defaults
branch
2 times, most recently
from
November 9, 2026 16:18
b77551e to
fc54428
Compare
karhu
force-pushed
the
tnet-157/15-defaults
branch
from
November 10, 2026 14:39
fc54428 to
9ec43cd
Compare
karhu
force-pushed
the
tnet-157/15-defaults
branch
from
November 10, 2026 15:50
9ec43cd to
04073c9
Compare
karhu
force-pushed
the
tnet-157/15-defaults
branch
from
November 10, 2026 16:24
04073c9 to
537d7bf
Compare
There was a problem hiding this comment.
An organization admin can review the limit in your organization's usage and billing settings.
Once the limit resets or is raised, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
The default list of sources came from TIMENET_HOME and TIMENET_REGISTRY. TIMENET_REGISTRY had two meanings: a URL was the registry after the local registry, and a local path was the local registry itself. Downloads went to the storage folder and builds to the registry folder, both under ~/.cache/timenet, where tools delete files without asking. Now each variable sets one thing. TIMENET_LOCAL_REGISTRY places the local registry, TIMENET_REMOTE_REGISTRY names the registry after it, and TIMENET_AUTO_BUILD puts the installed connectors last. default_sources() reads them at call time, and its arguments override them. default_local_registry() returns the local registry alone, and the first entry of the list is always that local registry. The local registry lies in ~/.timenet/registry, outside ~/.cache, because it holds builds. TIMENET_CACHE keeps ~/.cache/timenet for files that a build or a read can make again: the raw downloads in downloads/<dataset_id> and the control databases in control/. settings() raises TimeFValidationError for an empty or blank path or URL and for another invalid value, and the message names the variable. It loads the settings once, from the arguments merged over the variables, so an argument replaces an invalid variable. open_registry(), RemoteRegistry and S3Registry no longer take cache_dir=, and a remote registry reads only its own files. The planner alone decides where a release is read from. It resolves each release and each payload source through the list, and the local registry comes first in the default list. So a release in the local registry is read there, and the remote registry gets no request for it. BaseRegistry.local_root goes away, and LocalRegistry.root names the folder of a local registry. When TimeNet creates the downloads or the control folder of the cache, it writes a CACHEDIR.TAG marker file into it. It does not mark a folder that exists already. After a build, the engine deletes the raw downloads of the dataset only if the downloads folder holds the marker. The timenet cache group is now timenet local, for the local files of TimeNet. timenet local info shows the path and the size of the cache and of the local registry. timenet local cache info shows the cache alone. timenet local cache clear deletes the raw source files and the control databases of the cache, and only a folder that holds the marker. It keeps a folder without the marker, for example a folder of the user, and names it in a warning. A symlinked folder with the marker is unlinked, and its target stays. timenet local clear deletes the cache and each release directory in the local registry, but no other file. Each clear asks first, and --yes skips the question. In timenet.cache, clear_cache(cache_dir, local_registry=) deletes the folders of the cache, and clear_releases(store) deletes the releases through LocalRegistry.releases() and LocalRegistry.remove_release(). Before it deletes anything, clear_cache() runs one private check. It refuses a cache directory that is the home folder or a folder above it. With TIMENET_CACHE=~ on macOS, the downloads folder of the cache would be ~/Downloads. It also refuses a local registry and a folder to delete that are the same folder or that lie in each other, because the local registry holds builds. The check compares the folders on disk by device and inode number, not the text of the paths, so it also sees a symlink, or a name in other letter case on a volume that ignores case. A build that removes its raw downloads runs the same check before its first download. timenet local clear clears the cache first, so a failed check deletes no release. download() uses the same comparison to tell whether a registry in the list is the local registry. The build CLI and timenet_connectors.build() write to the local registry when no output is given. An empty or blank --out is an error, not the current directory. This glue stays until the producer API replaces them. The root conftest.py now gives each test its own local registry, remote registry and cache through the new variables instead of TIMENET_HOME. BREAKING CHANGE: TIMENET_HOME, TIMENET_STORAGE and TIMENET_REGISTRY are gone. TIMENET_LOCAL_REGISTRY (default ~/.timenet/registry) places the local registry, TIMENET_REMOTE_REGISTRY (default timenet://) names the registry after it, and TIMENET_AUTO_BUILD (default true) puts the installed connectors last. TIMENET_CACHE defaults to ~/.cache/timenet, and raw downloads lie under its downloads folder. default_registry_path() is gone. The timenet cache group is now timenet local, with info, clear, cache info and cache clear. clear_cache() takes the cache directory and local_registry=, and deletes only the folders of the cache. clear_releases() deletes the releases in the local registry. open_registry(), RemoteRegistry and S3Registry no longer take cache_dir=, and a remote registry reads no local copy. To read a local copy, put its LocalRegistry in the list of sources before the remote registry. BaseRegistry.local_root and LocalRegistry.local_root are gone. Use LocalRegistry.root. Part of TNET-157.
The glue comments of this change now start with TODO(adrian), so a search finds each one that is left. Part of TNET-157.
Shorter docstrings for the code that this change adds or changes. Part of TNET-157.
Drop tests that cannot fail or repeat other tests, and sharpen the rest. Part of TNET-157.
Main added two download tests for the retry of rate-limited presigns (#747). They pass cache_dir= to RemoteRegistry, and this PR removes that argument. The tests now make the registry without it. Part of TNET-157.
karhu
force-pushed
the
tnet-157/15-defaults
branch
from
November 10, 2026 17:41
537d7bf to
0311d8e
Compare
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 Stack
This stack covers refactoring the internal logic of how releases are resolved during read, download & build, in particular also in the context of parent releases / parent datasets. On top of that it refactors the public TimeNet APIs and CLI interfaces around these actions, to streamline the behavior across them.
This PR
Three environment variables make the default list of sources, each with one meaning. The new group
timenet localreplacestimenet cache.timenet local cache cleardeletes only the folders that TimeNet marked as its own.Details
TIMENET_REGISTRYhad two meanings: a URL was the registry after the store, and a local path was the store itself. Downloads went to the storage folder and builds to the registry folder, both under~/.cache/timenet. Cleanup tools delete files there without asking, and a build can take hours to make again.TIMENET_LOCAL_REGISTRY(default~/.timenet/registry) places the store.TIMENET_REMOTE_REGISTRY(defaulttimenet://) names the registry after it.TIMENET_AUTO_BUILD(defaulttrue) puts the installed connectors last.default_sources()reads the variables at call time, and its arguments override them.default_local_registry()returns the store alone. The first entry of the list is always the store.open_registry(),RemoteRegistryandS3Registrytakelocal_registry=instead ofcache_dir=. A remote registry reads a complete copy in that local registry only for the same release. For the same release, the two manifests are equal apart from the build environment. Withoutlocal_registry=, it reads only its own files.default_sources()passes its store.TIMENET_CACHE(default~/.cache/timenet) holds only files that a build or a read can make again: the raw downloads indownloads/<dataset_id>and the control databases incontrol/.settings()raisesTimeFValidationErrorfor an empty or blank value and for another invalid value. The message names the variable.downloadsor thecontrolfolder of the cache, it writes aCACHEDIR.TAGmarker file into it. If one of these two folders holds the marker,timenet local cache cleardeletes it. It deletes no other folder of the cache. A folder without the marker stays, and a warning names it.timenet local infoshows the path and the size of the cache and of the store.timenet local cache infoshows the cache alone.timenet local cleardeletes the marked folders of the cache and each release in the store, but no other file. Each clear asks first, and--yesskips the question.downloadsfolder has no marker, they stay.timenet-buildandtimenet_connectors.build()write to the store. An empty or blank--outis an error, not the current directory.TIMENET_HOME.Design decisions
~/.cache, because it holds builds. The cache holds only files that TimeNet can make again, so a cleanup tool can delete all of it.settings()rejects a cache that is the home folder or a folder above it. WithTIMENET_CACHE=~on macOS, thedownloadsfolder of the cache is~/Downloads, because the volume ignores letter case.settings()rejects a store and a cache that are the same folder or lie in each other. If the store and a folder thatclear_cache()deletes overlap, it deletes nothing and raises an error.download()finds the store in the list with the same identity check assettings(). So the two checks cannot disagree on a symlink or a case variant.CACHEDIR.TAGis a standard marker, and backup tools skip the folders that hold it. TimeNet does not mark a folder that exists already, because that folder can belong to the user.timenet local, nottimenet cache, because it also shows and clears the store, and the store is not a cache.timenet local cache clearclears the cache alone, andtimenet local clearclears both. So no clear needs an extra flag.settings()checks each variable on each call, also a variable that an argument overrides. So a wrong value in the shell fails at once, not later in another command.local_registry=reads no local copy. So a list of sources that the caller gives does not readTIMENET_LOCAL_REGISTRY.timenet._registry_uri, which imports onlytimenet.errors. Sotimenet.configcan import it at the top without a circular import.timenet.registrystill exportslocal_registry_pathandTIMENET_REGISTRY_URL.Breaking changes
TIMENET_HOME,TIMENET_STORAGEandTIMENET_REGISTRYare gone.TIMENET_LOCAL_REGISTRY,TIMENET_REMOTE_REGISTRYandTIMENET_AUTO_BUILDreplace them.<TIMENET_CACHE>/downloads.default_registry_path()is gone.timenet cachegroup and the--allflag oftimenet cache clearare gone. The new grouptimenet localhasinfo,clear,cache infoandcache clear.timenet local cache cleardeletes only thedownloadsandcontrolfolders that TimeNet marked.TimeNetSettingsloseshome,storage,registry,home_dir,storage_dirandregistry_path.timenet.cache,cached_datasets(),raw_cache_size()andCachedDatasetare gone.stored_releases(),cache_size()andStoredReleasereplace them.clear_cache(*, include_registry)is nowclear_cache(cache_dir, *, local_registry). It deletes only the folders of the cache and returns aClearedCache. The newclear_releases(store)deletes the releases in the store and returns aClearedReleases.open_registry(),RemoteRegistryandS3Registrytakelocal_registry=instead ofcache_dir=. Withoutlocal_registry=, a remote registry reads no local copy. Before, it read the copies in the storage folder.BaseRegistry.local_rootis gone. UseLocalRegistry.root.Stack
Changes later in the stack:
timenet local downloadsandtimenet local builds, which tell a downloaded release from a build.timenet_connectors.build()and the store fallback oftimenet-buildare glue. The PRs on the producer API and ontimenet-build --publish-toreplace them.Merge message