Skip to content

Commit

Permalink
Don't run onbuild step for editable builds with Hatch
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jul 18, 2024
1 parent eb4bbcb commit 371f3fd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
v3.2.0 (in development)
v3.1.2 (in development)
-----------------------
- Drop support for Python 3.7
- **Bugfix**: When using `versioningit` with Hatch, don't run the `onbuild`
step for editable builds

v3.1.1 (2024-04-29)
-------------------
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Changelog
v3.2.0 (in development)
-----------------------
- Drop support for Python 3.7
- **Bugfix**: When using `versioningit` with Hatch, don't run the `onbuild`
step for editable builds


v3.1.1 (2024-04-29)
Expand Down
2 changes: 1 addition & 1 deletion src/versioningit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<https://versioningit.rtfd.io> for more information.
"""

__version__ = "3.2.0.dev1"
__version__ = "3.1.2.dev1"
__author__ = "John Thorvald Wodder II"
__author_email__ = "[email protected]"
__license__ = "MIT"
Expand Down
5 changes: 4 additions & 1 deletion src/versioningit/hatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self.__tmpdir = Path(tempfile.mkdtemp())

def initialize(self, _version: str, build_data: dict[str, Any]) -> None:
def initialize(self, version: str, build_data: dict[str, Any]) -> None:

Check warning on line 76 in src/versioningit/hatch.py

View check run for this annotation

Codecov / codecov/patch

src/versioningit/hatch.py#L76

Added line #L76 was not covered by tests
init_logging()
if self.target_name == "wheel" and version == "editable":
log.debug("Not running onbuild step for editable build")
return None

Check warning on line 80 in src/versioningit/hatch.py

View check run for this annotation

Codecov / codecov/patch

src/versioningit/hatch.py#L79-L80

Added lines #L79 - L80 were not covered by tests
version_source = self.metadata.hatch.version.source
if not isinstance(version_source, VersioningitSource):
raise RuntimeError(
Expand Down

0 comments on commit 371f3fd

Please sign in to comment.