Skip to content

Commit

Permalink
chore: move to hatchling (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed May 20, 2024
1 parent d1a4c9c commit 1b354cf
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 133 deletions.
4 changes: 3 additions & 1 deletion .circleci/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ set -o xtrace

$PYTHON --version
$PYTHON -m pip --version
$PYTHON -m virtualenv -p "$PYTHON" venv
$PYTHON -m virtualenv --version
$PYTHON -m virtualenv --no-setuptools --no-wheel -p "$PYTHON" venv
venv/bin/python -m pip install -U pip
venv/bin/python -m pip install -e ".[dev]"
venv/bin/python -m pip freeze
venv/bin/python --version
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ repos:
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
args: [--include-version-classifiers, --min-py-version=3.8, --max-py-version=3.12]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

16 changes: 9 additions & 7 deletions bin/bump_version.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/env python3

# /// script
# dependencies = ["click", "packaging"]
# dependencies = ["click", "packaging", "tomli; python_version<'3.11'"]
# ///


from __future__ import annotations

import configparser
import glob
import os
import subprocess
Expand All @@ -18,16 +17,21 @@
import click
from packaging.version import InvalidVersion, Version

if sys.version_info < (3, 11):
import tomli as tomllib
else:
import tomllib

config = [
# file path, version find/replace format
("pyproject.toml", 'version = "{}"'),
("README.md", "cibuildwheel=={}"),
("cibuildwheel/__init__.py", '__version__ = "{}"'),
("docs/faq.md", "cibuildwheel=={}"),
("docs/faq.md", "cibuildwheel@v{}"),
("docs/setup.md", "cibuildwheel=={}"),
("examples/*", "cibuildwheel=={}"),
("examples/*", "cibuildwheel@v{}"),
("setup.cfg", "version = {}"),
]

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

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

try:
commit_date_str = subprocess.run(
Expand Down
107 changes: 89 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,94 @@
[build-system]
requires = [
"setuptools>=42",
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "cibuildwheel"
version = "2.18.0"
description = "Build Python wheels on CI with minimal configuration."
readme = "README.md"
license = "BSD-2-Clause"
requires-python = ">=3.8"
authors = [
{ name = "Joe Rickerby", email = "joerick@mac.com" },
]
build-backend = "setuptools.build_meta"
keywords = [
"appveyor",
"ci",
"linux",
"macos",
"packaging",
"pypi",
"travis",
"wheel",
"windows",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Build Tools",
]
dependencies = [
"bashlex!=0.13",
"bracex",
"certifi",
"filelock",
"packaging>=20.9",
"platformdirs",
"tomli;python_version < '3.11'",
"typing-extensions>=4.1.0;python_version < '3.11'",
]

[project.optional-dependencies]
bin = [
"click",
"packaging>=21.0",
"pip-tools",
"pygithub",
"pyyaml",
"requests",
"rich>=9.6",
]
dev = [
"cibuildwheel[test,bin]",
]
docs = [
"jinja2>=3.1.2",
"mkdocs-include-markdown-plugin==2.8.0",
"mkdocs-macros-plugin",
"mkdocs==1.3.1",
"pymdown-extensions",
]
test = [
"build",
"jinja2",
"pytest-timeout",
"pytest-xdist",
"pytest>=6",
"tomli_w",
"validate-pyproject",
]

[project.scripts]
cibuildwheel = "cibuildwheel.__main__:main"

[project.entry-points."validate_pyproject.tool_schema"]
cibuildwheel = "cibuildwheel.schema:get_schema"

[project.urls]
Changelog = "https://github.com/pypa/cibuildwheel#changelog"
Documentation = "https://cibuildwheel.pypa.io"
Homepage = "https://github.com/pypa/cibuildwheel"

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down Expand Up @@ -57,21 +142,6 @@ module = [
ignore_missing_imports = true


[tool.check-manifest]
ignore = [
".*",
".circleci/**",
"test/**",
"unit_test/**",
"docs/**",
"examples/**",
"bin/**",
"*.yml",
"CI.md", # TODO: can change test/test_ssl and remove this
"requirements-dev.txt",
"noxfile.py",
]

[tool.pylint]
py-version = "3.8"
jobs = "0"
Expand Down Expand Up @@ -162,6 +232,7 @@ flake8-unused-arguments.ignore-variadic-names = true
[tool.ruff.lint.per-file-ignores]
"unit_test/*" = ["PLC1901"]
"cibuildwheel/_compat/**.py" = ["TID251"]
"bin/*" = ["TID251"]

[tool.repo-review]
ignore = ["PC170", "PP303"]
57 changes: 0 additions & 57 deletions setup.cfg

This file was deleted.

38 changes: 0 additions & 38 deletions setup.py

This file was deleted.

0 comments on commit 1b354cf

Please sign in to comment.