{"id":13600081,"url":"https://github.com/ofek/hatch-containers","last_synced_at":"2025-04-30T08:22:26.949Z","repository":{"id":40360173,"uuid":"442634636","full_name":"ofek/hatch-containers","owner":"ofek","description":"Hatch plugin for Docker containers","archived":false,"fork":false,"pushed_at":"2023-06-01T07:58:16.000Z","size":74,"stargazers_count":22,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T14:21:57.295Z","etag":null,"topics":["containers","docker","hatch","plugin","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ofek.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["ofek"],"custom":["https://ofek.dev/donate/"]}},"created_at":"2021-12-29T02:08:03.000Z","updated_at":"2025-03-14T17:45:39.000Z","dependencies_parsed_at":"2024-01-16T23:26:19.987Z","dependency_job_id":"b520b571-9d0a-46a6-80da-44f547430877","html_url":"https://github.com/ofek/hatch-containers","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.1785714285714286,"last_synced_commit":"81a4139c1fe306451f55d90094671319217abaee"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofek%2Fhatch-containers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofek%2Fhatch-containers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofek%2Fhatch-containers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofek%2Fhatch-containers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ofek","download_url":"https://codeload.github.com/ofek/hatch-containers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251666790,"owners_count":21624367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containers","docker","hatch","plugin","python"],"created_at":"2024-08-01T18:00:22.572Z","updated_at":"2025-04-30T08:22:26.929Z","avatar_url":"https://github.com/ofek.png","language":"Python","funding_links":["https://github.com/sponsors/ofek","https://ofek.dev/donate/"],"categories":["Plugins"],"sub_categories":[],"readme":"# hatch-containers\n\n| | |\n| --- | --- |\n| CI/CD | [![CI - Test](https://github.com/ofek/hatch-containers/actions/workflows/test.yml/badge.svg)](https://github.com/ofek/hatch-containers/actions/workflows/test.yml) [![CD - Build](https://github.com/ofek/hatch-containers/actions/workflows/build.yml/badge.svg)](https://github.com/ofek/hatch/actions-containers/workflows/build.yml) |\n| Package | [![PyPI - Version](https://img.shields.io/pypi/v/hatch-containers.svg?logo=pypi\u0026label=PyPI\u0026logoColor=gold)](https://pypi.org/project/hatch-containers/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hatch-containers.svg?logo=python\u0026label=Python\u0026logoColor=gold)](https://pypi.org/project/hatch-containers/) |\n| Meta | [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch) [![code style - black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![types - Mypy](https://img.shields.io/badge/types-Mypy-blue.svg)](https://github.com/ambv/black) [![License - MIT](https://img.shields.io/badge/license-MIT-9400d3.svg)](https://spdx.org/licenses/) [![GitHub Sponsors](https://img.shields.io/github/sponsors/ofek?logo=GitHub%20Sponsors\u0026style=social)](https://github.com/sponsors/ofek) |\n\n-----\n\nThis provides a plugin for [Hatch](https://github.com/pypa/hatch) that allows the use of containerized [environments](https://hatch.pypa.io/latest/environment/).\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [Configuration](#configuration)\n  - [Python](#python)\n  - [Image](#image)\n  - [Command](#command)\n  - [Startup](#startup)\n  - [Shell](#shell)\n- [Notes](#notes)\n- [Future](#future)\n- [License](#license)\n\n## Installation\n\n```console\npip install hatch-containers\n```\n\n## Configuration\n\nThe [environment plugin](https://hatch.pypa.io/latest/plugins/environment/) name is `container`.\n\n- ***pyproject.toml***\n\n    ```toml\n    [tool.hatch.envs.\u003cENV_NAME\u003e]\n    type = \"container\"\n    ```\n\n- ***hatch.toml***\n\n    ```toml\n    [envs.\u003cENV_NAME\u003e]\n    type = \"container\"\n    ```\n\n### Python\n\nIf the [Python version](https://hatch.pypa.io/latest/config/environment/#python-version) is set to a multi-character integer like `310` then it will be interpreted as its `\u003cMAJOR\u003e.\u003cMINOR\u003e` form e.g. `3.10`.\n\nIf not set, then the `\u003cMAJOR\u003e.\u003cMINOR\u003e` version of the first `python` found along your `PATH` will be used, defaulting to the Python executable Hatch is running on.\n\n### Image\n\nThe `image` option specifies the container image to use e.g. `python:alpine`. It recognizes the placeholder value `{version}` which will be replaced by the value of the [Python option](#python).\n\nDefault:\n\n```toml\n[envs.\u003cENV_NAME\u003e]\nimage = \"python:{version}\"\n```\n\n### Command\n\nThe `command` option specifies the command that the container will execute when [started](#startup).\n\nDefault:\n\n```toml\n[envs.\u003cENV_NAME\u003e]\ncommand = [\"/bin/sleep\", \"infinity\"]\n```\n\n### Startup\n\nBy default, containers will be started automatically when [entered](https://hatch.pypa.io/latest/environment/#entering-environments) or when [running commands](https://hatch.pypa.io/latest/environment/#command-execution) and will be stopped immediately after. If you want containers to start automatically upon [creation](https://hatch.pypa.io/latest/environment/#creation) and not be stopped until [removal](https://hatch.pypa.io/latest/environment/#removal), you can set `start-on-creation` to `true`.\n\nDefault:\n\n```toml\n[envs.\u003cENV_NAME\u003e]\nstart-on-creation = false\n```\n\n### Shell\n\nThe `shell` option specifies the executable that will be used when [entering](https://hatch.pypa.io/latest/environment/#entering-environments) containers. By default, this is set to `/bin/bash` unless `alpine` is in the [image](#image) name, in which case `/bin/ash` will be used instead.\n\n## Notes\n\n- There must be a `docker` executable along your `PATH`.\n- The `env-exclude` [environment variable filter](https://hatch.pypa.io/latest/config/environment/#filters) has no effect.\n\n## Future\n\n- Support for Windows containers\n- Support for building images\n\n## License\n\n`hatch-containers` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofek%2Fhatch-containers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofek%2Fhatch-containers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofek%2Fhatch-containers/lists"}