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

Improve Python version and OS compatibility, fixing deprecations#1654

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 17 commits intogitpython-developers:mainfromEliahKagan:setup
Sep 12, 2023

Conversation

EliahKagan
Copy link
Member

@EliahKaganEliahKagan commentedSep 10, 2023
edited
Loading

Fixes#1640
Fixes#1651
Fixes#1652
Fixes#1653

Overview

This changesinstallation instructions, test code, scripts includingsetup.py, and CI workflows to support Python 3.12, to fix a test that always failed on native Windows systems, and to avoid using deprecatedsetuptools features or recommending their use. I've attempted to fix problems and replace the use of deprecated features in a way that increases rather than decreasing robustness, clarity, and ease of installation. Besides the practical overlap (see below), the conceptual thread that holds all these changes together is that they are about improving compatibility with current and future Python installations.

The actual GitPython library code itself seems already compatible with 3.12, and this PR does not change anything ingit/. It modifiesREADME.md including to change the recommend way to install GitPython from a downloaded source code archive or cloned repository; edits scripts related to installation and building, includingsetup.py; and modifies a test to fix some OS and Python version compatibilities, to make it test the changed installation procedure in the readme, and to make it slightly more robust; and modifies the two CI workflows that run tests.

It seemed to me that the four issues mentioned above, although they are distinct issues with none being a duplicate of any others, inherently overlap and are best fixed in a way that involves overlapping code changes as well as overlapping considerations for reviewing the changes. So although I am a bit concerned about the scope of this pull request, I've done these changes together in one PR. However, they are separated across a number of narrowly scoped commits, with most of the commit messages detailing the change the commit makes and its purpose.

Documentation changes

In parts of the readme that had to be changed to replacepython setup.py withpip install, I applied other updates and clarifications too. I avoided doing this in any other parts of the readme. I reorganized the installation instructions for clarity, subdividing them into separate<h4> sections so that the distinctions between different installation approaches is readily apparent and readers can immediately find the part of the instructions they are looking for.

When making those changes, I included the tag-fetching step that was recently added in one place but not another where it is relevant, explicitly mentioned that the instructions should usually be carried out in a virtual environment, and addressed forks so users less familiar with common GitHub workflows would not be misled into thinking they should clone the upstream repository to propose changes. (I was a bit uncomfortable doing the latter as part of this already broad PR, but it actually relates to the tag-fetching step: if thegh command is used for cloning, tags on the upstream repo are available even if the fork does not have them, allowing local tests to pass.)

I didnot also update the documentation indoc/. Although this should be done, that documentation is already considerably out of date in other ways including with respect to installation and dependencies, and this PR is already fairly large in scope. Note that the old approach of runningpython setup.py installdoes still work in all the cases where it worked before. So this does not break the old documentation, it just doesn't bring it up to date.

CI changes

This adds 3.12, which is currently at RC2, to be tested on CI, permittingsetup-python to install prereleases for 3.12 but not for other versions. That only affects the Ubuntu workflow.

It also updates both CI test workflows to test the new installation procedure and to harmonize them with the updatedREADME.md instructions, and this attempts to make them clearer both in terms of the workflow files' own readability and in terms of the output generated in the GitHub Actions web-based interface.

This doesnot add any new Windows tests. While it would be valuable to have native (non-Cygwin) Windows tests on CI, and it would be valuable (if it does not cause CI checks to take too long) to have Cygwin and non-Cygwin Windows tests on multiple Python versions (as well as to test on macOS), this PR does not propose any such changes. This would be nontrivial, at least in the case of native Windows tests, and in my opinion significantly beyond the scope of this PR. I also did not want to wait tofix#1640, since Python 3.12 is already at RC2, with stable 3.12.0 coming out in a month.

Because there are still no non-Cygwin Windows tests on CI, the CI tests results shown for this pull request do not demonstrate that itresolves#1651. However, I have shown the failure in that issue, and I have verified that the changes here fix it, causingtest_installation to pass. I tested on Windows 10 with Python 3.11.5, and also on the same system with Python 3.12.0rc2 to verify that it works for the combination of 3.12 and Windows.

One of thesetup.py changes deserves special scrutiny in review

The main change in this PR that I anticipate mightnot be wanted isthe addition of atestextra. This approach seemed best to me, but only by a very narrow margin, and I am not at all sure that I am right. The reason I did this, as well as why some other approach might be preferred, are detailed in#1652.

