Skip to content

Commit 4b349e4

Browse files
committed
Copier Template: Proper fix for breakage introduced by Hatch 1.16.0.
Need 'builder = True' for development/QA environment configurations. Otherwise `hatch --env <env> build` and `hatch --env <env> version` break. Replaces 'env -u HATCH_ENV_ACTIVE' hack suggested by an LLM. * Project: Also fix in current project so that tests will pass again. * Reference: pypa/hatch#2113
1 parent c6bc86d commit 4b349e4

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ strict-naming = false
106106
python = '3.10'
107107
[tool.hatch.envs.develop]
108108
description = ''' Development environment. '''
109+
builder = true
109110
dependencies = [
110111
'Jinja2',
111112
'coverage[toml]',
@@ -149,7 +150,7 @@ linters = [
149150
"""pyright sources""",
150151
]
151152
packagers = [
152-
"""env -u HATCH_ENV_ACTIVE hatch build""",
153+
"""hatch build""",
153154
# --- BEGIN: Injected by Copier ---
154155
# --- END: Injected by Copier ---
155156
]

template/pyproject.toml.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ strict-naming = false
127127
python = '{{ python_version_min }}'
128128
[tool.hatch.envs.develop]
129129
description = ''' Development environment. '''
130+
builder = true
130131
dependencies = [
131132
'Jinja2',
132133
'coverage[toml]',
@@ -191,7 +192,7 @@ linters = [
191192
"""pyright sources""",
192193
]
193194
packagers = [
194-
"""env -u HATCH_ENV_ACTIVE hatch build""",
195+
"""hatch build""",
195196
# --- BEGIN: Injected by Copier ---
196197
{%- if enable_executables %}
197198
"""pyinstaller \

0 commit comments

Comments
 (0)