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

Fixes to support Python 2.6 again.#541

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
Byron merged 1 commit intogitpython-developers:masterfromandy-maier:py26_fixes
Dec 8, 2016

Conversation

andy-maier
Copy link
Contributor

@andy-maierandy-maier commentedOct 21, 2016
edited
Loading

GitPython 2.0.9 has some issues on Python 2.6 (see issue#540).

This PR fixes them. For details, see the commit message.
The Travis runs now pass on all Python versions including 2.6.

Please review.

@codecov-io
Copy link

codecov-io commentedOct 21, 2016
edited
Loading

Current coverage is 94.51% (diff: 96.72%)

Merging#541 intomaster will increase coverage by0.14%

@@             master       #541   diff @@==========================================  Files            63         63            Lines          9882       9920    +38     Methods           0          0            Messages          0          0            Branches          0          0          ==========================================+ Hits           9326       9376    +50+ Misses          556        544    -12  Partials          0          0

Powered byCodecov. Last update5149c80...f3d5df2

@Byron
Copy link
Member

@andy-maier In the meanwhile, merge conflicts have shown up. I will gladly merge this PR once they are fixed. Thank you.

@ByronByron added this to thev2.1.1 - Bugfixes milestoneOct 22, 2016
@andy-maier
Copy link
ContributorAuthor

Will do, tomorrow.

@andy-maierandy-maierforce-pushed thepy26_fixes branch 7 times, most recently from9364ea0 to9ff3f02CompareOctober 24, 2016 13:56
Details:- Added Python 2.6 again to .travis.yml (it was removed in commit4486bcb).- Replaced the use of dictionary comprehensions in `git/cmd.py` around  line 800 with the code before that change (in commit25a2ebf).  Reason: dict comprehensions were introduced only in Python 2.7.- Changed the import source for `SkipTest` and `skipIf` from `unittest.case`  to first trying `unittest` and upon ImportError from `unittest2`.  This was done in `git/util.py` and in several testcases.  Reason: `SkipTest` and `skipIf` were introduced to unittest only  in Python 2.7, and `unittest2` is a backport of `unittest` additions  to Python 2.6.- In git/test/lib/helper.py, fixed the definition of `assertRaisesRegex`  to work on py26.- For Python 2.6, added the `unittest2` dependency to `requirements.txt`  and changed `.travis.yml` to install `unittest2`. Because git/util.py  uses SkipTest from unittest/unittest2, the dependency could not be added  to `test-requirements.txt`.- Fixed an assertion in `git/test/test_index.py` to also allow  a Python 2.6 specific exception message.- In `is_cygwin_git()` in `git/util.py`, replaced `check_output()` with  `Popen()`. It was added in Python 2.7.- Enabled Python 2.6 for Windows:  - Added Python 2.6 for MINGW in .appveyor.yml.  - When defining `PROC_CREATIONFLAGS` in `git/cmd.py`, made use of certain    win32 and subprocess flags that were introduced in Python 2.7, dependent    on whether we run on Python 2.7 or higher.  - In `AutoInterrupt.__del__()` in `git/cmd.py`, allowed for `os` not having    `kill()`. `os.kill()` was added for Windows in Python 2.7 (For Linux, it    existed in Python 2.6 already).
@andy-maier
Copy link
ContributorAuthor

The "rebase" got a little larger because I enabled Python 2.6 also for Windows now, and I added a Python 2.6 environment for both Appveyor (MINGW) and Travis (An earlier commit removed it from Travis).

Unlike earlier, Python 2.6 is now mandatory in Travis in this PR. I think this is the best way to keep it working in the future. If and when an unsurmountable issue with Python 2.6 pops up, it can quickly be removed again.

Please review again.

@ankostis
Copy link
Contributor

@andy-maier have you taken into account my 2 review comments?

@andy-maier
Copy link
ContributorAuthor

No, I'm sorry. I was not aware of your comments. Where can I find them?

@ankostis
Copy link
Contributor

They are visibile in this PR, a couple of comments above embedded.

@andy-maier
Copy link
ContributorAuthor

That's where I looked first, but I don't see them. Maybe something behaves different because this is a PR from my fork and I force-pushed to the branch?

Anyway, could you please copy them here?

@ankostis
Copy link
Contributor

Never mind, i will push on top some commits.

@ankostis
Copy link
Contributor

I'm really having problem working with PY26 - there are still some unofficial python-sites for this release, but are really slow or unmaintained.
Really@andy-maier can you explain again why you need PY26 support?

As I said, this deprecated platform is not only a development burden for us but a security liability for you.

@ByronByron merged commit2f207e0 intogitpython-developers:masterDec 8, 2016
@Byron
Copy link
Member

@andy-maier Thanks a lot for your contribution, it's much appreciated!

I have had a look at the commit, and believe it's OK to merge under the assumption that we can remove or revert it at any time should there be any issues cropping up, or if it becomes an additional burden to maintain it.
However, looking at the changes, I believe the likelihood of that to actually happen is low enough.

@ankostis Please feel free to revert this commit in case it is a security liability in itself.

@@ -812,8 +812,12 @@ def _call_process(self, method, *args, **kwargs):
:return: Same as ``execute``"""
# Handle optional arguments prior to calling transform_kwargs
# otherwise these'll end up in args, which is bad.
_kwargs = {k: v for k, v in kwargs.items() if k in execute_kwargs}
kwargs = {k: v for k, v in kwargs.items() if k not in execute_kwargs}
_kwargs = dict()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you replace it with this more pythonic and quicker to follow (in debug-mode also) code?

_kwargs=dict(k,v)fork,vinkwargs.items()ifkinexecute_kwargs)kwargs=dict((k,v)fork,vinkwargs.items()ifknotinexecute_kwargs)

mock
unittest2; python_version < '2.7'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you modify alsosetup.py andtest-requirements.txt?

ifsys.version_info[:2]< (2,6):test_requires.append('unittest2')

ankostis added a commit to ankostis/GitPython that referenced this pull requestDec 8, 2016
ankostis added a commit to ankostis/GitPython that referenced this pull requestDec 8, 2016
ankostis added a commit to ankostis/GitPython that referenced this pull requestDec 8, 2016
ankostis added a commit to ankostis/GitPython that referenced this pull requestDec 8, 2016
@ankostis
Copy link
Contributor

No prob, the PR is fine.

Just did a minor pythonism included in#555 to convert a loop as a 2 lines, to facilitate debuging.

@hugovkhugovk mentioned this pull requestMar 12, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ankostisankostisankostis left review comments

Assignees
No one assigned
Development

Successfully merging this pull request may close these issues.

4 participants
@andy-maier@codecov-io@Byron@ankostis

[8]ページ先頭

©2009-2025 Movatter.jp