Skip to content

Commit

Permalink
Merge branch 'master' into fix-keyring-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek authored Nov 7, 2024
2 parents d475221 + 750b498 commit a0e624f
Show file tree
Hide file tree
Showing 20 changed files with 455 additions and 336 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion backend/src/hatchling/metadata/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def project_metadata_from_core_metadata(core_metadata: str) -> dict[str, Any]:
left, _, right = marker
if left.value == 'extra':
extra = right.value
del markers[i]
del markers[i] # noqa: B909
# If there was only one marker then there will be an unnecessary
# trailing semicolon in the string representation
if not markers:
Expand Down
1 change: 1 addition & 0 deletions docs/.hooks/render_ruff_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def run(self, lines): # noqa: PLR6301
'PLR0915',
'PLR0916',
'PLR0917',
'PLR1701',
'PLR1702',
'PLR1706',
'PT004',
Expand Down
6 changes: 6 additions & 0 deletions docs/history/hatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Build environments can now be configured, the default build environment is `hatch-build`
- 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`

## [1.13.0](https://github.com/pypa/hatch/releases/tag/hatch-v1.13.0) - 2024-10-13 ## {: #hatch-v1.13.0 }

***Added:***

- Support managing Python 3.13 distributions

## [1.12.0](https://github.com/pypa/hatch/releases/tag/hatch-v1.12.0) - 2024-05-28 ## {: #hatch-v1.12.0 }

***Changed:***
Expand Down
11 changes: 6 additions & 5 deletions docs/plugins/environment/virtual.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,16 @@ The following options are recognized for internal Python resolution.
| `3.10` |
| `3.11` |
| `3.12` |
| `3.13` |

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

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:
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.

| Platform | Options |
| --- | --- |
| Linux | <ul><li><code>v1</code></li><li><code>v2</code></li><li><code>v3</code> (default)</li><li><code>v4</code></li></ul> |
| Windows | <ul><li><code>shared</code> (default)</li><li><code>static</code></li></ul> |
| Option | Platforms | Allowed values |
| --- | --- | --- |
| `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> |
| `HATCH_PYTHON_VARIANT_GIL` | <ul><li>Linux</li><li>Windows</li><li>macOS</li></ul> | <ul><li><code>freethreaded</code></li></ul> |

### PyPy

Expand Down
14 changes: 8 additions & 6 deletions docs/tutorials/python/manage.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,23 @@ $ hatch python show
┏━━━━━━┳━━━━━━━━━┓
┃ Name ┃ Version ┃
┡━━━━━━╇━━━━━━━━━┩
│ 3.12 │ 3.12.3
│ 3.12 │ 3.12.7
└──────┴─────────┘
Available
┏━━━━━━━━━━┳━━━━━━━━━┓
┃ Name ┃ Version ┃
┡━━━━━━━━━━╇━━━━━━━━━┩
│ 3.7 │ 3.7.9 │
├──────────┼─────────┤
│ 3.8 │ 3.8.19
│ 3.8 │ 3.8.20
├──────────┼─────────┤
│ 3.9 │ 3.9.19
│ 3.9 │ 3.9.20
├──────────┼─────────┤
│ 3.10 │ 3.10.14
│ 3.10 │ 3.10.15
├──────────┼─────────┤
│ 3.11 │ 3.11.9 │
│ 3.11 │ 3.11.10 │
├──────────┼─────────┤
│ 3.13 │ 3.13.0 │
├──────────┼─────────┤
│ pypy2.7 │ 7.3.15 │
├──────────┼─────────┤
Expand Down Expand Up @@ -124,7 +126,7 @@ When there are no updates available for a distribution, a warning will be displa

```
$ hatch python update 3.12
The latest version is already installed: 3.12.3
The latest version is already installed: 3.12.7
```

## Removal
Expand Down
1 change: 0 additions & 1 deletion docs/why.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Here we compare to both `tox` and `nox`. At a high level, there are a few common
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.

- **Configuration:**
- `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.
- `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.
- **Extensibility:**
- `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).
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Build Tools",
Expand Down
12 changes: 1 addition & 11 deletions ruff_defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ select = [
"A002",
"A003",
"ARG001",
"ARG001",
"ARG002",
"ARG003",
"ARG004",
"ARG005",
"ASYNC100",
"ASYNC101",
"ASYNC102",
"B002",
"B003",
"B004",
Expand Down Expand Up @@ -130,7 +129,6 @@ select = [
"E742",
"E743",
"E902",
"E999",
"EM101",
"EM102",
"EM103",
Expand Down Expand Up @@ -323,7 +321,6 @@ select = [
"PLR0203",
"PLR0206",
"PLR0402",
"PLR1701",
"PLR1704",
"PLR1711",
"PLR1714",
Expand Down Expand Up @@ -466,7 +463,6 @@ select = [
"RUF022",
"RUF023",
"RUF024",
"RUF025",
"RUF026",
"RUF027",
"RUF028",
Expand Down Expand Up @@ -590,11 +586,6 @@ select = [
"TID251",
"TID252",
"TID253",
"TRIO100",
"TRIO105",
"TRIO109",
"TRIO110",
"TRIO115",
"TRY002",
"TRY003",
"TRY004",
Expand Down Expand Up @@ -628,7 +619,6 @@ select = [
"UP024",
"UP025",
"UP026",
"UP027",
"UP028",
"UP029",
"UP030",
Expand Down
8 changes: 4 additions & 4 deletions scripts/update_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
OUTPUT_FILE = ROOT / 'src' / 'hatch' / 'python' / 'distributions.py'
ARCHES = {('linux', 'x86'): 'i686', ('windows', 'x86_64'): 'amd64', ('windows', 'x86'): 'i386'}

# system, architecture, ABI, variant
MAX_IDENTIFIER_COMPONENTS = 4
# system, architecture, ABI, CPU variant, GIL variant
MAX_IDENTIFIER_COMPONENTS = 5


def parse_distributions(contents: str, constant: str):
Expand All @@ -34,9 +34,9 @@ def parse_distributions(contents: str, constant: str):
elif os == 'macos' and arch == 'aarch64':
arch = 'arm64'

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

data[1] = ARCHES.get((os, arch), arch)
yield identifier, tuple(data), source
Expand Down
Loading

0 comments on commit a0e624f

Please sign in to comment.