git-project 0.0.39__tar.gz → 0.0.40__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.
- {git_project-0.0.39 → git_project-0.0.40}/.gitignore +2 -1
- {git_project-0.0.39 → git_project-0.0.40}/MANIFEST.in +2 -1
- {git_project-0.0.39 → git_project-0.0.40}/PKG-INFO +27 -38
- {git_project-0.0.39 → git_project-0.0.40}/_version.py +2 -2
- {git_project-0.0.39 → git_project-0.0.40}/docs/Makefile +2 -1
- {git_project-0.0.39 → git_project-0.0.40}/docs/api.rst +3 -3
- {git_project-0.0.39 → git_project-0.0.40}/docs/authors.rst +2 -2
- {git_project-0.0.39 → git_project-0.0.40}/docs/changelog.rst +35 -3
- {git_project-0.0.39 → git_project-0.0.40}/docs/conf.py +23 -16
- git_project-0.0.39/src/git_project/_contributing.py → git_project-0.0.40/docs/contributing.rst +40 -48
- {git_project-0.0.39 → git_project-0.0.40}/docs/index.rst +2 -2
- {git_project-0.0.39 → git_project-0.0.40}/docs/intro.rst +2 -2
- {git_project-0.0.39 → git_project-0.0.40}/docs/license.rst +2 -2
- {git_project-0.0.39 → git_project-0.0.40}/docs/make.bat +2 -2
- {git_project-0.0.39 → git_project-0.0.40}/docs/plugins.rst +2 -2
- {git_project-0.0.39 → git_project-0.0.40}/pyproject.toml +17 -38
- {git_project-0.0.39 → git_project-0.0.40}/requirements.txt +2 -1
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/__init__.py +31 -5
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/commandline.py +31 -51
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/configobj.py +42 -47
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/exception.py +11 -4
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/git.py +159 -126
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/gitproject.py +8 -10
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/main.py +15 -11
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/parsermanager.py +73 -52
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/plugin.py +11 -14
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/pluginmanager.py +9 -6
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/project.py +26 -27
- git_project-0.0.40/src/git_project/py.typed +0 -0
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/runnable.py +7 -6
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/scopedobj.py +31 -32
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/shell.py +32 -19
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/substitutable.py +32 -30
- git_project-0.0.40/src/git_project/test_support/__init__.py +74 -0
- {git_project-0.0.39 → git_project-0.0.40}/src/git_project/test_support/common.py +191 -148
- git_project-0.0.39/src/git_project/test_support/__init__.py → git_project-0.0.40/tests/conftest.py +30 -15
- git_project-0.0.40/tests/test_confobj.py +294 -0
- git_project-0.0.40/tests/test_git.py +1217 -0
- {git_project-0.0.39 → git_project-0.0.40}/tests/test_gitproject.py +9 -8
- {git_project-0.0.39 → git_project-0.0.40}/tests/test_main.py +17 -20
- {git_project-0.0.39 → git_project-0.0.40}/tests/test_parsermanager.py +12 -7
- git_project-0.0.40/tests/test_project.py +210 -0
- git_project-0.0.40/tests/test_runnable.py +293 -0
- git_project-0.0.40/tests/test_scopedobj.py +228 -0
- git_project-0.0.40/tests/test_shell.py +55 -0
- git_project-0.0.40/tests/test_substitutable.py +706 -0
- git_project-0.0.39/docs/contributing.rst +0 -29
- git_project-0.0.39/tests/conftest.py +0 -40
- git_project-0.0.39/tests/test_confobj.py +0 -283
- git_project-0.0.39/tests/test_git.py +0 -1066
- git_project-0.0.39/tests/test_project.py +0 -195
- git_project-0.0.39/tests/test_runnable.py +0 -267
- git_project-0.0.39/tests/test_scopedobj.py +0 -216
- git_project-0.0.39/tests/test_shell.py +0 -37
- git_project-0.0.39/tests/test_substitutable.py +0 -589
- {git_project-0.0.39 → git_project-0.0.40}/CONTRIBUTORS +0 -0
- {git_project-0.0.39 → git_project-0.0.40}/COPYING +0 -0
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
15
15
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
16
|
-
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
16
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
17
|
+
# details.
|
|
17
18
|
|
|
18
19
|
# You should have received a copy of the GNU Affero General Public License along
|
|
19
20
|
# with git-project. If not, see <https://www.gnu.org/licenses/>.
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
15
15
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
16
|
-
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
16
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
17
|
+
# details.
|
|
17
18
|
|
|
18
19
|
# You should have received a copy of the GNU Affero General Public License along
|
|
19
20
|
# with git-project. If not, see <https://www.gnu.org/licenses/>.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: git-project
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.40
|
|
4
4
|
Summary: The extensible stupid project manager
|
|
5
5
|
Author-email: "David A. Greene" <dag@obbligato.org>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -197,8 +197,8 @@ License
|
|
|
197
197
|
..
|
|
198
198
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
199
199
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
200
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
201
|
-
more details.
|
|
200
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
201
|
+
for more details.
|
|
202
202
|
|
|
203
203
|
..
|
|
204
204
|
You should have received a copy of the GNU Affero General Public License
|
|
@@ -212,50 +212,39 @@ Authors
|
|
|
212
212
|
.. _David Greene: https://github.com/greened
|
|
213
213
|
|
|
214
214
|
|
|
215
|
-
`0.0.
|
|
215
|
+
`0.0.40`_ - 2026-10-05
|
|
216
216
|
----------------------
|
|
217
217
|
Added
|
|
218
218
|
.....
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
module documentation.
|
|
219
|
+
- ``capture_command`` takes a list of arguments as well as a string.
|
|
220
|
+
- The package ships a ``py.typed`` marker, so mypy checks code that
|
|
221
|
+
uses git-project against its annotations.
|
|
223
222
|
|
|
224
223
|
Changed
|
|
225
224
|
.......
|
|
226
|
-
-
|
|
227
|
-
and a
|
|
228
|
-
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
- The package description is rewritten. It now explains projects,
|
|
232
|
-
configuration, scopes and substitution, and it warns that a substituted
|
|
233
|
-
value is evaluated as Python. It also says to ask for help with
|
|
234
|
-
``git <project> -h``, because git sends ``git <project> --help`` to a man
|
|
235
|
-
page.
|
|
225
|
+
- ``GitProjectException`` is now ``GitProjectError``. The old name still
|
|
226
|
+
works as an alias, and a later release removes it.
|
|
227
|
+
- The ``git_project._contributing`` module is gone. The guide to working
|
|
228
|
+
on git-project is in the docs only, and its Tests section is now the
|
|
229
|
+
``git_project.test_support`` package documentation.
|
|
236
230
|
|
|
237
231
|
Fixed
|
|
238
232
|
.....
|
|
239
|
-
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
read the status before the process had finished and then named two
|
|
255
|
-
variables that do not exist. It now waits for the command, and a failure
|
|
256
|
-
reports the exit status and the command's standard error.
|
|
257
|
-
|
|
258
|
-
.. _Unreleased: https://github.com/greened/git-project/compare/v0.0.39...HEAD
|
|
233
|
+
- ``substitute_value``, ``substitute_command`` and ``run`` shared one
|
|
234
|
+
default ``formats`` dict across calls, and ``substitute_value`` added its
|
|
235
|
+
names to it. So within one process, an object could resolve a name it does
|
|
236
|
+
not define to another object's value. Each call now works on its own copy,
|
|
237
|
+
and a ``formats`` dict passed in is no longer changed.
|
|
238
|
+
- Removing one value of a config key failed when the value held a space.
|
|
239
|
+
It was split into several arguments to ``git config --unset``. The pattern
|
|
240
|
+
now reaches git as given, so a pattern escaped twice to get through that
|
|
241
|
+
split must be escaped once.
|
|
242
|
+
- ``Git.get_git_common_dir`` returns an absolute path in a worktree that plain
|
|
243
|
+
``git worktree add`` made. It returned the relative path that git writes, so
|
|
244
|
+
``{git_common_dir}`` substituted ``../..`` there.
|
|
245
|
+
|
|
246
|
+
.. _Unreleased: https://github.com/greened/git-project/compare/v0.0.40...HEAD
|
|
247
|
+
.. _0.0.40: https://github.com/greened/git-project/compare/v0.0.39...v0.0.40
|
|
259
248
|
.. _0.0.39: https://github.com/greened/git-project/compare/v0.0.38...v0.0.39
|
|
260
249
|
.. _0.0.38: https://github.com/greened/git-project/compare/v0.0.37...v0.0.38
|
|
261
250
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
21
|
+
__version__ = version = '0.0.40'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 0, 40)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
15
15
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
16
|
-
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
16
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
17
|
+
# details.
|
|
17
18
|
|
|
18
19
|
# You should have received a copy of the GNU Affero General Public License along
|
|
19
20
|
# with git-project. If not, see <https://www.gnu.org/licenses/>.
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
..
|
|
20
20
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
21
21
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
23
|
-
more details.
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
23
|
+
for more details.
|
|
24
24
|
|
|
25
25
|
..
|
|
26
26
|
You should have received a copy of the GNU Affero General Public License
|
|
@@ -107,4 +107,4 @@ Shell commands
|
|
|
107
107
|
Errors
|
|
108
108
|
------
|
|
109
109
|
|
|
110
|
-
.. autoclass::
|
|
110
|
+
.. autoclass:: GitProjectError
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
..
|
|
20
20
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
21
21
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
23
|
-
more details.
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
23
|
+
for more details.
|
|
24
24
|
|
|
25
25
|
..
|
|
26
26
|
You should have received a copy of the GNU Affero General Public License
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
..
|
|
20
20
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
21
21
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
23
|
-
more details.
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
23
|
+
for more details.
|
|
24
24
|
|
|
25
25
|
..
|
|
26
26
|
You should have received a copy of the GNU Affero General Public License
|
|
@@ -31,6 +31,37 @@ ChangeLog
|
|
|
31
31
|
`Unreleased`_
|
|
32
32
|
-------------
|
|
33
33
|
|
|
34
|
+
`0.0.40`_ - 2026-10-05
|
|
35
|
+
----------------------
|
|
36
|
+
Added
|
|
37
|
+
.....
|
|
38
|
+
- ``capture_command`` takes a list of arguments as well as a string.
|
|
39
|
+
- The package ships a ``py.typed`` marker, so mypy checks code that
|
|
40
|
+
uses git-project against its annotations.
|
|
41
|
+
|
|
42
|
+
Changed
|
|
43
|
+
.......
|
|
44
|
+
- ``GitProjectException`` is now ``GitProjectError``. The old name still
|
|
45
|
+
works as an alias, and a later release removes it.
|
|
46
|
+
- The ``git_project._contributing`` module is gone. The guide to working
|
|
47
|
+
on git-project is in the docs only, and its Tests section is now the
|
|
48
|
+
``git_project.test_support`` package documentation.
|
|
49
|
+
|
|
50
|
+
Fixed
|
|
51
|
+
.....
|
|
52
|
+
- ``substitute_value``, ``substitute_command`` and ``run`` shared one
|
|
53
|
+
default ``formats`` dict across calls, and ``substitute_value`` added its
|
|
54
|
+
names to it. So within one process, an object could resolve a name it does
|
|
55
|
+
not define to another object's value. Each call now works on its own copy,
|
|
56
|
+
and a ``formats`` dict passed in is no longer changed.
|
|
57
|
+
- Removing one value of a config key failed when the value held a space.
|
|
58
|
+
It was split into several arguments to ``git config --unset``. The pattern
|
|
59
|
+
now reaches git as given, so a pattern escaped twice to get through that
|
|
60
|
+
split must be escaped once.
|
|
61
|
+
- ``Git.get_git_common_dir`` returns an absolute path in a worktree that plain
|
|
62
|
+
``git worktree add`` made. It returned the relative path that git writes, so
|
|
63
|
+
``{git_common_dir}`` substituted ``../..`` there.
|
|
64
|
+
|
|
34
65
|
`0.0.39`_ - 2026-09-30
|
|
35
66
|
----------------------
|
|
36
67
|
Added
|
|
@@ -123,6 +154,7 @@ Fixed
|
|
|
123
154
|
``git_project``. No declared environment supplied Sphinx either, so a
|
|
124
155
|
``docs`` environment with Sphinx is now declared.
|
|
125
156
|
|
|
126
|
-
.. _Unreleased: https://github.com/greened/git-project/compare/v0.0.
|
|
157
|
+
.. _Unreleased: https://github.com/greened/git-project/compare/v0.0.40...HEAD
|
|
158
|
+
.. _0.0.40: https://github.com/greened/git-project/compare/v0.0.39...v0.0.40
|
|
127
159
|
.. _0.0.39: https://github.com/greened/git-project/compare/v0.0.38...v0.0.39
|
|
128
160
|
.. _0.0.38: https://github.com/greened/git-project/compare/v0.0.37...v0.0.38
|
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
|
|
14
14
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
15
15
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
16
|
-
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
16
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
17
|
+
# details.
|
|
17
18
|
|
|
18
19
|
# You should have received a copy of the GNU Affero General Public License along
|
|
19
20
|
# with git-project. If not, see <https://www.gnu.org/licenses/>.
|
|
20
21
|
|
|
22
|
+
import importlib.metadata
|
|
23
|
+
|
|
21
24
|
# Configuration file for the Sphinx documentation builder.
|
|
22
25
|
#
|
|
23
26
|
# For the full list of built-in configuration values, see the documentation:
|
|
@@ -26,33 +29,37 @@
|
|
|
26
29
|
# -- Project information -----------------------------------------------------
|
|
27
30
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
28
31
|
|
|
29
|
-
project =
|
|
30
|
-
|
|
31
|
-
author =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
release = importlib.metadata.version('git-project')
|
|
32
|
+
project = "git-project"
|
|
33
|
+
project_copyright = "2024, David A. Greene"
|
|
34
|
+
author = "David A. Greene"
|
|
35
|
+
release = importlib.metadata.version("git-project")
|
|
35
36
|
|
|
36
37
|
# -- General configuration ---------------------------------------------------
|
|
37
38
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
38
39
|
|
|
39
|
-
extensions = [
|
|
40
|
-
autodoc_member_order =
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
extensions = ["sphinx.ext.extlinks", "sphinx.ext.autodoc"]
|
|
41
|
+
autodoc_member_order = "bysource"
|
|
42
|
+
# git_project.test_support imports the test libraries, which the docs env
|
|
43
|
+
# does not install.
|
|
44
|
+
autodoc_mock_imports = ["pytest"]
|
|
43
45
|
|
|
46
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
44
47
|
|
|
45
48
|
|
|
46
49
|
# -- Options for HTML output -------------------------------------------------
|
|
47
50
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
48
51
|
|
|
49
|
-
html_theme =
|
|
52
|
+
html_theme = "alabaster"
|
|
50
53
|
|
|
51
54
|
|
|
52
55
|
# -- Options for extlinks -------------------------------------------------
|
|
53
56
|
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
|
|
54
57
|
|
|
55
|
-
extlinks = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
extlinks = {
|
|
59
|
+
"issue": ("https://github.com/greened/git-project/issues/%s", "#%s"),
|
|
60
|
+
"projecturl": ("https://github.com/greened/%s", None),
|
|
61
|
+
"contributors": (
|
|
62
|
+
"https://github.com/greened/%s/graphs/contributors",
|
|
63
|
+
"overview for %s",
|
|
64
|
+
),
|
|
65
|
+
}
|
git_project-0.0.39/src/git_project/_contributing.py → git_project-0.0.40/docs/contributing.rst
RENAMED
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# SPDX-FileCopyrightText: 2026-present David A. Greene <dag@obbligato.org>
|
|
1
|
+
..
|
|
2
|
+
SPDX-FileCopyrightText: 2026-present David A. Greene <dag@obbligato.org>
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
..
|
|
5
|
+
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
..
|
|
8
|
+
Copyright 2026 David A. Greene
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
..
|
|
11
|
+
This file is part of git-project
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
..
|
|
14
|
+
git-project is free software: you can redistribute it and/or modify it under
|
|
15
|
+
the terms of the GNU Affero General Public License as published by the Free
|
|
16
|
+
Software Foundation, either version 3 of the License, or (at your option)
|
|
17
|
+
any later version.
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
..
|
|
20
|
+
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
21
|
+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
23
|
+
for more details.
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
..
|
|
26
|
+
You should have received a copy of the GNU Affero General Public License
|
|
27
|
+
along with git-project. If not, see <https://www.gnu.org/licenses/>.
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
Working on git-project
|
|
30
|
+
======================
|
|
24
31
|
|
|
25
32
|
This guide is for changing git-project itself. For writing a plugin, see
|
|
26
|
-
git_project.plugin
|
|
33
|
+
:mod:`git_project.plugin`. For how a run proceeds, see
|
|
34
|
+
:mod:`git_project.main`.
|
|
27
35
|
|
|
28
36
|
Layout
|
|
29
|
-
|
|
37
|
+
------
|
|
30
38
|
|
|
31
39
|
``src/git_project``
|
|
32
40
|
The package. ``test_support`` is part of it, not of the tests, because
|
|
@@ -38,7 +46,7 @@ Layout
|
|
|
38
46
|
The Sphinx sources. The pages mostly pull in docstrings.
|
|
39
47
|
|
|
40
48
|
Environment
|
|
41
|
-
|
|
49
|
+
-----------
|
|
42
50
|
|
|
43
51
|
git-project builds with hatch, and its version comes from git through
|
|
44
52
|
hatch-vcs. The default hatch environment installs git-project-core-plugins
|
|
@@ -50,41 +58,27 @@ core-plugins checkout, make a virtual environment with both installed
|
|
|
50
58
|
editable, for example with uv::
|
|
51
59
|
|
|
52
60
|
uv venv /tmp/gp-env
|
|
53
|
-
uv pip install --python /tmp/gp-env/bin/python
|
|
54
|
-
-e <git-project checkout> -e <core-plugins checkout>
|
|
61
|
+
uv pip install --python /tmp/gp-env/bin/python \
|
|
62
|
+
-e <git-project checkout> -e <core-plugins checkout> \
|
|
55
63
|
pytest pytest-console-scripts
|
|
56
64
|
|
|
57
65
|
Put that environment's ``bin`` first on ``PATH`` when running the tests,
|
|
58
66
|
because the command-line tests run the ``git-project`` script.
|
|
59
67
|
|
|
60
68
|
Tests
|
|
61
|
-
|
|
69
|
+
-----
|
|
62
70
|
|
|
63
|
-
::
|
|
64
|
-
|
|
65
|
-
hatch run test
|
|
66
|
-
hatch run cov
|
|
67
|
-
hatch run all:test
|
|
68
|
-
|
|
69
|
-
``cov`` adds a coverage report. ``all`` runs the suite under each Python
|
|
70
|
-
version in its matrix.
|
|
71
|
-
|
|
72
|
-
Run the tests with ``GIT_CONFIG_GLOBAL=/dev/null`` and
|
|
73
|
-
``GIT_CONFIG_NOSYSTEM=1``. The tests make throwaway repositories and
|
|
74
|
-
commits, and a hook or setting in your own git config would otherwise act
|
|
75
|
-
on them.
|
|
76
|
-
|
|
77
|
-
A test for a bug fix should fail before the fix. Check that it does.
|
|
71
|
+
.. automodule:: git_project.test_support
|
|
78
72
|
|
|
79
73
|
Lint
|
|
80
|
-
|
|
74
|
+
----
|
|
81
75
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
``hatch run lint:all`` runs ruff, ``black --check`` and mypy.
|
|
77
|
+
``hatch run lint:fmt`` runs black, then ``ruff check --fix``. The lint
|
|
78
|
+
environment pins each tool to an exact version.
|
|
85
79
|
|
|
86
80
|
Documentation
|
|
87
|
-
|
|
81
|
+
-------------
|
|
88
82
|
|
|
89
83
|
Docstrings are the one source for the package, module, class and command
|
|
90
84
|
documentation, and each one reaches a fixed place:
|
|
@@ -100,14 +94,14 @@ documentation, and each one reaches a fixed place:
|
|
|
100
94
|
pull them in with ``automodule`` and ``autoclass``.
|
|
101
95
|
|
|
102
96
|
So do not copy docstring text into a ``.rst`` file. Change the docstring.
|
|
103
|
-
|
|
104
|
-
license page includes ``COPYING``.
|
|
97
|
+
This page, the changelog and the authors list are written in ``docs``
|
|
98
|
+
directly, and the license page includes ``COPYING``.
|
|
105
99
|
|
|
106
100
|
``hatch run docs:build`` builds the Sphinx docs and fails on any warning.
|
|
107
101
|
Check the PyPI description with ``twine check`` on a built wheel.
|
|
108
102
|
|
|
109
103
|
Changelog
|
|
110
|
-
|
|
104
|
+
---------
|
|
111
105
|
|
|
112
106
|
Record each change a user can see in ``docs/changelog.rst``, under
|
|
113
107
|
``Unreleased``, in an ``Added``, ``Changed`` or ``Fixed`` section. Describe
|
|
@@ -116,7 +110,7 @@ tree. A defect that no release ever had needs no entry. The PyPI description
|
|
|
116
110
|
shows the newest release's section.
|
|
117
111
|
|
|
118
112
|
Releasing
|
|
119
|
-
|
|
113
|
+
---------
|
|
120
114
|
|
|
121
115
|
A release is a tag on the main branch, named ``vX.Y.Z``. Tags are
|
|
122
116
|
lightweight. hatch-vcs takes the version from the tag, so there is no
|
|
@@ -138,5 +132,3 @@ version number to edit.
|
|
|
138
132
|
git-project-core-plugins declares its floor on git-project in its
|
|
139
133
|
``requirements.txt``. When core-plugins needs something new in git-project,
|
|
140
134
|
release git-project first, raise that floor, and then release core-plugins.
|
|
141
|
-
|
|
142
|
-
"""
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
..
|
|
20
20
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
21
21
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
23
|
-
more details.
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
23
|
+
for more details.
|
|
24
24
|
|
|
25
25
|
..
|
|
26
26
|
You should have received a copy of the GNU Affero General Public License
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
..
|
|
20
20
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
21
21
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
23
|
-
more details.
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
23
|
+
for more details.
|
|
24
24
|
|
|
25
25
|
..
|
|
26
26
|
You should have received a copy of the GNU Affero General Public License
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
..
|
|
20
20
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
21
21
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
23
|
-
more details.
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
23
|
+
for more details.
|
|
24
24
|
|
|
25
25
|
..
|
|
26
26
|
You should have received a copy of the GNU Affero General Public License
|
|
@@ -13,8 +13,8 @@ REM any later version.
|
|
|
13
13
|
|
|
14
14
|
REM This program is distributed in the hope that it will be useful, but WITHOUT
|
|
15
15
|
REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
16
|
-
REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
17
|
-
REM more details.
|
|
16
|
+
REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
17
|
+
REM for more details.
|
|
18
18
|
|
|
19
19
|
REM You should have received a copy of the GNU Affero General Public License
|
|
20
20
|
REM along with git-project. If not, see <https://www.gnu.org/licenses/>.
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
..
|
|
20
20
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
21
21
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
23
|
-
more details.
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
|
|
23
|
+
for more details.
|
|
24
24
|
|
|
25
25
|
..
|
|
26
26
|
You should have received a copy of the GNU Affero General Public License
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
15
15
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
16
|
-
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
16
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
17
|
+
# details.
|
|
17
18
|
|
|
18
19
|
# You should have received a copy of the GNU Affero General Public License along
|
|
19
20
|
# with git-project. If not, see <https://www.gnu.org/licenses/>.
|
|
@@ -95,21 +96,22 @@ cov = [
|
|
|
95
96
|
python = ["3.10", "3.11"]
|
|
96
97
|
|
|
97
98
|
[tool.hatch.envs.lint]
|
|
98
|
-
detached
|
|
99
|
+
# Not detached: mypy reads the types of the installed dependencies.
|
|
99
100
|
dependencies = [
|
|
100
|
-
"black
|
|
101
|
-
"mypy
|
|
102
|
-
"
|
|
101
|
+
"black==26.5.1",
|
|
102
|
+
"mypy==2.3.1",
|
|
103
|
+
"pytest==9.1.1",
|
|
104
|
+
"ruff==0.16.8",
|
|
103
105
|
]
|
|
104
106
|
[tool.hatch.envs.lint.scripts]
|
|
105
|
-
typing = "mypy
|
|
107
|
+
typing = "mypy {args:src/git_project tests}"
|
|
106
108
|
style = [
|
|
107
|
-
"ruff {args:.}",
|
|
109
|
+
"ruff check {args:.}",
|
|
108
110
|
"black --check --diff {args:.}",
|
|
109
111
|
]
|
|
110
112
|
fmt = [
|
|
111
113
|
"black {args:.}",
|
|
112
|
-
"ruff --fix {args:.}",
|
|
114
|
+
"ruff check --fix {args:.}",
|
|
113
115
|
"style",
|
|
114
116
|
]
|
|
115
117
|
all = [
|
|
@@ -125,55 +127,39 @@ dependencies = [
|
|
|
125
127
|
"sphinx>=7",
|
|
126
128
|
]
|
|
127
129
|
[tool.hatch.envs.docs.scripts]
|
|
128
|
-
build = "sphinx-build -
|
|
130
|
+
build = "sphinx-build -M html docs docs/_build -W --keep-going"
|
|
129
131
|
clean = "sphinx-build -M clean docs docs/_build"
|
|
130
132
|
|
|
131
133
|
[tool.black]
|
|
132
134
|
target-version = ["py310"]
|
|
133
|
-
line-length =
|
|
134
|
-
skip-string-normalization = true
|
|
135
|
+
line-length = 79
|
|
135
136
|
|
|
136
137
|
[tool.ruff]
|
|
137
138
|
target-version = "py310"
|
|
138
|
-
line-length =
|
|
139
|
+
line-length = 79
|
|
139
140
|
|
|
140
141
|
[tool.ruff.lint]
|
|
141
142
|
select = [
|
|
142
143
|
"A",
|
|
143
|
-
"ARG",
|
|
144
144
|
"B",
|
|
145
|
-
"
|
|
145
|
+
"C4",
|
|
146
146
|
"DTZ",
|
|
147
147
|
"E",
|
|
148
|
-
"EM",
|
|
149
148
|
"F",
|
|
150
|
-
"FBT",
|
|
151
149
|
"I",
|
|
152
|
-
"ICN",
|
|
153
150
|
"ISC",
|
|
154
151
|
"N",
|
|
155
|
-
"PLC",
|
|
156
152
|
"PLE",
|
|
157
|
-
"PLR",
|
|
158
153
|
"PLW",
|
|
159
|
-
"Q",
|
|
160
154
|
"RUF",
|
|
161
|
-
"S",
|
|
162
|
-
"T",
|
|
163
|
-
"TID",
|
|
164
155
|
"UP",
|
|
165
156
|
"W",
|
|
166
|
-
"YTT",
|
|
167
157
|
]
|
|
168
158
|
ignore = [
|
|
169
159
|
# Allow non-abstract empty methods in abstract base classes
|
|
170
160
|
"B027",
|
|
171
|
-
#
|
|
172
|
-
"
|
|
173
|
-
# Ignore checks for possible passwords
|
|
174
|
-
"S105", "S106", "S107",
|
|
175
|
-
# Ignore complexity
|
|
176
|
-
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
|
|
161
|
+
# black sets the line length
|
|
162
|
+
"E501",
|
|
177
163
|
]
|
|
178
164
|
unfixable = [
|
|
179
165
|
# Don't touch unused imports
|
|
@@ -181,14 +167,7 @@ unfixable = [
|
|
|
181
167
|
]
|
|
182
168
|
|
|
183
169
|
[tool.ruff.lint.isort]
|
|
184
|
-
known-first-party = ["
|
|
185
|
-
|
|
186
|
-
[tool.ruff.lint.flake8-tidy-imports]
|
|
187
|
-
ban-relative-imports = "all"
|
|
188
|
-
|
|
189
|
-
[tool.ruff.lint.per-file-ignores]
|
|
190
|
-
# Tests can use magic values, assertions, and relative imports
|
|
191
|
-
"tests/**/*" = ["PLR2004", "S101", "TID252"]
|
|
170
|
+
known-first-party = ["git_project"]
|
|
192
171
|
|
|
193
172
|
[tool.coverage.run]
|
|
194
173
|
source_pkgs = ["git-project", "tests"]
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
15
15
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
16
|
-
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
16
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
17
|
+
# details.
|
|
17
18
|
|
|
18
19
|
# You should have received a copy of the GNU Affero General Public License along
|
|
19
20
|
# with git-project. If not, see <https://www.gnu.org/licenses/>.
|