Skip to content

Commit

Permalink
Merge pull request #140 from twisted/122-repackage-with-hatch
Browse files Browse the repository at this point in the history
Repackage with Hatchling
  • Loading branch information
twm authored Dec 8, 2024
2 parents edbac5f + 17897e7 commit 1904282
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 55 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ updates:
schedule:
interval: "weekly"
day: "friday"

groups:
packaging:
applies-to: version-updates
patterns:
- build
- hatch
- hatchling
- packaging

mypy:
applies-to: version-updates
patterns:
- mypy
- mypy-*

ignore:
- dependency-name: ruff
update-types:
Expand Down
22 changes: 0 additions & 22 deletions MANIFEST.in

This file was deleted.

18 changes: 0 additions & 18 deletions _build_meta.py

This file was deleted.

40 changes: 30 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
[build-system]
requires = [
# Keep this aligned with the project dependencies.
"setuptools >= 61.0",
"tomli; python_version < '3.11'",
]
backend-path = [".", "./src"] # See _build_meta.py
build-backend = "_build_meta:build_meta"
requires = ["hatchling>=1.6.0"]
build-backend = "hatchling.build"

[project]
name = "Incremental"
Expand Down Expand Up @@ -55,10 +50,35 @@ incremental = "incremental:_get_setuptools_version"
[project.entry-points.hatch]
incremental = "incremental._hatch"

[tool.setuptools.dynamic]
version = {attr = "incremental._setuptools_version"}
[tool.hatch.build.targets.sdist]
include = [
"/src/incremental",
"/tests",
"/NEWS.rst",
"/LICENSE",
"/NEWS.rst",
"/SECURITY.md",
"/.coveragerc",
"/tox.ini",
"/requirements_*.in",
"/requirements_*.txt",
]
exclude = [
"/src/incremental/newsfragments",
"/tests/example_*/src/*.egg-info",
"/tests/example_*/build",
"/tests/example_*/dist",
]


[tool.hatch.build.targets.wheel]
packages = ["src/incremental"]

[tool.incremental]
[tool.hatch.version]
source = "code"
search-paths = ["src"]
expression = "__version__.public()"
path = "src/incremental/_version.py"

[tool.ruff.lint]
select = [
Expand Down
5 changes: 0 additions & 5 deletions src/incremental/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,4 @@ def _extract_tool_incremental(data: Dict[str, object]) -> Optional[Dict[str, obj

from ._version import __version__ # noqa: E402


def _setuptools_version() -> str:
return __version__.public() # pragma: no cover


__all__ = ["__version__", "Version", "getVersionString"]
1 change: 1 addition & 0 deletions src/incremental/newsfragments/122.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Build Incremental itself with Hatchling, working around failures with certain versions of setuptools

0 comments on commit 1904282

Please sign in to comment.