Skip to content

0.0.3

Latest

Choose a tag to compare

@github-actions github-actions released this 19 Nov 19:42

Release Notes

uv add --dev "basedpython>=0.0.3"

stubs

  • a module with a stub is checked against it:
    what the stub declares for a parameter, a return type, a module variable or a class attribute
    the module leaves unannotated is its declared type in the module's own body, and
    missing-runtime-member, incompatible-stub-signature, incompatible-stub-attribute,
    incompatible-stub-bases and missing-stub-member report where the two disagree
  • a stub's types are read in terms of the runtime module it describes, so a class the stub defines
    is the module's class of the same name
  • a package with a by.typed marker is typed by its .byi, as its .by is already the source,
    rather than by the .pyi derived from it
  • an editor can show a stub and its module side by side, declaration by declaration, with
    by/documentCounterparts
  • the on-disk copy of the vendored stubs is named after their contents, so a new by no longer
    opens an older one's copy for go-to-definition

by run and by repl

  • by run takes the path of
    a file as well as a module name: by run app/cli.by runs app.cli inside its package, and
    by run manage.py check runs a .py file as python runs a script. by repl --module takes a
    path with the same meaning
  • what the program writes into the staged tree is written back to the project: a new file, or a
    changed copy of a file still holding what was staged. a file the program deleted, renamed away
    or replaced is kept and reported, and nothing in __pycache__ is written back
  • --notes PATH writes what by run says after the program ends to PATH as json lines, so the
    program's own last line ends the output
  • an uncaught exception prints every exception chained to it, as python does, and its traceback
    leaves out every frame of by's own runner
  • the program gets the __main__ namespace python gives a script
  • a module importlib.reload compiles after its .by was saved over is compiled where it is

django

  • a manage.py lens
    in a project with a .by source runs through by run, so the command sees the .by models and
    what it writes is written back
  • a lens runs the manage.py it was offered for, so two django workspaces each run their own,
    and is refused in a workspace the editor does not trust

narrowing

  • a predicate
    or assertion
    recovered from a function's body narrows in .py files too, and its hint shows the place it narrows
  • recovery no longer narrows through a break out of a finally, a non-def override, a
    decorator, or a TypeIs about another place

editor

  • every inlay hint whose label is source carries the edit that writes it, and a tooltip where it
    has more to say. by/inlayHintCatalog lists every kind of hint with a live example
  • no completions are offered inside a number literal

other changes

  • a directory below a package root holding a basedpython module is a
    regular package without an
    __init__.by
  • a type test at the end of a comparison chain, x < 1 is int, is rejected rather than lowered to
    x < False, and the linter no longer reports python's identity-comparison rules on a type test
  • a checked .py operator dunder declares the NotImplemented it returns, as a .by one does
  • an override in a vendored stub takes no default from the method it overrides

Install basedpython 0.0.3

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/KotlinIsland/basedpython/releases/download/0.0.3/basedpython-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/KotlinIsland/basedpython/releases/download/0.0.3/basedpython-installer.ps1 | iex"

Download basedpython 0.0.3

File Platform Checksum
basedpython-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
basedpython-x86_64-apple-darwin.tar.gz Intel macOS checksum
basedpython-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
basedpython-i686-pc-windows-msvc.zip x86 Windows checksum
basedpython-x86_64-pc-windows-msvc.zip x64 Windows checksum
basedpython-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
basedpython-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
basedpython-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
basedpython-riscv64gc-unknown-linux-gnu.tar.gz RISCV Linux checksum
basedpython-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
basedpython-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
basedpython-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
basedpython-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
basedpython-i686-unknown-linux-musl.tar.gz x86 MUSL Linux checksum
basedpython-x86_64-unknown-linux-musl.tar.gz x64 MUSL Linux checksum
basedpython-arm-unknown-linux-musleabihf.tar.gz ARMv6 MUSL Linux (Hardfloat) checksum
basedpython-armv7-unknown-linux-musleabihf.tar.gz ARMv7 MUSL Linux checksum

Verifying GitHub Artifact Attestations

The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the GitHub CLI:

gh attestation verify <file-path of downloaded artifact> --repo KotlinIsland/basedpython

You can also download the attestation from GitHub and verify against that directly:

gh attestation verify <file-path of downloaded artifact> --bundle <file-path of downloaded attestation>