Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit autoupdate #816

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ repos:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.8.0"
rev: "0.9.2"
hooks:
- id: pyproject-fmt

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.0.1'
rev: 'v1.1.1'
hooks:
- id: mypy
args: [--strict]
Expand Down
1 change: 0 additions & 1 deletion nextgen/vcs-versioning/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Documentation = "https://github.com/unknown/vcs-versioning#readme"
Issues = "https://github.com/unknown/vcs-versioning/issues"
Source = "https://github.com/unknown/vcs-versioning"


[tool.hatch.version]
path = "vcs_versioning/__about__.py"

Expand Down
12 changes: 0 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,45 +53,35 @@ test = [
]
toml = [
]

[project.urls]
repository = "https://github.com/pypa/setuptools_scm/"

[project.entry-points."distutils.setup_keywords"]
use_scm_version = "setuptools_scm.integration:version_keyword"

[project.entry-points."setuptools.file_finders"]
setuptools_scm = "setuptools_scm._file_finders:find_files"

[project.entry-points."setuptools.finalize_distribution_options"]
setuptools_scm = "setuptools_scm.integration:infer_version"

[project.entry-points."setuptools_scm.files_command"]
".git" = "setuptools_scm._file_finders.git:git_find_files"
".hg" = "setuptools_scm._file_finders.hg:hg_find_files"

[project.entry-points."setuptools_scm.files_command_fallback"]
".git_archival.txt" = "setuptools_scm._file_finders.git:git_archive_find_files"
".hg_archival.txt" = "setuptools_scm._file_finders.hg:hg_archive_find_files"

[project.entry-points."setuptools_scm.local_scheme"]
dirty-tag = "setuptools_scm.version:get_local_dirty_tag"
no-local-version = "setuptools_scm.version:get_no_local_node"
node-and-date = "setuptools_scm.version:get_local_node_and_date"
node-and-timestamp = "setuptools_scm.version:get_local_node_and_timestamp"

[project.entry-points."setuptools_scm.parse_scm"]
".git" = "setuptools_scm.git:parse"
".hg" = "setuptools_scm.hg:parse"

[project.entry-points."setuptools_scm.parse_scm_fallback"]
".git_archival.txt" = "setuptools_scm.git:parse_archival"
".hg_archival.txt" = "setuptools_scm.hg:parse_archival"
PKG-INFO = "setuptools_scm.hacks:parse_pkginfo"
pip-egg-info = "setuptools_scm.hacks:parse_pip_egg_info"
"pyproject.toml" = "setuptools_scm.hacks:fallback_version"
"setup.py" = "setuptools_scm.hacks:fallback_version"

[project.entry-points."setuptools_scm.version_scheme"]
"calver-by-date" = "setuptools_scm.version:calver_by_date"
"guess-next-dev" = "setuptools_scm.version:guess_next_dev_version"
Expand All @@ -100,8 +90,6 @@ pip-egg-info = "setuptools_scm.hacks:parse_pip_egg_info"
"python-simplified-semver" = "setuptools_scm.version:simplified_semver_version"
"release-branch-semver" = "setuptools_scm.version:release_branch_semver_version"



[tool.setuptools.dynamic]
version = {attr = "scm_hack_build_backend.dynamic_version"}

Expand Down
11 changes: 10 additions & 1 deletion src/setuptools_scm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"""
from __future__ import annotations

import logging
import subprocess
import sys
import warnings
from types import CodeType
Expand All @@ -16,6 +18,8 @@
if TYPE_CHECKING:
from . import _types as _t

log = logging.getLogger(__name__)


class _CmdResult(NamedTuple):
out: str
Expand Down Expand Up @@ -54,10 +58,15 @@ def function_has_arg(fn: object | FunctionType, argname: str) -> bool:
def has_command(name: str, args: list[str] | None = None, warn: bool = True) -> bool:
try:
cmd = [name, "help"] if args is None else [name, *args]
p = _run_cmd.run(cmd, ".")
p = _run_cmd.run(cmd, cwd=".", timeout=5)
except OSError:
_trace.trace(*sys.exc_info())
res = False
except subprocess.TimeoutExpired as e:
log.info(e)
_trace.trace(e)
res = False

else:
res = not p.returncode
if not res and warn:
Expand Down