Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

General fixes for next release#1318

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Yobmod merged 23 commits intogitpython-developers:mainfromYobmod:main
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
23 commits
Select commitHold shift + click to select a range
ea43def
Run actions on main branch
ByronApr 1, 2021
70b9596
Merge branch 'master' of https://github.com/Yobmod/GitPython
YobmodAug 3, 2021
78b99d3
fix setup.py classifiers, improvefnmatchprocess handler types
YobmodAug 8, 2021
9d844a6
Merge branch 'master' of https://github.com/Yobmod/GitPython into main
YobmodAug 8, 2021
38f5157
add type check to conf_encoding (in thoery could be bool or int)
YobmodAug 8, 2021
22e05c4
type fix
YobmodAug 8, 2021
07078e9
type fixo
YobmodAug 8, 2021
bf0c332
add pypy to test matrix
YobmodAug 8, 2021
4381f6c
update 3.10 to rc1 in test matrix
YobmodAug 8, 2021
079d7fd
try fix for Protocol buy in 3.10
YobmodAug 9, 2021
1349ddc
try fix for Protocol buy in 3.10 2
YobmodAug 9, 2021
2f42966
try fix for Protocol buy in 3.10 3
YobmodAug 9, 2021
c35ab1d
upgrade sphinx for 3.10 compat
YobmodAug 9, 2021
5835f01
Update changelog and version
YobmodAug 9, 2021
1a71d9a
Change CI to 3.10.0-beta.4, to get docs to pass
YobmodAug 9, 2021
6835c91
Update changes.rst
YobmodAug 9, 2021
3439a3e
Change CI python 3.10 to rc1 again. Spinx broken either way
YobmodAug 9, 2021
40f4ceb
Update pythonpackage.yml
YobmodSep 9, 2021
4ed0531
Update pythonpackage.yml
YobmodSep 9, 2021
d6017fb
Update setup.py
YobmodSep 9, 2021
cb7cbe5
Update pythonpackage.yml
YobmodSep 9, 2021
f7fddc1
Update pythonpackage.yml
YobmodSep 9, 2021
bb9b50f
Update pythonpackage.yml
YobmodSep 9, 2021
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
2 changes: 1 addition & 1 deletion.github/workflows/pythonpackage.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10.0-beta.4"]
python-version: [3.7, 3.7.5, 3.7.12, 3.8, 3.8.0, 3.8.11, 3.8, 3.9,3.9.0, 3.9.7] # ,"3.10.0-rc.2"]

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,3 +22,4 @@ nbproject
.pytest_cache/
monkeytype.sqlite3
output.txt
tox.ini
2 changes: 1 addition & 1 deletionVERSION
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
3.1.20
3.1.21
2 changes: 1 addition & 1 deletiondoc/requirements.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
sphinx==4.1.1
sphinx==4.1.2
sphinx_rtd_theme
sphinx-autodoc-typehints
78 changes: 53 additions & 25 deletionsdoc/source/changes.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,32 +2,60 @@
Changelog
=========

3.1.20
3.1.21
======

* This is the second typed release with a lot of improvements under the hood.
* This is the second typed release with a lot of improvements under the hood.

* General:
- Remove python 3.6 support
- Remove distutils ahead of deprecation in standard library.
- Update sphinx to 4.1.12 and use autodoc-typehints.

* Typing:
- Add types to ALL functions.
- Ensure py.typed is collected.
- Increase mypy strictness with disallow_untyped_defs, warn_redundant_casts, warn_unreachable.
- Use typing.NamedTuple and typing.OrderedDict now 3.6 dropped.
- Make Protocol classes ABCs at runtime due to new bug in 3.10.0-rc1
- Remove use of typing.TypeGuard until later release, to allow dependant libs time to update.
- Tracking issue: https://github.com/gitpython-developers/GitPython/issues/1095

* Runtime improvements:
- Add clone_multi_options support to submodule.add()
- Delay calling get_user_id() unless essential, to support sand-boxed environments.
- Add timeout to handle_process_output(), in case thread.join() hangs.

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/52?closed=1


3.1.20 (YANKED)
===============

