Fix setup.py and use of requirements files and add a docker test container by jeking3 · Pull Request #826 · gitpython-developers/GitPython
Repository navigation
Fix setup.py and use of requirements files and add a docker test container - #826
Merged
Byron merged 3 commits into gitpython-developers:master from jeking3:fix-requirements May 5, 2019
Merged
Fix setup.py and use of requirements files and add a docker test container #826 Byron merged 3 commits into gitpython-developers:master from jeking3:fix-requirements
Conversation
jeking3 commented Jan 15, 2019 · edited Loading
Copy link Copy Markdown
Contributor
Before:
jking@ubuntu:~/GitPython$ python3 setup.py check
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_requirements'
warnings.warn(msg)
running check
Note that setup.py was not even using the contents of requirements.txt or test-requirements.txt. Now it does, and it properly identifies the tests-require field. The requirements.txt file declared a runtime dependency on a testing package. I'm assuming that is an error (although it could be used in production code, I don't know...) so I removed that.
When I ran tox locally on Python 3.6.7 I saw a flake8 error F821 which I disabled as it looks bogus - that exception is defined in the documentation.
Added a docker container that you can use with a couple new make targets. This allows you to run python 2.7, 3.4, 3.5, 3.6, or 3.7 tox even if you are on a local branch not named "master" (some tests require this).
Finally, found and fixed the issue on CI with python 3.7 / Xenial / travis. The root cause is that in git 2.20 new behavior was introduced to stop "git fetch --tags" from clobbering local tags that have changed: git/git@ 0bc8d71
The unit tests expect the old behavior, so now we pass --force down if the version is 2.20 or higher (for the remote test only, the code change is in the test code). It took a while to find this because for some reason when GitCommandError returns an error code, stderr isn't captured. If it was, it would have been easier to figure this out...
jeking3 commented Jan 15, 2019
Copy link Copy Markdown
Contributor
Author
|
It looks like CI isn't healthy. Do you want some help with that? |
Byron commented Jan 20, 2019
Copy link Copy Markdown
Member
|
Thanks a bunch for uncovering this, and for the fix! It looks like one travis failure legit, as it is flake not liking some whitespace . Please have a look at the comment there - maybe we can make a fix here so #825 can then be merged, too. CC @cclauss |
a0a277d to
442c7f9
Compare
January 20, 2019 15:29
codecov-io commented Jan 20, 2019 · edited Loading
Copy link Copy Markdown
Codecov Report
@@ Coverage Diff @@ ## master #826 +/- ## ========================================== - Coverage 94.79% 94.67% -0.13% ========================================== Files 59 59 Lines 9603 9386 -217 ========================================== - Hits 9103 8886 -217 Misses 500 500
Continue to review full report at Codecov .
|
023b17e to
c045246
Compare
January 20, 2019 15:58 cclauss reviewed Jan 22, 2019
View reviewed changes
cclauss mentioned this pull request Jan 24, 2019 Define PermissionError in Python versions < 3.3 #830 Closed cclauss approved these changes Jan 24, 2019
View reviewed changes
cclauss commented Jan 24, 2019
Copy link Copy Markdown
Contributor
|
Run Python 3.7 in allow_failures mode until #827 is fixed? |
jeking3 commented Jan 25, 2019
Copy link Copy Markdown
Contributor
Author
|
What about the windows failures? |
cclauss commented Jan 25, 2019 · edited Loading
Copy link Copy Markdown
Contributor
But the lines just above that say that the current version of setuptools (40.6.3) was just installed. Either don't upgrade setup tools or eliminate the hardcoding of setuptools-27.2.0. |
jeking3 commented Jan 25, 2019
Copy link Copy Markdown
Contributor
Author
|
What I was asking is do you want to ignore those too? I'd prefer to merge this, and then deal with the CI failures, instead of bundling them all together... these changes improve (and fix) the setup.py issues. |
cclauss commented Jan 25, 2019
Copy link Copy Markdown
Contributor
|
You are asking the wrong guy... I have never been a Windows fan. ;-) I would vote to move forward as is. |
jeking3 commented Feb 5, 2019
Copy link Copy Markdown
Contributor
Author
|
Do we need the last three windows builds for "miniconda" or "git running in cygwin on windows"? The latter just looks like a test environment failure as it is passing windows paths (from the windows native python 3.5-x64) into a program looking for a unix path. I have no idea what the "conda" ones are or if they provide any real value. |
jeking3 commented Feb 5, 2019
Copy link Copy Markdown
Contributor
Author
|
The test suite makes a very bad assumption that you are on the master branch. When I work on a project, I fork it, then I make a branch for each of the changes I am making, and submit pull requests from the branch into the upstream master. This is best practices for github development. I cannot run the test suite if I have anything else checked out. The test suite fails. It is making some bad assumptions. When I run inside a docker container and skip past those, even with python 3.6, I'm seeing other issues like utf8 issues. |
0ede297 to
03342ce
Compare
February 5, 2019 21:58
jeking3 commented Feb 5, 2019
Copy link Copy Markdown
Contributor
Author
|
I worked around the issues by checking out a copy of the repository from github into the container at a well-known location. This way the unit tests can run against a fresh clone of the repository and succeed. |
56a06d8 to
e5b03d4
Compare
February 5, 2019 22:45 jeking3 changed the title Fix setup.py and use of requirements files. Fix setup.py and use of requirements files, add a docker test container, and fix a git 2.20 test issue Feb 6, 2019 jeking3 mentioned this pull request Feb 6, 2019 Travis CI tests fail when dist: xenial is used instead of dist: trusty #827 Closed jeking3 force-pushed the fix-requirements branch from
e5b03d4 to
2e93205
Compare
February 6, 2019 00:34
jeking3 commented Feb 6, 2019
Copy link Copy Markdown
Contributor
Author
|
I'm going to tease this apart into smaller bits... |
Fix setup.py and use of requirements files.
5638e77
Update cmd.py, fix PermissionError issue using best practices
48b7e12
This closes gitpython-developers#830
Added a Dockerfile that creates a clean Ubuntu Xenial test environment
21b712a
jeking3
force-pushed
the
fix-requirements
branch
from
2e93205 to
21b712a
Compare
March 15, 2019 11:47 jeking3 closed this Mar 15, 2019 jeking3 reopened this May 5, 2019 jeking3 changed the title -DO NOT MERGE] Fix setup.py and use of requirements files, add a docker test container, and fix a git 2.20 test issue Fix setup.py and use of requirements files and add a docker test container May 5, 2019
jeking3 commented May 5, 2019
Copy link Copy Markdown
Contributor
Author
|
@Byron consider merging this. The appveyor jobs are passing, at least the ones known to pass, and there are some that are known failures; it would still be nice to get all the CI builds to green since that makes it so much easier to determine if a pull request is even worth looking into. |
52ee33a
into
gitpython-developers : master
May 5, 2019
Byron commented May 5, 2019
Copy link Copy Markdown
Member
|
Hi @jeking3 , thanks so much for your persistency. Right now I am very short on time and am far away from this, and any other of my open source projects, which must be frustrating for GitPython's user base. Maybe it would help if there were more collaborators - I have invited you in case this sounds feasible to you. |
jeking3 commented May 5, 2019
Copy link Copy Markdown
Contributor
Author
|
I'll do what I can. Apart from founding a new company, I'm also involved in boost, apache thrift, and a couple other efforts. At the very least if I can get the CI builds to run clean and have folks rebase their pull requests, it would be a lot easier to qualify things in the pipeline. Thanks! |