My rationale hinges on the assumption that it is a goal for there to be a way to install the package for local development that also takes care of installing test dependencies. Although test dependencies are not installed unless thetest extra is called for, it may nonetheless besurprising for an extra to exist that provides dependencies that none of the code in the PyPI package uses. (A possible counterargument is that running the tests is a way of using the code under test, and the code under test is part of the PyPI package.)

If thetest extra is not wanted, I would be pleased to remove it and to update the readme and CI workflows accordingly. This could stillresolve#1652, because I could appropriately weaken the claim it makes about automatic dependency installation.

ankitsejwal reacted with thumbs up emojihugovk reacted with hooray emoji
Starting in Python 3.12, global and virtual Python environments nolonger automatically ship setuptools (per the "ensurepip" item inhttps://docs.python.org/3.12/whatsnew/3.12.html#removed). Projectsthat use setuptools as a build backend are still supported,including with setup.py using techniques such as "pip install .".In Windows, the "bin" subdir of a virtual environment dir is called"Scripts" instead. Unlike in a global environment (where no namesare universal, and "python3" and "pip3" are more common for thePython 3 commands on some popular Unix-like systems), in a virtualenvironment the "python" and "pip" commands are always present and"python3" and "pip3" are not guaranteed to be present.This commit changes test_installation accordingly. The CI workflowsand documentation still need to be updated.
This changes the installation instructions in README.md torecommend "pip install ." instead of "python setup.py install". Theformer is compatible with Python 3.12 which doesn't have setuptoolsinstalled by default (so setup.py, which imports it, can beindirectly but not directly used). This also matches thecorresponding change made in the installation unit test.While doing so, I've also clarified the instructions, and added theimplied "cd" command as well as the "git fetch --tags" command inthe position where a later section was recently updated to mentionit should have been run.Using "pip install ." creates the opportunity to pass "-e" to makean editable install, which users who clone the repository to workon changes should do, because the effect of an editable install isonly partially simulated by pytest, and so that manual testing ofchanges actually uses the changes intended for testing.This increases the length and detail of the instructions, so I'veadded h4 subsections to clarify the separations between them andmake it easier for readers to find the part they're looking for. Indoing so, I've reordered these subsections accordingly. Becausegreater detail can create the impression that all important stepsare mentioned, I've made the general good advice to use a virtualenvironment explicit. For brevity, I have not added venv commands.
This adds a #! line to the top of setup.py, because it is a scriptwith the executable bit set. Although neither recent nor currentdocumentation in the project recommends to run "./setup.py", thisshould probably have the intuitive effect of attempting to run thescript with a Python interpreter rather than a Unix-style shell.It also uses the "env trick" in init-tests-after-clone.sh so thatscript runs with whatever bash interpreter is found in a normalPATH search. While "sh" is expected to be found in /bin on allUnix-like systems, that is not always the case for "bash". Thischange slightly improves compatibility by supporting systems thatdon't ship with bash but on which it has been installed.
- Remove "gitdb" from test-requirements.txt, because it already a  dependency of the project (listed in requirements.txt, which is  used to build the value passed for install_requires in setup.py).- Remove "black" from requirements-dev.txt, because it is listed in  test-requirement.txt (which requirements-dev.txt sources).
Because tests_require is deprecated since setuptools 41.5.0 withthe intention that it will be removed in some future version (notedinhttps://setuptools.pypa.io/en/latest/references/keywords.html).It is somewhat unintuitive for GitPython to have a "test" extra, asit makes it so "GitPython[test]" can be specified for installationfrom PyPI to get test dependencies, even though the PyPI packagedoesn't include the unit test themselves.However, this makes the statement in README.md that the installertakes care of both requirements.txt and test-requirements.txtdependencies fully true, instead of moving further away from that.Because it is now possible to make an editable GitPython installwith test as well as minimal dependencies installed, this commitalso updates the readme to document and recommend this.
Instead of directly running setup.py.This allows Python 3.12 (as well as previous versions) to be usedfor building. Although setuptools could be added as a developmentdependency to run setup.py, using "build" instead is recommended inhttps://setuptools.pypa.io/en/latest/userguide/quickstart.html.Those docs likewise recommend only listing "wheel" in thebuild-system section of pyproject.toml if setup.py actually importsthe wheel module. So this removes that. (Running "make release",which now uses "build", will continue to build wheels.)The "build" package is not conceptually a testing dependency, buttest-requirements.txt is currently the de facto list of all stabledevelopment dependencies for regular use.
This is cleanup related to the previous commit. As that file grows,it is harder to tell immediately if a particular package is in itwhen not alphabetized. (The groups were also not intuitive, withddt listed separately from other unit test related dependencies.)
This removes the step in test_installation that did the equivalentof "pip install -r requirements.txt", because installing GitPythonis sufficient to install all its required dependencies, and it ismore important to test that than to test requirements.txt directly.Removing this causes the test to fail if installing the projectdoesn't entail installation of the requirements necessary to importthe git module or to cause gitdb to be found in a sys.path search.
Key changes:- Update the two CI workflows to install the project and its  dependencies in accordance with the changed recommendations in  README.md. (This is to test that those recommendations work,  which the changed test_installation test case partially but not  completely tests. The old approach to installation still works  too, so this change on CI is not required to keep CI working.)- Add Python 3.12 to the CI test matrix in pythonpackage.yml,  testing it on Ubuntu. (The Cygwin workflow still tests only 3.9.)Maintenance changes, made to avoid decreasing readability with theother changes (and hopefully even increase it somewhat):- Separate commands into more steps, grouping them by more specific  purposes.- Decrease the ways the two workflows differ from each other that  do not represent actual intended behavioral differences. This is  to make the important differences easier to stop, and to make it  easier to determine when the same change has or has not been made  to both workflows.
The omission of "set -x" was intentional and is currently necessaryon Cygwin (but not on Ubuntu), peraafb92a.
@EliahKaganEliahKagan changed the titleImprove Python version and OS compatibility, fix deprecationsImprove Python version and OS compatibility fixing deprecationsSep 10, 2023
@EliahKaganEliahKagan changed the titleImprove Python version and OS compatibility fixing deprecationsImprove Python version and OS compatibility, fixing deprecationsSep 10, 2023
Setting the "fetch-depth" to 0 does a deep (i.e., ordinary) fetch,fetching all commits and tags. Setting "submodules" to "recursive"clones and checks out all submodules. These options allow commandsthat were doing those things to be removed from the later steps.
This also adds "--noprofile --norc" to the Cygwin shell commandas a speed optimization (bash doesn't need to source its scripts).That only changes the Cygwin workflow; in the Ubuntu workflow,"--noprofile --norc" had already been included by default when noshell was specified, so having it there is to *keep* the optimizedbehavior that was already in use.
Copy link
Member

@ByronByron left a comment

Choose a reason for hiding this comment

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

That's great work, thank again.

I find your ability to explain changes downrightsuper-human, along with keeping track of their internal and external dependencies, combining it all in various orthogonal issues along with a PR to fixing all of them, explaining even why this is chosen over alternatives. This is certainly appreciated, as it forces me to follow your train of thought while catching up with python. There is still a part of me that simply wants to give you write access tomain and say: You know what's best, go ahead :).

With that said, I would definitely appreciated if native Windows testing could, one day, be added to CI. The time budget of about 20 minutes seems quite feasible, a bound that is currently set by cygwin, and I would be surprised if native windows manages to be worse.

For me it's most important that I can still make releases, and I think I will try to perform one from this branch and if it works, merge it right away.

avgdev reacted with thumbs up emoji
@Byron
Copy link
Member

It looks like the script currently expectspython to be present, even though for me it ispython3.

Maybe I am holding it wrong. Should I follow the installation instructions to get a local dev environment, and then try again from there? I might add thattwine is used to perform the release, is this something that should then be added to the venv? What's the standard for that in the python world?

Thanks for your help.

There the system python interpreter is referred to as `python3`,at least when installed by homebrew.
@Byron
Copy link
Member

Thanks for elaborating.

I have changed theMakefile topython3 for convenience, right after installing dependencies withpip install -e ".[test]". That seems to have installedbuild for the current user (Collecting build (from GitPython==3.1.36) Downloading build-1.0.3-py3-none-any.whl (18 kB)), but it would still not find it when runningpython3 -m build.

In order to runtwine on my system, I already have to set thePATH accordingly. Now I also set thePYTHON_PATH to/Users/byron/Library/Python/3.9/lib/python/site-packages:/Users/byron/Library/Python/3.9/lib which seemingly is wherebuild was installed into, but to no avail.

Maybe a venv installation is best to solve both problems. Could you add a commit that adjusts theREADME.md and/or scripts that would make it work assuming onlyvirtualenv? That at least I can execute successfully.

Thank you 😅

If a virtual environment (created by venv or virtualenv) is active,running "make release" or "make force_release" now automaticallyinstalls/upgrades the "build" and "twine" packages in it. This isonly done if "make" is run in a virtual environment.This can be a fresh environment: neither the project nor itsdependencies need to be installed in it. Because the "build" moduleis not currently used in any tests and running "make" in a virtualenvironment takes care of installing "build" (and "twine"), "build"is now removed from test-requirements.txt.The publishing instructions in the readme are updated accordingly,to mention the optional step of creating and activating a virtualenvironment, and to briefly clarify why one might want to do that.Running "make" outside a virtual environment remains supported,except that, due to recent changes, whatever environment it is runin needs to have a usable "build" module.
@EliahKagan
Copy link
MemberAuthor

EliahKagan commentedSep 11, 2023
edited
Loading

Could you add a commit that adjusts theREADME.md and/or scripts that would make it work assuming onlyvirtualenv?

Good idea. I have now done this in5343aa0.

There are various approaches that could be taken for this. The approach I picked was:

  • Havemake release/make force_release check if a virtual environment is active, and install thebuild andtwine packages in it if so. (The environment does not need to have the project or any dependencies installed in it, though a project virtual environment can be reused for this purpose.)
  • Update the publishing instructions inREADME.md with the optional step of creating and activating a virtual environment, and to mention that doing so causes themake release step to automatically installbuild andtwine.
  • Removebuild fromtest-requirements.txt, since no tests currently use it andmake now automates its installation.

I have tested this (as best as I can) on Ubuntu with Python 3.11, in virtual environments created withvirtualenv, as well as withpython -m venv as I am more accustomed to using. As expected, both worked, within the limits of my testing. Besides running various commands manually, I testedmake force_release (and pressedCtrl+C whentwine prompted me for credentials).

I havekept the change ofpython topython3 that you made inf86f09e. I considered having it usepython if in a virtual environment andpython3 otherwise, but I don't think that would increase portability yet. I believe--and testing seems to confirm--that the ref checking inmake release is currently nonportable. It passeshead togit whereHEAD would be required on most other *nix systems due to case sensitivity. It also usessort -n with tag names of the formx.y.z (on systems I have tested this on, only thex andy parts are ordered numerically). MakingMakefile portable is something that could be done later. Even though portability is the theme of this PR, I think it's better to defer that, providedmake release is working at least on macOS.

The installation instructions and release instructions link to two different pages on virtual environments. This is intentional, but I'd be pleased to change if it you prefer. Becausevenv is more common thanvirtualenv and more widely recommended today, and to avoid overwhelming developers less familiar with virtual environments with choices they may not be interested in, I have retained the link tovenv-only documentation that I previously added to the installation instructions. But in the new step of the release instructions, I linked to another (also official) page that talks both aboutvenv andvirtualenv.

@Byron
Copy link
Member

Thank you so much! The trick really was to runpython3 -m venv env to get a virtual-env, and then installing any package actually works.

I just created a new release which, in hindsight, I was unnecessary as it doesn't contain user-facing changes.

Regardingmake release, I haven't been using this make target in a long time as it didn't really work and I could just usemake force_release while ideally not forgetting to create a tag. Automating this further isn't needed, I believe, but won't hurt either. In theory, a python project about git should be able to use itself to deal with tags and tag creation, I'd think 😁.

@EliahKagan
Copy link
MemberAuthor

EliahKagan commentedSep 13, 2023
edited
Loading

I just created a new release which, in hindsight, I was unnecessary as it doesn't contain user-facing changes.

I'm not sure if this should've had a release or not.

Starting in 3.1.36, it is possible to runpip install "GitPython[test]", which downloads and installs a GitPython wheel from PyPI, along with its test dependencies.Users should not actually do this, because thetest extra is not useful to use in that particular way, but it is possible. Since thetest extra is only useful for development, I think it makes sense that it is documented only for that, and referenced only indirectly in the release description.

When I sawd99b2d4, I thought to ask if it should be apost release instead. But I realized that, due to the new extra, that should probably not be done (since I think it is best for post releases to carry zero installed difference, even in situations that are unusual or not recommended).

On the other hand, it might've been best to avoid it, because it's not necessary to upgrade to it, and because the resulting downstream 3.1.36in conda-forge really is identical to the corresponding downstream 3.1.35. I don't know what the best practice is in this situation.

Regardingmake release, I haven't been using this make target in a long time as it didn't really work and I could just usemake force_release while ideally not forgetting to create a tag.

make release usesgit tag | sort -nr. Do you happen to know if, on macOS, that sorts according to SemVer, at least for the tag names that actually exist in this repository? On my Ubuntu system, it lists2.1.2 above2.1.15 and, more subtly, lists0.3.2-RC1 above0.3.2 and lists0.1.4-pre above0.1.4. Because that's supposed to be later releases above earlier releases (as-r reverses the order), this behavior is not correct.

On GNU/Linux systems including my Ubuntu system,sort is GNU sort, which supports-V/--version-sort. When used in place of-n, this does the right thing with2.1.2/2.1.15, but still not with0.3.2-RC1/0.3.2 or0.1.4-pre/0.1.4. This is the same problem the otherwise more elegantgit tag --sort=-v:refname has.

Ifgit tag | sort -nr does whatMakefile intends it to do on macOS, then I'd be interested in ways to preserve something like the currently writtenrelease target while making it more portable. If not, I'd be more interested in replacing it with something else.

@EliahKagan
Copy link
MemberAuthor

EliahKagan commentedSep 13, 2023
edited
Loading

Replying to#1654 (review):

I find your ability to explain changes downrightsuper-human, along with keeping track of their internal and external dependencies, combining it all in various orthogonal issues along with a PR to fixing all of them, explaining even why this is chosen over alternatives. This is certainly appreciated, as it forces me to follow your train of thought while catching up with python.

Thanks! :) :)

There is still a part of me that simply wants to give you write access tomain and say: You know what's best, go ahead :).

It's an honor to hear that such a thing has even crossed your mind! However, I recommend against doing any such thing, at least at this time. The reason is that I actually have only minimal knowledgeof GitPython. I use GitPythonindirectly--because, as a very popular library, it is a dependency of other projects I use directly, especiallynbdime. As a result, if I did have write access, it would be the current situation, just with extra steps: I would not be comfortable making any unreviewed changes.

That's the origin of my interest in GitPython. I learned ofCVE-2023-40590 (#1635) from security alerts on a couple of my repositories that declarenbdime as a development dependency, so I decided to contribute#1636. Unfortunately, even once amended in#1650, my fix also introducesanos.environ race condition, so maybe itcould be done better. Given that the still-flawed fix (like the CVE it fixes)affects native Windows only, I would feel better experimenting with such improvements once we have...

With that said, I would definitely appreciated if native Windows testing could, one day, be added to CI. The time budget of about 20 minutes seems quite feasible, a bound that is currently set by cygwin, and I would be surprised if native windows manages to be worse.

Yes, this is something I am very much interested in doing. (Though I certainly do not want to stop anybody else who wants to work on it!)

I'm interested in figuring out(a) which, of tests that do not pass for me on Windows,should pass because they fail due to a problem specific to my environment or fork, and,(b) of others that are not already skipped on Windows, if the bugs that break them on native Windowspython can simply be fixed.#1651 is an example of such a bug. I'd rather find and fix more bugs like that--if there are any--than obscure them to get CI to pass.

I'm also hoping to find some way to make it significantly faster than the Cygwin test job (currently) is, even if not nearly as fast as the Ubuntu test jobs. If the tests can be made to run fast enough on native Windows, then a matrix strategy could be used as in the Ubuntu test workflow to test on all Python versions GitPython supports (possibly even as part of that workflow, by adding an OS dimension to the existing matrix, depending on how much Window-specific preparation ends up having to be done). Because each job gets its own runner and the runners operate in parallel, six 20-minute checks are no problem for one push, but could slow things down a lot with many pushes in a short time, due to limits on the number of GitHub Actions runners per user or organization.

If worse comes to worse, there is always the middle ground of testing a smaller number of versions on native Windows but still more than one. Perhaps 3.8 and 3.12.

@hugovk
Copy link
Contributor

make release usesgit tag | sort -nr. Do you happen to know if, on macOS, that sorts according to SemVer, at least for the tag names that actually exist in this repository?

macOS Ventura doesn't sort according to SemVer:

sort --version2.3-Apple (154)git tag| sort -nr3.1.93.1.83.1.73.1.63.1.53.1.43.1.363.1.353.1.343.1.333.1.323.1.313.1.303.1.33.1.293.1.283.1.273.1.263.1.253.1.243.1.233.1.223.1.203.1.23.1.193.1.183.1.173.1.163.1.153.1.143.1.133.1.123.1.113.1.103.1.13.1.03.0.93.0.83.0.73.0.63.0.53.0.43.0.33.0.23.0.13.0.02.1.92.1.82.1.72.1.62.1.52.1.42.1.32.1.22.1.152.1.142.1.132.1.122.1.112.1.102.1.12.1.02.0.92.0.82.0.72.0.62.0.52.0.42.0.32.0.22.0.12.0.01.0.21.0.11.0.00.3.70.3.60.3.50.3.40.3.30.3.2.1-patched0.3.2.10.3.2-RC10.3.20.3.1-beta20.3.1-beta10.3.0-beta20.3.0-beta10.2.0-beta10.1.70.1.60.1.50.1.4-pre0.1.4winerr_show

@Byron
Copy link
Member

Thanks for sharing your "origin story" - I start liking CVEs much more now, given they made you aware of this project and caused the first contribution :).
I understand your position regarding becoming a maintainer, and if there is ever a change to that so there is benefit to make you one, just let me know :).

