Skip to content

Commit

Permalink
Merge pull request #184 from Aiven-Open/joelynch/fix-version
Browse files Browse the repository at this point in the history
Use hatch as build backend
  • Loading branch information
kmichel-aiven committed May 3, 2024
2 parents 5bd0efd + afe17fb commit d30a6a9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 58 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ coverage.xml
rohmu-rpm-src.tar
.hypothesis/
.mypy_cache/

# File is autogenerated during build
rohmu/version.py
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

sys.path.insert(0, os.path.abspath(".."))
# -- Project information -----------------------------------------------------
from rohmu.version import VERSION
from rohmu.version import __version__

project = "Rohmu"
copyright = "2023, Aiven"
author = "Aiven"

# The full version, including alpha/beta/rc tags
release = VERSION
release = __version__

# -- General configuration ---------------------------------------------------

Expand Down
6 changes: 1 addition & 5 deletions make_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ def make_release(version: str) -> None:
if not re.match(r"\d+\.\d+.\d+", version):
raise ValueError(f"Unexpected version: {version!r}, should be N.N.N")
project_directory = Path(__file__).parent
version_filename = project_directory / "rohmu/version.py"
version_filename.write_text(f'VERSION = "{version}"\n')
subprocess.run(["git", "-C", str(project_directory), "add", str(version_filename)], check=True)
subprocess.run(["git", "-C", str(project_directory), "commit", "-m", f"Bump to version {version}"], check=True)
subprocess.run(
["git", "-C", str(project_directory), "tag", "-s", "-a", f"releases/{version}", "-m", f"Version {version}"],
["git", "-C", str(project_directory), "tag", "-s", "-a", f"{version}", "-m", f"Version {version}"],
check=True,
)
subprocess.run(["git", "-C", str(project_directory), "log", "-n", "1", "-p"], check=True)
Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ['setuptools', 'wheel', 'requests']
build-backend = 'setuptools.build_meta'
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "rohmu"
Expand Down Expand Up @@ -122,3 +122,9 @@ platforms = [
"POSIX",
"MacOS"
]

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "rohmu/version.py"
48 changes: 0 additions & 48 deletions rohmu.spec

This file was deleted.

1 change: 0 additions & 1 deletion rohmu/version.py

This file was deleted.

0 comments on commit d30a6a9

Please sign in to comment.