xetdata / pyxet

Python SDK for XetHub
https://xethub.com/
BSD 3-Clause "New" or "Revised" License
47 stars 7 forks source link

Update readthedocs to reference endpoints #133

Closed erinys closed 4 months ago

erinys commented 4 months ago

Ok, based on Hoyt's linear issue, which talks about endpoints, I updated docs in xethub/ and readthedocs here to talk about endpoints. Fixes PRO-46.

In looking for references, I am seeing now that there is inconsistent references in pyxet docs and docstrings. In a git grep of the pyxet repo for xet://, I see things like:

python/pyxet/pyxet/cli.py:            print("Please specify a valid repository name in format xet://domain:user/repo")
python/pyxet/pyxet/cli.py:            listing = [{'name': "xet://" + path + '/' + n['name'], 'type': 'branch'} for n in listing]
python/pyxet/pyxet/cli.py:    def delete(repo: Annotated[str, typer.Argument(help="Repository name in format xet://domain:user/repo")],
python/pyxet/pyxet/cli.py:                print("Please specify a valid repository name xet://[user]/[repo]")
python/pyxet/pyxet/cli.py:    def info(repo: Annotated[str, typer.Argument(help="Repository name in format xet://domain:user/repo")],
python/pyxet/pyxet/cli.py:            print("Please specify a valid repository name in format xet://[user]/[repo]")
python/pyxet/pyxet/cli.py:    def make(name: Annotated[str, typer.Argument(help="Repository name in format xet://domain:user/repo")],
python/pyxet/pyxet/cli.py:            xet_path = f'xet://{path_split}'
python/pyxet/pyxet/cli.py:        Forks a copy of a repository from xet://[user]/[repo] to your own account.
python/pyxet/pyxet/cli.py:        If dest is not provided, xet://[yourusername]/[repo] is used.
python/pyxet/pyxet/cli.py:            dest = "xet://" + fs.get_username() + "/" + repo_name
python/pyxet/pyxet/cli.py:    def ls(uri: Annotated[str, typer.Argument(help="A URI in format xet://domain:user")],
python/pyxet/pyxet/cli.py:    def rename(source: Annotated[str, typer.Argument(help="Origin repo to rename from in format xet://domain:user/repo)")],
python/pyxet/pyxet/cli.py:               dest: Annotated[str, typer.Argument(help="Repo to rename to in format xet://domain:user/repo")]):
python/pyxet/pyxet/cli.py:    def clone(source: Annotated[str, typer.Argument(help="Repository in format xet://domain:user/repo")],
python/pyxet/pyxet/cli.py:    def info(uri: Annotated[str, typer.Argument(help="A URI in format xet://[user]/[repo]")]):
python/pyxet/pyxet/file_system.py:    of the form `xet://<repo_user>/<repo_name>/<branch>/<path-to-file>`::
python/pyxet/pyxet/file_system.py:        f = pyxet.open('xet://XetHub/Flickr30k/main/results.csv')
python/pyxet/pyxet/file_system.py:    protocol = "xet"  # This allows pandas, etc. to implement "xet://"
python/pyxet/pyxet/file_system.py:        if path.startswith('xet://'):
python/pyxet/pyxet/file_system.py:        return 'xet://' + name.lstrip('/')
python/pyxet/pyxet/file_system.py:        or `xet://user/repo/branch`
python/pyxet/pyxet/file_system.py:        or `xet://user/repo/branch/[path]`
python/pyxet/pyxet/file_system.py:        src_name = 'xet://' + ret['full_name']
python/pyxet/pyxet/file_system.py:        Lists the repos available for a path of the form `user` or `xet://user`
python/pyxet/pyxet/file_system.py:        Lists the branches for a path of the form `user/repo` or `xet://user/repo`
python/pyxet/pyxet/file_system.py:            # xet://domain:/
python/pyxet/pyxet/file_system.py:        `user/repo/branch` or `xet://user/repo/branch`::
python/pyxet/pyxet/sync.py:            raise ValueError(f"Unsupported destination protocol: {self._dest_proto}, only xet:// targets are supported")
python/pyxet/pyxet/url_parsing.py:                            "          xet://<endpoint>:<user>/<repo>/<branch>/<path>.\n")
python/pyxet/pyxet/url_parsing.py:     - xet://user/repo/branch/[path]
python/pyxet/pyxet/url_parsing.py:    parse /user or xet://user
python/pyxet/pyxet/url_parsing.py:        raise ValueError(f"URL {url} not of the form xet://endpoint:user/repo/...")
python/pyxet/pyxet/url_parsing.py:    # Handle the case where we are xet://user/repo. In which case the domain
python/pyxet/pyxet/url_parsing.py:            sys.stderr.write("Warning:  The use of the xet:// prefix without an endpoint is deprecated and will be disabled in the future.\n"
python/pyxet/pyxet/url_parsing.py:                             "          Please switch URLs to use the format xet://<endpoint>:<user>/<repo>/<branch>/<path>.\n"

Note these inconsistencies:

I updated the docs to use "endpoint" consistently. If it makes sense (I didn't check to see if these are in comments or user-facing), could @hoytak or @seanses please open a new PR to go through the rest of the code files and make sure that we are (P1) consistently asking users to use "endpoint" throughout and (P3) potentially standardizing how we are composing URLs? From what I see of the grep, this looks pretty messy.

hoytak commented 4 months ago

I can fix the docstrings today.