I'd rather find and fix more bugs like that--if there are any--than obscure them to get CI to pass.

If I recall correctly, most test-failures on windows arise from its 'unique' way of handling open files, which is quite incompatible with the way files are handled on Unix systems. That said, by now things might have changed and it's probably worth to at least retry the ignored tests to see if some of them work now.

I also think that having any kind of native windows CI job is orthogonal to making more tests pass - the latter is entirely optional to me and definitely nothing more than 'nice to have' at this point. CI on native python on Windows would be a great step forward already.

[..] but could slow things down a lot with many pushes in a short time, due to limits on the number of GitHub Actions runners per user or organization.

These days there isn't too much CI activity here, but if it was a problem I am willing to cancel some jobs by hand. It's something I do quite regularly ingitoxide where CI takes 30 to 40 minutes.

@EliahKagan
Copy link
MemberAuthor

@hugovk Thanks--I find that very helpful, because it tells mesort -n doesn't work for this on any common systems and should be abandoned.

Based on that, I looked for alternatives tosort -n andsort -V that better support SemVer, and foundversionsort.suffix, which will letgit tag --sort=-v:refname do it well enough:

git -c versionsort.suffix=-alpha -c versionsort.suffix=-beta -c versionsort.suffix=-pre -c versionsort.suffix=-rc -c versionsort.suffix=-RC tag --sort=-v:refname

