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

Test installing project on CI#90

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:masterfromEliahKagan:ci-install
Sep 11, 2023

Conversation

EliahKagan
Copy link
Member

This changes the CI workflow to install the project itself to get its dependency, rather than installing the dependency fromrequirements.txt. This is the more important thing to test, because it verifies that the project is installable and effectively declares the dependencies it needs.

This changes the CI workflow to install the project itself to getits dependency, rather than installing the dependency fromrequirements.txt. This is the more important thing to test, becauseit verifies that the project is installable and effectivelydeclares the dependencies it needs.
@EliahKaganEliahKagan marked this pull request as ready for reviewSeptember 11, 2023 06:36
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.

Thanks a lot!

I was never aware the. syntax even existed and wonder if ultimately is just findsrequirements.txt by convention, or if there is any other source of dependency information.

@ByronByron merged commitd22ac20 intogitpython-developers:masterSep 11, 2023
@EliahKagan
Copy link
MemberAuthor

The. syntax installs the project defined in the current directory. It doesn't know anything aboutrequirements.txt, but it does know aboutsetup.py, as well as the more modernsetup.cfg andpyproject.toml.

It also can handle build backends that are not currently installed. For example, starting in Python 3.12,setuptools is not automatically installed, so in fresh Python 3.12 virtual environments asetup.py script cannot be run directly, butpip install . will still manage to run it. (This is the "Installing backend dependencies" step sometimes shown inpip output.) This works for backends other thansetuptools, too. For example, a project that usespoetry and defines everything inpyproject.toml in a way onlypoetry understands can be installed withpip install . even ifpoetry is absent;pip installs thepoetry build backend.

Sosetup.py is actually providing the dependencies thatpip install . installs for gitdb:

install_requires=['smmap>=3.0.1,<6'],

That happens to be the same as inrequirements.txt, but it doesn't have to be. If it weren't, installing fromrequirements.txt could make something succeed that would fail when the package is installed from PyPI (hence why I regardpip install . to be a better way to install required dependencies before running tests).

Althoughpip install . doesn't userequirements.txt, it will still be used ifsetup.pyreads anduses it, as is the case in GitPython.

The other benefit ofpip install . is that it installs the project, not just its dependencies. Because this is installing a package--albeit one that it is building on the fly from the working directory--it more closely matches what happens when the project is installed from PyPI. A middle ground can be achieved by also passing-e/--editable, which "installs a package" but the package is just the local files, rather than copies of them. This is very useful for local development, because changes are immediately reflected in the "installed package," but it's not necessary for CI.

(Of course, another way to test behavior of a built sdist or wheel is to actually build one and install from it in a new environment, which tools liketox andnox automate. I do not claim that usingpip install . achieves that level of similarity to installing from PyPI.)

@EliahKaganEliahKagan deleted the ci-install branchSeptember 11, 2023 07:29
@Byron
Copy link
Member

Thanks a lot for the explanation, it's much appreciated.

The other benefit ofpip install . is that it installs the project, not just its dependencies. Because this is installing a package--albeit one that it is building on the fly from the working directory--it more closely matches what happens when the project is installed from PyPI. A middle ground can be achieved by also passing-e/--editable, which "installs a package" but the package is just the local files, rather than copies of them.

The-e flag seems like the secret ingredient that I have been missing for a long time now. I simply wasn't able to run GitPython locally anymore once the hacks that I added early on (a decade ago?) to allow that were removed.

EliahKagan reacted with thumbs up emoji

EliahKagan added a commit to EliahKagan/smmap that referenced this pull requestSep 17, 2023
This updates smmap's CI configuration in ways that are in line withrecent updates to gitdb's. In most cases there is no difference inthe changes, and the reason for the updates is more to avoidconfusing differences than from the value of the changesthemselves. In one case, there is a major difference (fetch-depth).-gitpython-developers/gitdb#89 (same)-gitpython-developers/gitdb#90 (same)  It's just the project, not dependencies, but otherwise the same.-gitpython-developers/gitdb#92 (opposite)  This is the major difference. We don't need more than the tip of  the branch in these tests. Keeping the default fetch-depth of 1  by not setting it explicitly avoids giving the impression that  the tests here are doing something they are not (and also serves  as a speed optimization).-gitpython-developers/gitdb#93 (same)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ByronByronByron approved these changes

Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@EliahKagan@Byron

[8]ページ先頭

©2009-2025 Movatter.jp