* This is the second typed release with a lot of improvements under the hood.
* Tracking issue: https://github.com/gitpython-developers/GitPython/issues/1095

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/52?closed=1
https://github.com/gitpython-developers/gitpython/milestone/52?closed=1


3.1.19 (YANKED)
===============

* This is the second typed release with a lot of improvements under the hood.
* This is the second typed release with a lot of improvements under the hood.
* Tracking issue: https://github.com/gitpython-developers/GitPython/issues/1095

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/51?closed=1
https://github.com/gitpython-developers/gitpython/milestone/51?closed=1

3.1.18
======

* drop support for python 3.5 to reduce maintenance burden on typing. Lower patch levels of python 3.5 would break, too.

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/50?closed=1
https://github.com/gitpython-developers/gitpython/milestone/50?closed=1

3.1.17
======
Expand All@@ -37,7 +65,7 @@ https://github.com/gitpython-developers/gitpython/milestone/50?closed=1
* Add more static typing information

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/49?closed=1
https://github.com/gitpython-developers/gitpython/milestone/49?closed=1

3.1.16 (YANKED)
===============
Expand All@@ -46,15 +74,15 @@ https://github.com/gitpython-developers/gitpython/milestone/49?closed=1
* Add more static typing information

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/48?closed=1
https://github.com/gitpython-developers/gitpython/milestone/48?closed=1

3.1.15 (YANKED)
===============

* add deprectation warning for python 3.5

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/47?closed=1
https://github.com/gitpython-developers/gitpython/milestone/47?closed=1

3.1.14
======
Expand All@@ -65,40 +93,40 @@ https://github.com/gitpython-developers/gitpython/milestone/47?closed=1
* Drop python 3.4 support

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/46?closed=1
https://github.com/gitpython-developers/gitpython/milestone/46?closed=1

3.1.13
======

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/45?closed=1
https://github.com/gitpython-developers/gitpython/milestone/45?closed=1

3.1.12
======

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/44?closed=1
https://github.com/gitpython-developers/gitpython/milestone/44?closed=1

3.1.11
======

Fixes regression of 3.1.10.

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/43?closed=1
https://github.com/gitpython-developers/gitpython/milestone/43?closed=1

3.1.10
======

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/42?closed=1
https://github.com/gitpython-developers/gitpython/milestone/42?closed=1


3.1.9
=====

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/41?closed=1
https://github.com/gitpython-developers/gitpython/milestone/41?closed=1


3.1.8
Expand All@@ -109,7 +137,7 @@ https://github.com/gitpython-developers/gitpython/milestone/41?closed=1


See the following for more details:
https://github.com/gitpython-developers/gitpython/milestone/40?closed=1
https://github.com/gitpython-developers/gitpython/milestone/40?closed=1


3.1.7
Expand All@@ -135,13 +163,13 @@ https://github.com/gitpython-developers/gitpython/milestone/40?closed=1
* package size was reduced significantly not placing tests into the package anymore.

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/39?closed=1
https://github.com/gitpython-developers/gitpython/milestone/39?closed=1

3.1.3
=====

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/38?closed=1
https://github.com/gitpython-developers/gitpython/milestone/38?closed=1

3.1.2
=====
Expand DownExpand Up@@ -190,7 +218,7 @@ Bugfixes
Bugfixes
--------

* Fixed Repo.__repr__ when subclassed
* Fixed Repo.__repr__ when subclassed
(`#968 <https://github.com/gitpython-developers/GitPython/pull/968>`_)
* Removed compatibility shims for Python < 3.4 and old mock library
* Replaced usage of deprecated unittest aliases and Logger.warn
Expand All@@ -213,7 +241,7 @@ Bugfixes
--------

