package-dev-tools 0.6.0__tar.gz → 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/PKG-INFO +2 -2
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/pyproject.toml +10 -9
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/instantiate_new_project/cleanup_readme.py +1 -1
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/instantiate_new_project/cleanup_workflows.py +1 -1
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/instantiate_new_project/git.py +8 -5
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/instantiate_new_project/instantiate_new_project.py +5 -2
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/instantiate_new_project/substitute_template_name/project.py +1 -1
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/instantiate_new_project/substitute_template_name/substitute_template_name.py +9 -9
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/template_sync/sync_template.py +23 -12
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/extract_package_name.py +2 -1
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/extract_required_python_version.py +2 -1
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/extract_supported_python_versions.py +2 -1
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/models/path.py +1 -1
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/pre_commit/check_coverage.py +10 -9
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/utils/badge.py +3 -2
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/utils/package.py +3 -1
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools.egg-info/PKG-INFO +2 -2
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools.egg-info/requires.txt +1 -1
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/LICENSE +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/README.md +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/bin/pre-commit/bump-version +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/bin/pre-commit/check-version +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/setup.cfg +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/__init__.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/__init__.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/instantiate_new_project/__init__.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/instantiate_new_project/substitute_template_name/__init__.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/template_sync/__init__.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/template_sync/git.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/template_sync/trigger_template_sync.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/__init__.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/check_coverage.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/check_shields.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/cleanup_readme.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/instantiate_new_project.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/substitute_template_name.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/sync_template.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/trigger_template_sync.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/models/__init__.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/pre_commit/__init__.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/pre_commit/check_shields.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/py.typed +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/utils/__init__.py +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools.egg-info/SOURCES.txt +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools.egg-info/dependency_links.txt +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools.egg-info/entry_points.txt +0 -0
- {package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: package-dev-tools
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: CI/CD tools for Python packages
|
|
5
5
|
Author-email: Quinten Roets <qdr2104@columbia.edu>
|
|
6
6
|
License: MIT
|
|
@@ -11,7 +11,7 @@ License-File: LICENSE
|
|
|
11
11
|
Requires-Dist: autotyping<25,>=23.3.0
|
|
12
12
|
Requires-Dist: bump2version<2,>=1.0.1
|
|
13
13
|
Requires-Dist: coverage<8,>=7.4.0
|
|
14
|
-
Requires-Dist: mypy<2,>=1.
|
|
14
|
+
Requires-Dist: mypy<2,>=1.11.1
|
|
15
15
|
Requires-Dist: package-utils<1,>=0.6.1
|
|
16
16
|
Requires-Dist: pre-commit<4,>=3.5.0
|
|
17
17
|
Requires-Dist: powercli<1,>=0.1.2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "package-dev-tools"
|
|
3
|
-
version = "0.6.
|
|
3
|
+
version = "0.6.2"
|
|
4
4
|
description = "CI/CD tools for Python packages"
|
|
5
5
|
authors = [{name = "Quinten Roets", email = "qdr2104@columbia.edu"}]
|
|
6
6
|
license = {text = "MIT"}
|
|
@@ -10,7 +10,7 @@ dependencies = [
|
|
|
10
10
|
"autotyping >=23.3.0, <25",
|
|
11
11
|
"bump2version >=1.0.1, <2",
|
|
12
12
|
"coverage >=7.4.0, <8",
|
|
13
|
-
"mypy >=1.
|
|
13
|
+
"mypy >=1.11.1, <2",
|
|
14
14
|
"package-utils >=0.6.1, <1",
|
|
15
15
|
"pre-commit >=3.5.0, <4",
|
|
16
16
|
"powercli >=0.1.2, <1",
|
|
@@ -52,7 +52,7 @@ requires = ["setuptools"]
|
|
|
52
52
|
build-backend = "setuptools.build_meta"
|
|
53
53
|
|
|
54
54
|
[tool.coverage.run]
|
|
55
|
-
command_line = "-m pytest"
|
|
55
|
+
command_line = "-m pytest tests"
|
|
56
56
|
|
|
57
57
|
[tool.coverage.report]
|
|
58
58
|
precision = 4
|
|
@@ -71,12 +71,12 @@ pythonpath = [
|
|
|
71
71
|
fix = true
|
|
72
72
|
|
|
73
73
|
[tool.ruff.lint]
|
|
74
|
-
select = [
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
74
|
+
select = ["ALL"]
|
|
75
|
+
ignore = [
|
|
76
|
+
"ANN101", # annotate self
|
|
77
|
+
"ANN102", # annotate cls
|
|
78
|
+
"ANN401", # annotated with Any
|
|
79
|
+
"D", # docstrings
|
|
80
80
|
]
|
|
81
81
|
|
|
82
82
|
[tool.ruff.lint.isort]
|
|
@@ -84,6 +84,7 @@ known-first-party = ["src"]
|
|
|
84
84
|
|
|
85
85
|
[tool.ruff.lint.per-file-ignores]
|
|
86
86
|
"__init__.py" = ["F401"]
|
|
87
|
+
"tests/*" = ["S101"] # assert used
|
|
87
88
|
|
|
88
89
|
[tool.setuptools]
|
|
89
90
|
script-files = [
|
|
@@ -2,7 +2,7 @@ from dataclasses import dataclass, field
|
|
|
2
2
|
|
|
3
3
|
import cli
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from package_dev_tools.models import Path
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@dataclass
|
|
@@ -12,16 +12,19 @@ class GitInterface:
|
|
|
12
12
|
git_email: str = "quinten.roets@gmail.com"
|
|
13
13
|
commit_message: str = "Instantiate new project"
|
|
14
14
|
|
|
15
|
+
def clean(self) -> None:
|
|
16
|
+
self.capture_output("add -A")
|
|
17
|
+
self.capture_output("clean -fd")
|
|
18
|
+
|
|
15
19
|
def commit(self) -> None:
|
|
16
|
-
self.get("add -A")
|
|
17
20
|
self.configure()
|
|
18
|
-
self.
|
|
21
|
+
self.capture_output("commit --no-verify -m", self.commit_message)
|
|
19
22
|
|
|
20
|
-
def
|
|
23
|
+
def capture_output(self, *args: str | Path | int) -> str:
|
|
21
24
|
git_arg = f"git {args[0]}"
|
|
22
25
|
return cli.capture_output(git_arg, *args[1:], cwd=self.path)
|
|
23
26
|
|
|
24
27
|
def configure(self) -> None:
|
|
25
28
|
git_configuration = {"name": self.git_name, "email": self.git_email}
|
|
26
29
|
for attribute, value in git_configuration.items():
|
|
27
|
-
self.
|
|
30
|
+
self.capture_output(f"config user.{attribute} {value}")
|
|
@@ -20,6 +20,9 @@ class ProjectInstantiator(NameSubstitutor):
|
|
|
20
20
|
WorkflowsCleaner(self.path),
|
|
21
21
|
)
|
|
22
22
|
for runner in runners:
|
|
23
|
-
runner.run() # type: ignore
|
|
23
|
+
runner.run() # type: ignore[union-attr]
|
|
24
|
+
|
|
25
|
+
git = GitInterface(self.path)
|
|
26
|
+
git.clean()
|
|
24
27
|
if self.commit:
|
|
25
|
-
|
|
28
|
+
git.commit()
|
|
@@ -5,10 +5,10 @@ from dataclasses import dataclass, field
|
|
|
5
5
|
import cli
|
|
6
6
|
from slugify import slugify
|
|
7
7
|
|
|
8
|
+
from package_dev_tools.actions.instantiate_new_project.git import GitInterface
|
|
9
|
+
from package_dev_tools.models import Path
|
|
8
10
|
from package_dev_tools.utils.package import PackageInfo
|
|
9
11
|
|
|
10
|
-
from ....models import Path
|
|
11
|
-
from ..git import GitInterface
|
|
12
12
|
from .project import Project
|
|
13
13
|
|
|
14
14
|
|
|
@@ -44,7 +44,7 @@ class NameSubstitutor:
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
def extract_new_project_name(self) -> str:
|
|
47
|
-
git_url = GitInterface(self.path).
|
|
47
|
+
git_url = GitInterface(self.path).capture_output("config remote.origin.url")
|
|
48
48
|
return urllib.parse.urlparse(git_url).path.split("/")[-1]
|
|
49
49
|
|
|
50
50
|
def extract_current_project_name(self) -> str:
|
|
@@ -57,9 +57,11 @@ class NameSubstitutor:
|
|
|
57
57
|
|
|
58
58
|
def run(self) -> None:
|
|
59
59
|
for path in self.generate_paths_to_substitute():
|
|
60
|
-
|
|
60
|
+
if path.has_text_content:
|
|
61
|
+
self.substitute_content(path)
|
|
62
|
+
self.substitute_name(path)
|
|
61
63
|
|
|
62
|
-
def
|
|
64
|
+
def substitute_content(self, path: Path) -> None:
|
|
63
65
|
content = path.text
|
|
64
66
|
if any(to_replace in content for to_replace in self.substitutions):
|
|
65
67
|
for original, replacement in self.substitutions.items():
|
|
@@ -74,11 +76,9 @@ class NameSubstitutor:
|
|
|
74
76
|
is_workflow = path.is_relative_to(workflows_folder)
|
|
75
77
|
is_file = path.is_file()
|
|
76
78
|
if not is_workflow and is_file:
|
|
77
|
-
|
|
78
|
-
yield path
|
|
79
|
-
self.rename(path)
|
|
79
|
+
yield path
|
|
80
80
|
|
|
81
|
-
def
|
|
81
|
+
def substitute_name(self, path: Path) -> None:
|
|
82
82
|
if any(name == self.template_project.package_name for name in path.parts):
|
|
83
83
|
renamed_path_str = str(path).replace(
|
|
84
84
|
self.template_project.package_name,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import contextlib
|
|
1
2
|
from collections.abc import Iterator
|
|
2
3
|
from dataclasses import dataclass, field
|
|
3
4
|
from functools import cached_property
|
|
@@ -9,16 +10,21 @@ from github.Repository import Repository
|
|
|
9
10
|
from slugify import slugify
|
|
10
11
|
from superpathlib import Path
|
|
11
12
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
13
|
+
from package_dev_tools.actions.instantiate_new_project import ProjectInstantiator
|
|
14
|
+
from package_dev_tools.actions.instantiate_new_project.git import GitInterface
|
|
15
|
+
from package_dev_tools.actions.instantiate_new_project.substitute_template_name import (
|
|
16
|
+
substitute_template_name,
|
|
17
|
+
)
|
|
18
|
+
|
|
15
19
|
from . import git
|
|
16
20
|
|
|
17
21
|
|
|
18
22
|
@dataclass
|
|
19
23
|
class TemplateSyncer(git.Client): # pragma: nocover
|
|
20
24
|
repository: str
|
|
21
|
-
ignore_patterns_path: Path =
|
|
25
|
+
ignore_patterns_path: Path = field(
|
|
26
|
+
default_factory=lambda: Path(".templatesyncignore"),
|
|
27
|
+
)
|
|
22
28
|
template_repository: str = "quintenroets/python-package-template"
|
|
23
29
|
only_latest_commit: bool = True
|
|
24
30
|
default_branch: str = "main"
|
|
@@ -94,7 +100,10 @@ class TemplateSyncer(git.Client): # pragma: nocover
|
|
|
94
100
|
cli.run("git", "clone", url, path)
|
|
95
101
|
|
|
96
102
|
def run_git(
|
|
97
|
-
self,
|
|
103
|
+
self,
|
|
104
|
+
*args: str | Path,
|
|
105
|
+
input_: str | None = None,
|
|
106
|
+
check: bool = True,
|
|
98
107
|
) -> None:
|
|
99
108
|
cwd = self.downloaded_repository_folder
|
|
100
109
|
cli.run("git", *args, input=input_, cwd=cwd, check=check)
|
|
@@ -153,20 +162,22 @@ class TemplateSyncer(git.Client): # pragma: nocover
|
|
|
153
162
|
def apply_ignore_patterns(self) -> None:
|
|
154
163
|
path = self.downloaded_repository_folder / self.ignore_patterns_path
|
|
155
164
|
if path.exists():
|
|
156
|
-
for
|
|
157
|
-
if
|
|
158
|
-
pattern = f"{pattern}*"
|
|
165
|
+
for line in path.lines:
|
|
166
|
+
pattern = f"{line}*" if line.endswith("/") else line
|
|
159
167
|
self.run_git("reset", pattern)
|
|
160
168
|
|
|
161
169
|
def push_updates(self) -> None:
|
|
162
170
|
self.run_git("push", "--set-upstream", "origin", self.update_branch)
|
|
163
171
|
title = "Sync template changes"
|
|
164
|
-
|
|
172
|
+
with contextlib.suppress(
|
|
173
|
+
github.GithubException,
|
|
174
|
+
): # Pull request already created
|
|
165
175
|
self.repository_client.create_pull(
|
|
166
|
-
self.default_branch,
|
|
176
|
+
self.default_branch,
|
|
177
|
+
self.update_branch,
|
|
178
|
+
title=title,
|
|
179
|
+
body="",
|
|
167
180
|
)
|
|
168
|
-
except github.GithubException:
|
|
169
|
-
pass # Pull request already created
|
|
170
181
|
|
|
171
182
|
@cached_property
|
|
172
183
|
def repository_client(self) -> Repository:
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import cli
|
|
1
2
|
from package_utils.cli import instantiate_from_cli_args
|
|
2
3
|
|
|
3
4
|
from package_dev_tools.utils.package import PackageInfo
|
|
@@ -5,4 +6,4 @@ from package_dev_tools.utils.package import PackageInfo
|
|
|
5
6
|
|
|
6
7
|
def entry_point() -> None:
|
|
7
8
|
package_info = instantiate_from_cli_args(PackageInfo)
|
|
8
|
-
print(package_info.package_name)
|
|
9
|
+
cli.console.print(package_info.package_name)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import cli
|
|
1
2
|
from package_utils.cli import instantiate_from_cli_args
|
|
2
3
|
|
|
3
4
|
from package_dev_tools.utils.package import PackageInfo
|
|
@@ -5,4 +6,4 @@ from package_dev_tools.utils.package import PackageInfo
|
|
|
5
6
|
|
|
6
7
|
def entry_point() -> None:
|
|
7
8
|
package_info = instantiate_from_cli_args(PackageInfo)
|
|
8
|
-
print(package_info.required_python_version)
|
|
9
|
+
cli.console.print(package_info.required_python_version)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
|
|
3
|
+
import cli
|
|
3
4
|
from package_utils.cli import instantiate_from_cli_args
|
|
4
5
|
|
|
5
6
|
from package_dev_tools.utils.package import PackageInfo
|
|
@@ -9,4 +10,4 @@ def entry_point() -> None:
|
|
|
9
10
|
package_info = instantiate_from_cli_args(PackageInfo)
|
|
10
11
|
versions = list(package_info.supported_python_versions)
|
|
11
12
|
versions_json = json.dumps(versions)
|
|
12
|
-
print(versions_json)
|
|
13
|
+
cli.console.print(versions_json)
|
|
@@ -3,24 +3,24 @@ from collections.abc import Iterator
|
|
|
3
3
|
|
|
4
4
|
import cli
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
6
|
+
from package_dev_tools.models import Path
|
|
7
|
+
from package_dev_tools.utils.badge import Badge, BadgeUpdater
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
def check_coverage(verify_all_files_tested: bool = True) -> None:
|
|
10
|
+
def check_coverage(*, verify_all_files_tested: bool = True) -> None:
|
|
11
11
|
verify_coverage_results()
|
|
12
12
|
if verify_all_files_tested:
|
|
13
13
|
verify_all_python_files_tested()
|
|
14
14
|
|
|
15
15
|
try:
|
|
16
16
|
coverage_percentage = cli.capture_output("coverage report -i --format total")
|
|
17
|
-
except cli.CalledProcessError
|
|
17
|
+
except cli.CalledProcessError:
|
|
18
18
|
cli.capture_output("coverage html -i", check=False)
|
|
19
19
|
cli.run("coverage report -mi", check=False)
|
|
20
|
-
raise
|
|
20
|
+
raise
|
|
21
21
|
coverage_percentage_has_changed = update_coverage_shield(coverage_percentage)
|
|
22
22
|
if coverage_percentage_has_changed:
|
|
23
|
-
print(f"Updated test coverage: {coverage_percentage}%")
|
|
23
|
+
cli.console.print(f"Updated test coverage: {coverage_percentage}%")
|
|
24
24
|
cli.capture_output("coverage html")
|
|
25
25
|
exit_code = 1 if coverage_percentage_has_changed else 0
|
|
26
26
|
sys.exit(exit_code)
|
|
@@ -37,7 +37,7 @@ def update_coverage_shield(coverage_percentage: float | str) -> bool:
|
|
|
37
37
|
def verify_all_python_files_tested() -> None:
|
|
38
38
|
python_files = set(generate_python_files())
|
|
39
39
|
coverage_lines = cli.capture_output_lines("coverage report -i", check=False)
|
|
40
|
-
covered_files =
|
|
40
|
+
covered_files = {line.split()[0] for line in coverage_lines[2:-2]}
|
|
41
41
|
not_covered_files = python_files - covered_files
|
|
42
42
|
if not_covered_files:
|
|
43
43
|
cli.run("coverage html -i", check=False)
|
|
@@ -46,7 +46,7 @@ def verify_all_python_files_tested() -> None:
|
|
|
46
46
|
*not_covered_files,
|
|
47
47
|
)
|
|
48
48
|
message = "\n\t".join(message_parts)
|
|
49
|
-
raise
|
|
49
|
+
raise RuntimeError(message)
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
def generate_python_files() -> Iterator[str]:
|
|
@@ -60,4 +60,5 @@ def generate_python_files() -> Iterator[str]:
|
|
|
60
60
|
|
|
61
61
|
def verify_coverage_results() -> None:
|
|
62
62
|
if not Path(".coverage").exists():
|
|
63
|
-
|
|
63
|
+
message = "No coverage results found."
|
|
64
|
+
raise OSError(message)
|
|
@@ -2,7 +2,7 @@ from dataclasses import dataclass, field
|
|
|
2
2
|
from functools import cached_property
|
|
3
3
|
from typing import ClassVar
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from package_dev_tools.models import Path
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@dataclass
|
|
@@ -31,7 +31,8 @@ class BadgeUpdater:
|
|
|
31
31
|
path = self.cwd / Path.readme.name
|
|
32
32
|
lines = path.lines
|
|
33
33
|
if not self.contains_badge(lines):
|
|
34
|
-
|
|
34
|
+
message = f"README has no {self.badge.title} badge yet."
|
|
35
|
+
raise ValueError(message)
|
|
35
36
|
has_changed = self.badge.line not in lines
|
|
36
37
|
if has_changed:
|
|
37
38
|
lines = (self.badge.line if self.is_badge(line) else line for line in lines)
|
|
@@ -7,6 +7,8 @@ import requests
|
|
|
7
7
|
import toml
|
|
8
8
|
from superpathlib import Path
|
|
9
9
|
|
|
10
|
+
SUCCESS_CODE = 200
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
@dataclass
|
|
12
14
|
class PackageInfo:
|
|
@@ -52,7 +54,7 @@ class PackageInfo:
|
|
|
52
54
|
base_url = "https://www.python.org/ftp/python/"
|
|
53
55
|
filename = f"Python-{version}.tar.xz"
|
|
54
56
|
url = f"{base_url}/{version}/{filename}"
|
|
55
|
-
return requests.head(url).status_code ==
|
|
57
|
+
return requests.head(url, timeout=10).status_code == SUCCESS_CODE
|
|
56
58
|
|
|
57
59
|
@property
|
|
58
60
|
def pyproject_info(self) -> dict[str, Any]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: package-dev-tools
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: CI/CD tools for Python packages
|
|
5
5
|
Author-email: Quinten Roets <qdr2104@columbia.edu>
|
|
6
6
|
License: MIT
|
|
@@ -11,7 +11,7 @@ License-File: LICENSE
|
|
|
11
11
|
Requires-Dist: autotyping<25,>=23.3.0
|
|
12
12
|
Requires-Dist: bump2version<2,>=1.0.1
|
|
13
13
|
Requires-Dist: coverage<8,>=7.4.0
|
|
14
|
-
Requires-Dist: mypy<2,>=1.
|
|
14
|
+
Requires-Dist: mypy<2,>=1.11.1
|
|
15
15
|
Requires-Dist: package-utils<1,>=0.6.1
|
|
16
16
|
Requires-Dist: pre-commit<4,>=3.5.0
|
|
17
17
|
Requires-Dist: powercli<1,>=0.1.2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/actions/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/check_coverage.py
RENAMED
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/check_shields.py
RENAMED
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/cleanup_readme.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/cli/sync_template.py
RENAMED
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/models/__init__.py
RENAMED
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools/pre_commit/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{package_dev_tools-0.6.0 → package_dev_tools-0.6.2}/src/package_dev_tools.egg-info/top_level.txt
RENAMED
|
File without changes
|