Metadata-Version: 2.2
Name: insta-science
Version: 0.6.1
Summary: A tool to help with installing and using `science` in Python projects.
Author-email: John Sirois <john.sirois@gmail.com>
Project-URL: Repository, https://github.com/a-scie/science-installers/tree/main/python
Project-URL: Bug Tracker, https://github.com/a-scie/science-installers/issues
Project-URL: Changelog, https://github.com/a-scie/science-installers/blob/main/python/CHANGES.md
Keywords: automation,command,runner,testing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: ansicolors
Requires-Dist: appdirs
Requires-Dist: colorama; sys_platform == "win32"
Requires-Dist: filelock
Requires-Dist: httpx
Requires-Dist: packaging
Requires-Dist: tenacity
Requires-Dist: tomli; python_version < "3.11"
Requires-Dist: tqdm
Requires-Dist: typing-extensions

# insta-science

[![PyPI Version](https://shields.io/pypi/v/insta-science.svg)](https://pypi.org/project/insta-science/)
[![License](https://shields.io/pypi/l/insta-science.svg)](../LICENSE)
[![Supported Pythons](https://shields.io/pypi/pyversions/insta-science.svg)](pyproject.toml)
[![CI](https://img.shields.io/github/actions/workflow/status/a-scie/science-installers/python-ci.yml)](https://github.com/a-scie/science-installers/actions/workflows/python-ci.yml)

The `insta-science` Python project distribution provides two convenience console scripts to make
bootstrapping `science` for use in Python projects easier:
+ `insta-science`: This is a shim script that ensures `science` is installed and then forwards all
  supplied arguments to it. Instead of `science`, just use `insta-science`. You can configure the
  `science` version to use, where to find `science` binaries and where to install them via the 
  `[tool.insta-science]` table in your `pyproject.toml` file.
+ `insta-science-util`: This script provides utilities for managing `science` binaries. In
  particular, it supports downloading families of `science` binaries for various platforms for
  use in internal serving systems for offline or isolated installation.

This project is under active early development and APIs and configuration are likely to change
rapidly in breaking ways until the 1.0 release.

## Configuration

By default, `insta-science` downloads the latest science binary release appropriate for the current
platform from the `science` [GitHub Releases](https://github.com/a-scie/lift/releases) and caches it
before executing for the 1st time. You can control aspects of this process using the
`[tool.insta-science]` table in your `pyproject.toml` file. Available configuration options are
detailed below:

| Option             | Default                                   | `pyproject.toml` entry                  | Environment Variable  |
|--------------------|-------------------------------------------|-----------------------------------------|-----------------------|
| `science` version  | latest                                    | [tool.insta-science.science] `version`  |                       |
| `science` Base URL | https://github.com/a-scie/lift/releases   | [tool.insta-science.science] `base-url` |                       |
| Cache directory    | Unix:    `~/.cache/insta-science`         | [tool.insta-science] `cache`            | `INSTA_SCIENCE_CACHE` |
|                    | Mac:     `~/Library/Caches/insta-science` |                                         |                       |
|                    | Windows: `~\AppData\Local\insta-science`  |                                         |                       |

## Offline Use

There is full support for offline or firewalled `science` use with `insta-science`. You can seed
a repository of science binaries by using the `insta-science-util download` command to download
`science` binaries for one or more versions and one or more target platforms. The directory you
download these binaries to will have the appropriate structure for `insta-science` to use if you
serve up that directory using your method of choice at the configured base url. Note that file://
base URLs are supported.

Likewise, you can seed a repository of `ptex` binaries, `scie-jump` binaries and interpreter
provider distributions by using the `insta-science download {ptex,scie-jump,provider} ...` family
of commands and updating corresponding `base_url` options in your scie lift manifest.

## Development

Development uses [`uv`](https://docs.astral.sh/uv/getting-started/installation/). Install as you
best see fit.

With `uv` installed, running `uv run dev-cmd` is enough to get the tools insta-science uses
installed and run against the codebase. This includes formatting code, linting code, performing type
checks and then running tests.