* Fixed warning for usage of environment variables for paths containing ``$`` or ``%``
(`#832 <https://github.com/gitpython-developers/GitPython/issues/832>`_,
(`#832 <https://github.com/gitpython-developers/GitPython/issues/832>`_,
`#961 <https://github.com/gitpython-developers/GitPython/pull/961>`_)
* Added support for parsing Git internal date format (@<unix timestamp> <timezone offset>)
(`#965 <https://github.com/gitpython-developers/GitPython/pull/965>`_)
Expand DownExpand Up@@ -371,7 +399,7 @@ Notable fixes
* The `GIT_DIR` environment variable does not override the `path` argument when
initializing a `Repo` object anymore. However, if said `path` unset, `GIT_DIR`
will be used to fill the void.

All issues and PRs can be viewed in all detail when following this URL:
https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone%3A%22v2.1.0+-+proper+windows+support%22

Expand DownExpand Up@@ -401,7 +429,7 @@ https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone
2.0.7 - New Features
====================

* `IndexFile.commit(...,skip_hooks=False)` added. This parameter emulates the
* `IndexFile.commit(...,skip_hooks=False)` added. This parameter emulates the
behaviour of `--no-verify` on the command-line.

2.0.6 - Fixes and Features
Expand DownExpand Up@@ -441,7 +469,7 @@ https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone
commit messages contained ``\r`` characters
* Fix: progress handler exceptions are not caught anymore, which would usually just hide bugs
previously.
* Fix: The `Git.execute` method will now redirect `stdout` to `devnull` if `with_stdout` is false,
* Fix: The `Git.execute` method will now redirect `stdout` to `devnull` if `with_stdout` is false,
which is the intended behaviour based on the parameter's documentation.

2.0.2 - Fixes
Expand Down
42 changes: 28 additions & 14 deletionsgit/cmd.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

from __future__ import annotations
from contextlib import contextmanager
import io
import logging
Expand DownExpand Up@@ -68,7 +68,7 @@
# Documentation
## @{

def handle_process_output(process:Union[subprocess.Popen,'Git.AutoInterrupt'],
def handle_process_output(process: 'Git.AutoInterrupt' | Popen,
stdout_handler: Union[None,
Callable[[AnyStr], None],
Callable[[List[AnyStr]], None],
Expand All@@ -78,7 +78,8 @@ def handle_process_output(process: Union[subprocess.Popen, 'Git.AutoInterrupt'],
Callable[[List[AnyStr]], None]],
finalizer: Union[None,
Callable[[Union[subprocess.Popen, 'Git.AutoInterrupt']], None]] = None,
decode_streams: bool = True) -> None:
decode_streams: bool = True,
timeout: float = 10.0) -> None:
"""Registers for notifications to learn that process output is ready to read, and dispatches lines to
the respective line handlers.
This function returns once the finalizer returns
Expand All@@ -93,9 +94,10 @@ def handle_process_output(process: Union[subprocess.Popen, 'Git.AutoInterrupt'],
their contents to handlers.
Set it to False if `universal_newline == True` (then streams are in text-mode)
or if decoding must happen later (i.e. for Diffs).
:param timeout: float, timeout to pass to t.join() in case it hangs. Default = 10.0 seconds
"""
# Use 2 "pump" threads and wait for both to finish.
def pump_stream(cmdline: str, name: str, stream: Union[BinaryIO, TextIO], is_decode: bool,
def pump_stream(cmdline:List[str], name: str, stream: Union[BinaryIO, TextIO], is_decode: bool,
handler: Union[None, Callable[[Union[bytes, str]], None]]) -> None:
try:
for line in stream:
Expand All@@ -107,22 +109,32 @@ def pump_stream(cmdline: str, name: str, stream: Union[BinaryIO, TextIO], is_dec
else:
handler(line)
except Exception as ex:
log.error("Pumping%r of cmd(%s) failed due to:%r", name, remove_password_if_present(cmdline), ex)
raise CommandError(['<%s-pump>' % name] + remove_password_if_present(cmdline), ex) from ex
log.error(f"Pumping{name!r} of cmd({remove_password_if_present(cmdline)}) failed due to:{ex!r}")
raise CommandError([f'<{name}-pump>'] + remove_password_if_present(cmdline), ex) from ex
finally:
stream.close()

cmdline = getattr(process, 'args', '') # PY3+ only
if hasattr(process, 'proc'):
process = cast('Git.AutoInterrupt', process)
cmdline: str | Tuple[str, ...] | List[str] = getattr(process.proc, 'args', '')
p_stdout = process.proc.stdout if process.proc else None
p_stderr = process.proc.stderr if process.proc else None
else:
process = cast(Popen, process)
cmdline = getattr(process, 'args', '')
p_stdout = process.stdout
p_stderr = process.stderr

if not isinstance(cmdline, (tuple, list)):
cmdline = cmdline.split()

pumps = []
ifprocess.stdout:
pumps.append(('stdout',process.stdout, stdout_handler))
ifprocess.stderr:
pumps.append(('stderr',process.stderr, stderr_handler))
pumps: List[Tuple[str, IO, Callable[..., None] | None]] = []
ifp_stdout:
pumps.append(('stdout',p_stdout, stdout_handler))
ifp_stderr:
pumps.append(('stderr',p_stderr, stderr_handler))

threads = []
threads: List[threading.Thread] = []

for name, stream, handler in pumps:
t = threading.Thread(target=pump_stream,
Expand All@@ -134,7 +146,9 @@ def pump_stream(cmdline: str, name: str, stream: Union[BinaryIO, TextIO], is_dec
## FIXME: Why Join?? Will block if `stdin` needs feeding...
#
for t in threads:
t.join()
t.join(timeout=timeout)
if t.is_alive():
raise RuntimeError(f"Thread join() timed out in cmd.handle_process_output(). Timeout={timeout} seconds")

if finalizer:
return finalizer(process)
Expand Down
11 changes: 1 addition & 10 deletionsgit/config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,7 @@
# typing-------------------------------------------------------

from typing import (Any, Callable, Generic, IO, List, Dict, Sequence,
TYPE_CHECKING, Tuple, TypeVar, Union, cast, overload)
TYPE_CHECKING, Tuple, TypeVar, Union, cast)

from git.types import Lit_config_levels, ConfigLevels_Tup, PathLike, assert_never, _T

Expand DownExpand Up@@ -709,15 +709,6 @@ def read_only(self) -> bool:
""":return: True if this instance may change the configuration file"""
return self._read_only

@overload
def get_value(self, section: str, option: str, default: None = None) -> Union[int, float, str, bool]: ...

@overload
def get_value(self, section: str, option: str, default: str) -> str: ...

@overload
def get_value(self, section: str, option: str, default: float) -> float: ...

def get_value(self, section: str, option: str, default: Union[int, float, str, bool, None] = None
) -> Union[int, float, str, bool]:
# can default or return type include bool?
Expand Down
2 changes: 2 additions & 0 deletionsgit/objects/commit.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -446,6 +446,8 @@ def create_from_tree(cls, repo: 'Repo', tree: Union[Tree, str], message: str,
# assume utf8 encoding
enc_section, enc_option = cls.conf_encoding.split('.')
conf_encoding = cr.get_value(enc_section, enc_option, cls.default_encoding)
if not isinstance(conf_encoding, str):
raise TypeError("conf_encoding could not be coerced to str")

# if the tree is no object, make sure we create one - otherwise
# the created commit object is invalid
Expand Down
13 changes: 10 additions & 3 deletionsgit/objects/util.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Module for general utility functions"""

from abc import abstractmethod
from abc importABC,abstractmethod
import warnings
from git.util import (
IterableList,
Expand All@@ -22,10 +22,10 @@
from datetime import datetime, timedelta, tzinfo

# typing ------------------------------------------------------------
from typing import (Any, Callable, Deque, Iterator, NamedTuple, overload, Sequence,
from typing import (Any, Callable, Deque, Iterator,Generic,NamedTuple, overload, Sequence, # NOQA: F401
TYPE_CHECKING, Tuple, Type, TypeVar, Union, cast)

from git.types import Has_id_attribute, Literal,Protocol, runtime_checkable
from git.types import Has_id_attribute, Literal,_T # NOQA: F401

if TYPE_CHECKING:
from io import BytesIO, StringIO
Expand All@@ -35,6 +35,13 @@
from .tree import Tree, TraversedTreeTup
from subprocess import Popen
from .submodule.base import Submodule
from git.types import Protocol, runtime_checkable
else:
# Protocol = Generic[_T] # NNeeded for typing bug #572?
Protocol = ABC

def runtime_checkable(f):
return f


class TraverseNT(NamedTuple):
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp