Skip to content

Commit a0e624f

Browse files
authored
Merge branch 'master' into fix-keyring-auth
2 parents d475221 + 750b498 commit a0e624f

File tree

20 files changed

+455
-336
lines changed

20 files changed

+455
-336
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
os: [ubuntu-latest, windows-latest, macos-latest]
27-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
27+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
2828

2929
steps:
3030
- uses: actions/checkout@v4
@@ -115,7 +115,7 @@ jobs:
115115
strategy:
116116
fail-fast: false
117117
matrix:
118-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
118+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
119119

120120
steps:
121121
- uses: actions/checkout@v4

backend/src/hatchling/metadata/spec.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def project_metadata_from_core_metadata(core_metadata: str) -> dict[str, Any]:
174174
left, _, right = marker
175175
if left.value == 'extra':
176176
extra = right.value
177-
del markers[i]
177+
del markers[i] # noqa: B909
178178
# If there was only one marker then there will be an unnecessary
179179
# trailing semicolon in the string representation
180180
if not markers:

docs/.hooks/render_ruff_defaults.py

+1
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ def run(self, lines): # noqa: PLR6301
270270
'PLR0915',
271271
'PLR0916',
272272
'PLR0917',
273+
'PLR1701',
273274
'PLR1702',
274275
'PLR1706',
275276
'PT004',

docs/history/hatch.md

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1919
- Build environments can now be configured, the default build environment is `hatch-build`
2020
- The environment interface now has the following methods and properties in order to better support builds on remote machines: `project_root`, `sep`, `pathsep`, `fs_context`
2121

22+
## [1.13.0](https://github.com/pypa/hatch/releases/tag/hatch-v1.13.0) - 2024-10-13 ## {: #hatch-v1.13.0 }
23+
24+
***Added:***
25+
26+
- Support managing Python 3.13 distributions
27+
2228
## [1.12.0](https://github.com/pypa/hatch/releases/tag/hatch-v1.12.0) - 2024-05-28 ## {: #hatch-v1.12.0 }
2329

2430
***Changed:***

docs/plugins/environment/virtual.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,16 @@ The following options are recognized for internal Python resolution.
6868
| `3.10` |
6969
| `3.11` |
7070
| `3.12` |
71+
| `3.13` |
7172

7273
The source of distributions is the [python-build-standalone](https://github.com/indygreg/python-build-standalone) project.
7374

74-
Some distributions have [variants](https://gregoryszorc.com/docs/python-build-standalone/main/running.html) that may be configured with the `HATCH_PYTHON_VARIANT_<PLATFORM>` environment variable where `<PLATFORM>` is the uppercase version of one of the following:
75+
Some distributions have [variants](https://gregoryszorc.com/docs/python-build-standalone/main/running.html) that may be configured with environment variables. Options may be combined.
7576

76-
| Platform | Options |
77-
| --- | --- |
78-
| Linux | <ul><li><code>v1</code></li><li><code>v2</code></li><li><code>v3</code> (default)</li><li><code>v4</code></li></ul> |
79-
| Windows | <ul><li><code>shared</code> (default)</li><li><code>static</code></li></ul> |
77+
| Option | Platforms | Allowed values |
78+
| --- | --- | --- |
79+
| `HATCH_PYTHON_VARIANT_CPU` | <ul><li>Linux</li></ul> | <ul><li><code>v1</code></li><li><code>v2</code></li><li><code>v3</code> (default)</li><li><code>v4</code></li></ul> |
80+
| `HATCH_PYTHON_VARIANT_GIL` | <ul><li>Linux</li><li>Windows</li><li>macOS</li></ul> | <ul><li><code>freethreaded</code></li></ul> |
8081

8182
### PyPy
8283

docs/tutorials/python/manage.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,23 @@ $ hatch python show
7070
┏━━━━━━┳━━━━━━━━━┓
7171
┃ Name ┃ Version ┃
7272
┡━━━━━━╇━━━━━━━━━┩
73-
│ 3.12 │ 3.12.3
73+
│ 3.12 │ 3.12.7
7474
└──────┴─────────┘
7575
Available
7676
┏━━━━━━━━━━┳━━━━━━━━━┓
7777
┃ Name ┃ Version ┃
7878
┡━━━━━━━━━━╇━━━━━━━━━┩
7979
│ 3.7 │ 3.7.9 │
8080
├──────────┼─────────┤
81-
│ 3.8 │ 3.8.19
81+
│ 3.8 │ 3.8.20
8282
├──────────┼─────────┤
83-
│ 3.9 │ 3.9.19
83+
│ 3.9 │ 3.9.20
8484
├──────────┼─────────┤
85-
│ 3.10 │ 3.10.14
85+
│ 3.10 │ 3.10.15
8686
├──────────┼─────────┤
87-
│ 3.11 │ 3.11.9 │
87+
│ 3.11 │ 3.11.10 │
88+
├──────────┼─────────┤
89+
│ 3.13 │ 3.13.0 │
8890
├──────────┼─────────┤
8991
│ pypy2.7 │ 7.3.15 │
9092
├──────────┼─────────┤
@@ -124,7 +126,7 @@ When there are no updates available for a distribution, a warning will be displa
124126

125127
```
126128
$ hatch python update 3.12
127-
The latest version is already installed: 3.12.3
129+
The latest version is already installed: 3.12.7
128130
```
129131

130132
## Removal

docs/why.md

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Here we compare to both `tox` and `nox`. At a high level, there are a few common
3333
In Hatch, [environments](environment.md) are treated as isolated areas where you can execute arbitrary commands at runtime. For example, you can define a single test environment with named [scripts](config/environment/overview.md#scripts) that runs unit vs non-unit tests, each command being potentially very long but named however you wish so you get to control the interface. Since environments are treated as places where work is performed, you can also [spawn a shell](environment.md#entering-environments) into any which will execute a subprocess that automatically drops into your [shell of choice](config/hatch.md#shell). Your shell will be configured appropriately like `python` on PATH being updated and the prompt being changed to reflect the chosen environment.
3434

3535
- **Configuration:**
36-
- `tox` only supports INI configuration and if one desires putting that in the standard `pyproject.toml` file then [it must be](https://tox.wiki/en/4.11.4/config.html#pyproject-toml) a multi-line string containing the INI config which would preclude syntax highlighting. Hatch allows for TOML-based config just like most other tools in the Python ecosystem.
3736
- `nox` config is defined in Python which often leads to increased verbosity and makes it challenging to onboard folks compared to a standardized format with known behaviors.
3837
- **Extensibility:**
3938
- `tox` allows for [extending](https://tox.wiki/en/4.11.4/plugins_api.html) most aspects of its functionality however the API is so low-level and attached to internals that creating plugins may be challenging. For example, [here](https://github.com/DataDog/integrations-core/blob/4f4cf10613797e97e7155c75859532a0732d1dff/datadog_checks_dev/datadog_checks/dev/plugin/tox.py) is a `tox` plugin that was [migrated](https://github.com/DataDog/integrations-core/blob/4eb2a1d530bcf810542cf9e45b48fadc7057301c/datadog_checks_dev/datadog_checks/dev/plugin/hatch/environment_collector.py#L100-L148) to an equivalent Hatch [environment collector plugin](plugins/environment-collector/reference.md).

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ classifiers = [
3333
"Programming Language :: Python :: 3.10",
3434
"Programming Language :: Python :: 3.11",
3535
"Programming Language :: Python :: 3.12",
36+
"Programming Language :: Python :: 3.13",
3637
"Programming Language :: Python :: Implementation :: CPython",
3738
"Programming Language :: Python :: Implementation :: PyPy",
3839
"Topic :: Software Development :: Build Tools",

ruff_defaults.toml

+1-11
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ select = [
1010
"A002",
1111
"A003",
1212
"ARG001",
13+
"ARG001",
1314
"ARG002",
1415
"ARG003",
1516
"ARG004",
1617
"ARG005",
1718
"ASYNC100",
18-
"ASYNC101",
19-
"ASYNC102",
2019
"B002",
2120
"B003",
2221
"B004",
@@ -130,7 +129,6 @@ select = [
130129
"E742",
131130
"E743",
132131
"E902",
133-
"E999",
134132
"EM101",
135133
"EM102",
136134
"EM103",
@@ -323,7 +321,6 @@ select = [
323321
"PLR0203",
324322
"PLR0206",
325323
"PLR0402",
326-
"PLR1701",
327324
"PLR1704",
328325
"PLR1711",
329326
"PLR1714",
@@ -466,7 +463,6 @@ select = [
466463
"RUF022",
467464
"RUF023",
468465
"RUF024",
469-
"RUF025",
470466
"RUF026",
471467
"RUF027",
472468
"RUF028",
@@ -590,11 +586,6 @@ select = [
590586
"TID251",
591587
"TID252",
592588
"TID253",
593-
"TRIO100",
594-
"TRIO105",
595-
"TRIO109",
596-
"TRIO110",
597-
"TRIO115",
598589
"TRY002",
599590
"TRY003",
600591
"TRY004",
@@ -628,7 +619,6 @@ select = [
628619
"UP024",
629620
"UP025",
630621
"UP026",
631-
"UP027",
632622
"UP028",
633623
"UP029",
634624
"UP030",

scripts/update_distributions.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
OUTPUT_FILE = ROOT / 'src' / 'hatch' / 'python' / 'distributions.py'
1212
ARCHES = {('linux', 'x86'): 'i686', ('windows', 'x86_64'): 'amd64', ('windows', 'x86'): 'i386'}
1313

14-
# system, architecture, ABI, variant
15-
MAX_IDENTIFIER_COMPONENTS = 4
14+
# system, architecture, ABI, CPU variant, GIL variant
15+
MAX_IDENTIFIER_COMPONENTS = 5
1616

1717

1818
def parse_distributions(contents: str, constant: str):
@@ -34,9 +34,9 @@ def parse_distributions(contents: str, constant: str):
3434
elif os == 'macos' and arch == 'aarch64':
3535
arch = 'arm64'
3636

37-
# Force everything to have a variant to maintain structure
37+
# Force everything to have the proper number of variants to maintain structure
3838
if len(data) != MAX_IDENTIFIER_COMPONENTS:
39-
data.append('')
39+
data.extend(('', ''))
4040

4141
data[1] = ARCHES.get((os, arch), arch)
4242
yield identifier, tuple(data), source

0 commit comments

Comments
 (0)