If git's-c supported a form that allowed it and its operand to be passed as a single command-line argument, then brace expansion (in a shell that has it) could abbreviate that nicely. Unfortunately it doesn't. But:

git$(printf' -c versionsort.suffix=-%s' alpha beta pre rc RC) tag --sort=-v:refname

Then, to also filter out non-version tags (they're at the top now, so must be dropped before| head -n1):

git$(printf' -c versionsort.suffix=-%s' alpha beta pre rc RC) tag -l'[0-9]*' --sort=-v:refname

(Where the[0-9]* is a glob, not a regex, and matches the entire tag name, so it's likegreping for^[0-9].)

@EliahKagan
Copy link
MemberAuthor

EliahKagan commentedSep 13, 2023
edited
Loading

@Byron

I understand your position regarding becoming a maintainer, and if there is ever a change to that so there is benefit to make you one, just let me know :).

Thanks! That might make sense if/when I have learned more about the codebase (though I would still likely request reviews on many changes).

I also think that having any kind of native windows CI job is orthogonal to making more tests pass - the latter is entirely optional to me and definitely nothing more than 'nice to have' at this point. CI on native python on Windows would be a great step forward already.

That makes sense. If it's okay for native Windows CI to be set up even with tests failing that are not currently skipped or documented to fail on Windows, then I may be able to do it sooner. I think there's still some stuff I need to figure out, though. I think some of the tests that fail on my Windows system are failing only because not everything is set up properly. Furthermore, none of the changes I've made that needed to be tested on Windows required me to set upgit-daemon, and I have never done so.

Since I believe Windows GitHub Actions runners include fullGit for Windows installations, and Git for Windows does shipgit-daemon.exe in its/mingw64/libexec/git-core directory (where/ is not really the root of a Windows drive, but somewhere deeper, for example that path on my Windows system is reallyC:\Users\ek\scoop\apps\git\2.42.0.2\mingw64\libexec\git-core), any insights from figuring that out locally should carry over.

@Byron
Copy link
Member

git $(printf ' -c versionsort.suffix=-%s' alpha beta pre rc RC) tag -l '[0-9]*' --sort=-v:refname

This is absolutely amazing! I knowgit can do a lot, but wasn't aware of this configuration option.

That makes sense. If it's okay for native Windows CI to be set up even with tests failing that are not currently skipped or documented to fail on Windows, then I may be able to do it sooner.

Yes, absolutely. I think it's better to split the task into CI Setup and Tests themselves. That way, Tests can simply be ignored when found failing at first until the is time to see if they could also work. Additionally, I think it's perfectly alright to only test the borders of the supported version range of Python, and for that test different Windows versions. I know that GHA supports quite some parallelism, but I'd prefer to conserve the compute anyway and optimize for actual coverage. Limiting oneself somewhat when setting up additional jobs seems particularly easy here since this GitPython seems to have been fine without any of it for more than a decade now.

renovatebot referenced this pull request in allenporter/flux-localSep 23, 2023
[![MendRenovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)This PR contains the following updates:| Package | Change | Age | Adoption | Passing | Confidence ||---|---|---|---|---|---|| [GitPython](https://togithub.com/gitpython-developers/GitPython) |`==3.1.36` -> `==3.1.37` |[![age](https://developer.mend.io/api/mc/badges/age/pypi/GitPython/3.1.37?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/GitPython/3.1.37?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/GitPython/3.1.36/3.1.37?slim=true)](https://docs.renovatebot.com/merge-confidence/)|[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/GitPython/3.1.36/3.1.37?slim=true)](https://docs.renovatebot.com/merge-confidence/)|---### Release Notes<details><summary>gitpython-developers/GitPython (GitPython)</summary>###[`v3.1.37`](https://togithub.com/gitpython-developers/GitPython/releases/tag/3.1.37):- a proper fixCVE-2023-41040[CompareSource](https://togithub.com/gitpython-developers/GitPython/compare/3.1.36...3.1.37)#### What's Changed- Improve Python version and OS compatibility, fixing deprecations by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1654](https://togithub.com/gitpython-developers/GitPython/pull/1654)- Better document env_case test/fixture and cwd by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1657](https://togithub.com/gitpython-developers/GitPython/pull/1657)- Remove spurious executable permissions by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1658](https://togithub.com/gitpython-developers/GitPython/pull/1658)- Fix up checks in Makefile and make them portable by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1661](https://togithub.com/gitpython-developers/GitPython/pull/1661)- Fix URLs that were redirecting to another license by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1662](https://togithub.com/gitpython-developers/GitPython/pull/1662)- Assorted small fixes/improvements to root dir docs by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1663](https://togithub.com/gitpython-developers/GitPython/pull/1663)- Use venv instead of virtualenv in test_installation by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1664](https://togithub.com/gitpython-developers/GitPython/pull/1664)- Omit py_modules in setup by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1665](https://togithub.com/gitpython-developers/GitPython/pull/1665)- Don't track code coverage temporary files by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1666](https://togithub.com/gitpython-developers/GitPython/pull/1666)- Configure tox by [@&#8203;EliahKagan](https://togithub.com/EliahKagan)in[https://github.com/gitpython-developers/GitPython/pull/1667](https://togithub.com/gitpython-developers/GitPython/pull/1667)- Format tests with black and auto-exclude untracked paths by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1668](https://togithub.com/gitpython-developers/GitPython/pull/1668)- Upgrade and broaden flake8, fixing style problems and bugs by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1673](https://togithub.com/gitpython-developers/GitPython/pull/1673)- Fix rollback bug in SymbolicReference.set_reference by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1675](https://togithub.com/gitpython-developers/GitPython/pull/1675)- Remove `@NoEffect` annotations by[@&#8203;EliahKagan](https://togithub.com/EliahKagan) in[https://github.com/gitpython-developers/GitPython/pull/1677](https://togithub.com/gitpython-developers/GitPython/pull/1677)- Add more checks for the validity of refnames by[@&#8203;facutuesca](https://togithub.com/facutuesca) in[https://github.com/gitpython-developers/GitPython/pull/1672](https://togithub.com/gitpython-developers/GitPython/pull/1672)**Full Changelog**:gitpython-developers/GitPython@3.1.36...3.1.37</details>---### Configuration📅 **Schedule**: Branch creation - At any time (no schedule defined),Automerge - At any time (no schedule defined).🚦 **Automerge**: Enabled.♻ **Rebasing**: Whenever PR becomes conflicted, or you tick therebase/retry checkbox.🔕 **Ignore**: Close this PR and you won't be reminded about this updateagain.---- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, checkthis box---This PR has been generated by [MendRenovate](https://www.mend.io/free-developer-tools/renovate/). Viewrepository job log[here](https://developer.mend.io/github/allenporter/flux-local).<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi45Ny4xIiwidXBkYXRlZEluVmVyIjoiMzYuOTcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
otc-zuulbot pushed a commit to opentelekomcloud-infra/eyes_on_docs that referenced this pull requestOct 25, 2023
Bump gitpython from 3.1.35 to 3.1.37Bumps gitpython from 3.1.35 to 3.1.37.Release notesSourced from gitpython's releases.3.1.37 - a proper fixCVE-2023-41040What's ChangedImprove Python version and OS compatibility, fixing deprecations by @​EliahKagan ingitpython-developers/GitPython#1654Better document env_case test/fixture and cwd by @​EliahKagan ingitpython-developers/GitPython#1657Remove spurious executable permissions by @​EliahKagan ingitpython-developers/GitPython#1658Fix up checks in Makefile and make them portable by @​EliahKagan ingitpython-developers/GitPython#1661Fix URLs that were redirecting to another license by @​EliahKagan ingitpython-developers/GitPython#1662Assorted small fixes/improvements to root dir docs by @​EliahKagan ingitpython-developers/GitPython#1663Use venv instead of virtualenv in test_installation by @​EliahKagan ingitpython-developers/GitPython#1664Omit py_modules in setup by @​EliahKagan ingitpython-developers/GitPython#1665Don't track code coverage temporary files by @​EliahKagan ingitpython-developers/GitPython#1666Configure tox by @​EliahKagan ingitpython-developers/GitPython#1667Format tests with black and auto-exclude untracked paths by @​EliahKagan ingitpython-developers/GitPython#1668Upgrade and broaden flake8, fixing style problems and bugs by @​EliahKagan ingitpython-developers/GitPython#1673Fix rollback bug in SymbolicReference.set_reference by @​EliahKagan ingitpython-developers/GitPython#1675Remove@NoEffect annotations by @​EliahKagan ingitpython-developers/GitPython#1677Add more checks for the validity of refnames by @​facutuesca ingitpython-developers/GitPython#1672Full Changelog: gitpython-developers/GitPython@3.1.36...3.1.37Commitsb27a89f fix makefile to compare commit hashes only0bd2890 prepare next release832b6ee remove unnecessary list comprehension to fix CIe98f57b Merge pull request #1672 from trail-of-forks/robust-refname-checks1774f1e Merge pull request #1677 from EliahKagan/no-noeffecta4701a0 Remove@NoEffect annotationsd40320b Merge pull request #1675 from EliahKagan/rollbackd1c1f31 Merge pull request #1673 from EliahKagan/flake8e480985 Tweak rollback logic in log.to_fileff84b26 Refactor try-finally cleanup in git/Additional commits viewable in compare viewDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting@dependabot rebase.Dependabot commands and optionsYou can trigger Dependabot actions by commenting on this PR:@dependabot rebase will rebase this PR@dependabot recreate will recreate this PR, overwriting any edits that have been made to it@dependabot merge will merge this PR after your CI passes on it@dependabot squash and merge will squash and merge this PR after your CI passes on it@dependabot cancel merge will cancel a previously requested merge and block automerging@dependabot reopen will reopen this PR if it is closed@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)You can disable automated security fix PRs for this repo from the Security Alerts page.Reviewed-by: Vladimir Vshivkov
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull requestNov 14, 2023
8 of the tests that fail on native Windows systems fail due toIndexFile.from_tree being broken on Windows, causinggitpython-developers#1630.This commit marks those tests as xfail. This is part, though notall, of the changes to get CI test jobs for native Windows thatare passing, to guard against new regressions and to allow the codeand tests to be gradually fixed (see discussion ingitpython-developers#1654).When fixing the bug, this commit can be reverted.
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull requestNov 14, 2023
8 of the tests that fail on native Windows systems fail due toIndexFile.from_tree being broken on Windows, causinggitpython-developers#1630.This commit marks those tests as xfail. This is part, though notall, of the changes to get CI test jobs for native Windows thatare passing, to guard against new regressions and to allow the codeand tests to be gradually fixed (see discussion ingitpython-developers#1654).When fixing the bug, this commit can be reverted.
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull requestNov 15, 2023
8 of the tests that fail on native Windows systems fail due toIndexFile.from_tree being broken on Windows, causinggitpython-developers#1630.This commit marks those tests as xfail. This is part, though notall, of the changes to get CI test jobs for native Windows thatare passing, to guard against new regressions and to allow the codeand tests to be gradually fixed (see discussion ingitpython-developers#1654).When fixing the bug, this commit can be reverted.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ByronByronByron approved these changes

@hugovkhugovkhugovk left review comments

Assignees
No one assigned
Labels
None yet
3 participants
@EliahKagan@Byron@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp