mirror of
https://codeberg.org/james-smith-za/git-tidy-python.git
synced 2026-01-15 11:19:24 +02:00
Flesh out pyproject.toml to allow properly installing
Mostly because I'd like to be able to install it with uv, so it's entirely for selfish reasons.
This commit is contained in:
parent
a0ce83fb72
commit
412444eb6e
2 changed files with 57 additions and 7 deletions
15
git-tidy → git_tidy.py
Executable file → Normal file
15
git-tidy → git_tidy.py
Executable file → Normal file
|
|
@ -1,21 +1,26 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2023-2025 James Smith
|
||||
# git-tidy is free software: you can redistribute it and/or modify it under the terms of the GNU
|
||||
# General Public License as published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
|
||||
# git-tidy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along with git-tidy. If not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
"""git-tidy utility."""
|
||||
|
||||
import argparse
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import List, Tuple, Union
|
||||
|
||||
try:
|
||||
from importlib.metadata import version
|
||||
except ImportError:
|
||||
# Python < 3.8
|
||||
from importlib_metadata import version
|
||||
|
||||
common_default_branches = [
|
||||
"main",
|
||||
"master",
|
||||
|
|
@ -127,6 +132,10 @@ def get_default_branch() -> str:
|
|||
|
||||
def main():
|
||||
"""Main function."""
|
||||
parser = argparse.ArgumentParser(description="A time-saving device for a developer using git.")
|
||||
parser.add_argument("--version", action="version", version=f"git-tidy {version('git-tidy-python')}")
|
||||
parser.parse_args()
|
||||
|
||||
default_branch = get_default_branch()
|
||||
print(f"Switching to {default_branch}")
|
||||
run(["git", "checkout", default_branch])
|
||||
|
|
@ -1,6 +1,45 @@
|
|||
[tool.black]
|
||||
[build-system]
|
||||
requires = ["setuptools>=45", "setuptools-scm[toml]>=6.2", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "git-tidy-python"
|
||||
dynamic = ["version"]
|
||||
description = "A time-saving device for a developer using git."
|
||||
authors = [
|
||||
{name = "James Smith"}
|
||||
]
|
||||
readme = "README.md"
|
||||
license = {text = "GPL-3.0-or-later"}
|
||||
requires-python = ">=3.8"
|
||||
dependencies = []
|
||||
keywords = ["git", "cli", "developer-tools", "automation", "branch-management"]
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Environment :: Console",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"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",
|
||||
"Topic :: Software Development :: Version Control :: Git",
|
||||
"Topic :: Utilities"
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
git-tidy = "git_tidy:main"
|
||||
|
||||
[tool.setuptools]
|
||||
py-modules = ["git_tidy"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
include = '\.pyi?$'
|
||||
exclude ='''
|
||||
/(
|
||||
| \.git
|
||||
|
|
@ -11,3 +50,5 @@ exclude ='''
|
|||
[tool.isort]
|
||||
profile = "black"
|
||||
line_length = 120
|
||||
|
||||
[tool.setuptools_scm]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue