Skip to content

Commit 1b354cf

Browse files
authored
chore: move to hatchling (#1297)
1 parent d1a4c9c commit 1b354cf

File tree

7 files changed

+101
-133
lines changed

7 files changed

+101
-133
lines changed

.circleci/prepare.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ set -o xtrace
44

55
$PYTHON --version
66
$PYTHON -m pip --version
7-
$PYTHON -m virtualenv -p "$PYTHON" venv
7+
$PYTHON -m virtualenv --version
8+
$PYTHON -m virtualenv --no-setuptools --no-wheel -p "$PYTHON" venv
9+
venv/bin/python -m pip install -U pip
810
venv/bin/python -m pip install -e ".[dev]"
911
venv/bin/python -m pip freeze
1012
venv/bin/python --version

.pre-commit-config.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ repos:
2020
args: ["--fix", "--show-fixes"]
2121
- id: ruff-format
2222

23-
- repo: https://github.com/asottile/setup-cfg-fmt
24-
rev: v2.5.0
25-
hooks:
26-
- id: setup-cfg-fmt
27-
args: [--include-version-classifiers, --min-py-version=3.8, --max-py-version=3.12]
28-
2923
- repo: https://github.com/pre-commit/mirrors-mypy
3024
rev: v1.10.0
3125
hooks:

MANIFEST.in

-6
This file was deleted.

bin/bump_version.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#!/usr/bin/env python3
22

33
# /// script
4-
# dependencies = ["click", "packaging"]
4+
# dependencies = ["click", "packaging", "tomli; python_version<'3.11'"]
55
# ///
66

77

88
from __future__ import annotations
99

10-
import configparser
1110
import glob
1211
import os
1312
import subprocess
@@ -18,16 +17,21 @@
1817
import click
1918
from packaging.version import InvalidVersion, Version
2019

20+
if sys.version_info < (3, 11):
21+
import tomli as tomllib
22+
else:
23+
import tomllib
24+
2125
config = [
2226
# file path, version find/replace format
27+
("pyproject.toml", 'version = "{}"'),
2328
("README.md", "cibuildwheel=={}"),
2429
("cibuildwheel/__init__.py", '__version__ = "{}"'),
2530
("docs/faq.md", "cibuildwheel=={}"),
2631
("docs/faq.md", "cibuildwheel@v{}"),
2732
("docs/setup.md", "cibuildwheel=={}"),
2833
("examples/*", "cibuildwheel=={}"),
2934
("examples/*", "cibuildwheel@v{}"),
30-
("setup.cfg", "version = {}"),
3135
]
3236

3337
RED = "\u001b[31m"
@@ -37,10 +41,8 @@
3741

3842
@click.command()
3943
def bump_version() -> None:
40-
# Update if moving setup.cfg to pyproject.toml
41-
cfg = configparser.ConfigParser()
42-
cfg.read("setup.cfg")
43-
current_version = cfg["metadata"]["version"]
44+
with open("pyproject.toml", "rb") as f:
45+
current_version = tomllib.load(f)["project"]["version"]
4446

4547
try:
4648
commit_date_str = subprocess.run(

pyproject.toml

+89-18
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,94 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=42",
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "cibuildwheel"
7+
version = "2.18.0"
8+
description = "Build Python wheels on CI with minimal configuration."
9+
readme = "README.md"
10+
license = "BSD-2-Clause"
11+
requires-python = ">=3.8"
12+
authors = [
13+
{ name = "Joe Rickerby", email = "[email protected]" },
414
]
5-
build-backend = "setuptools.build_meta"
15+
keywords = [
16+
"appveyor",
17+
"ci",
18+
"linux",
19+
"macos",
20+
"packaging",
21+
"pypi",
22+
"travis",
23+
"wheel",
24+
"windows",
25+
]
26+
classifiers = [
27+
"Development Status :: 5 - Production/Stable",
28+
"Intended Audience :: Developers",
29+
"License :: OSI Approved :: BSD License",
30+
"Natural Language :: English",
31+
"Programming Language :: Python :: 3",
32+
"Programming Language :: Python :: 3 :: Only",
33+
"Programming Language :: Python :: 3.8",
34+
"Programming Language :: Python :: 3.9",
35+
"Programming Language :: Python :: 3.10",
36+
"Programming Language :: Python :: 3.11",
37+
"Programming Language :: Python :: 3.12",
38+
"Programming Language :: Python :: Implementation :: CPython",
39+
"Topic :: Software Development :: Build Tools",
40+
]
41+
dependencies = [
42+
"bashlex!=0.13",
43+
"bracex",
44+
"certifi",
45+
"filelock",
46+
"packaging>=20.9",
47+
"platformdirs",
48+
"tomli;python_version < '3.11'",
49+
"typing-extensions>=4.1.0;python_version < '3.11'",
50+
]
51+
52+
[project.optional-dependencies]
53+
bin = [
54+
"click",
55+
"packaging>=21.0",
56+
"pip-tools",
57+
"pygithub",
58+
"pyyaml",
59+
"requests",
60+
"rich>=9.6",
61+
]
62+
dev = [
63+
"cibuildwheel[test,bin]",
64+
]
65+
docs = [
66+
"jinja2>=3.1.2",
67+
"mkdocs-include-markdown-plugin==2.8.0",
68+
"mkdocs-macros-plugin",
69+
"mkdocs==1.3.1",
70+
"pymdown-extensions",
71+
]
72+
test = [
73+
"build",
74+
"jinja2",
75+
"pytest-timeout",
76+
"pytest-xdist",
77+
"pytest>=6",
78+
"tomli_w",
79+
"validate-pyproject",
80+
]
81+
82+
[project.scripts]
83+
cibuildwheel = "cibuildwheel.__main__:main"
684

85+
[project.entry-points."validate_pyproject.tool_schema"]
86+
cibuildwheel = "cibuildwheel.schema:get_schema"
87+
88+
[project.urls]
89+
Changelog = "https://github.com/pypa/cibuildwheel#changelog"
90+
Documentation = "https://cibuildwheel.pypa.io"
91+
Homepage = "https://github.com/pypa/cibuildwheel"
792

893
[tool.pytest.ini_options]
994
minversion = "6.0"
@@ -57,21 +142,6 @@ module = [
57142
ignore_missing_imports = true
58143

59144

60-
[tool.check-manifest]
61-
ignore = [
62-
".*",
63-
".circleci/**",
64-
"test/**",
65-
"unit_test/**",
66-
"docs/**",
67-
"examples/**",
68-
"bin/**",
69-
"*.yml",
70-
"CI.md", # TODO: can change test/test_ssl and remove this
71-
"requirements-dev.txt",
72-
"noxfile.py",
73-
]
74-
75145
[tool.pylint]
76146
py-version = "3.8"
77147
jobs = "0"
@@ -162,6 +232,7 @@ flake8-unused-arguments.ignore-variadic-names = true
162232
[tool.ruff.lint.per-file-ignores]
163233
"unit_test/*" = ["PLC1901"]
164234
"cibuildwheel/_compat/**.py" = ["TID251"]
235+
"bin/*" = ["TID251"]
165236

166237
[tool.repo-review]
167238
ignore = ["PC170", "PP303"]

setup.cfg

-57
This file was deleted.

setup.py

-38
This file was deleted.

0 commit comments

Comments
 (0)