passa icon indicating copy to clipboard operation
passa copied to clipboard

Add tests

Open techalchemy opened this issue 5 years ago • 7 comments

Another piece of #55 plus #56 (2/4)

techalchemy avatar Sep 27 '18 05:09 techalchemy

@uranusjr I think this can use a look, the PR says it is adding tests but there is a bit more going on -- significantly

  • There is some refactor code bleeding over since I believe I missed a commit or two on my rebase of the other PR (which is merged now) -- you will likely want to look that over at some point, I am pretty confident you will find some abstractions you want to do there when you have time anyway
  • There are some more serious changes which introduce fixes for things uncovered in test breakages / additional functionality which was missing before including:
    • Finalized implementation of Sdist resolution using the fallback metadata discovery you implemented as a wheel building failover
    • Actual installation of sdists, but invoking setup.py directly in a subprocess call which seems to be a bit more reliable assuming we have prepared the requirement
    • Note that once we can sort out the details in this PR, the next PR I will take a look at and clean up will be #58 which has these implementations split out into external packages already (you are a full owner on those)
    • I.e. if we can sort out how this should work, we can then make sure it aligns with the other libraries and just cut it out from here for now
  • The main change is to the structure of what was the WheelInstaller class, which now ultimately lands in the Installer class -- there are a few reasons for that change, but largely it's because wheels need a way to try to install themselves as sdists if they fail in wheel form (I think the base class isn't named properly but that can be fixed)

Also note I have a venv argument going around in a lot of places to make this virtualenv aware, it seems kind of important that we have some way of being aware of that but the approach I took is mainly for installation and will be able to live specifically in the installer package. If you have some thoughts about the implementation I am interested in that for sure.

I have no real comments about the tests other than that they work, they use the virtualenv library I set up specifically for this purpose, we have about 65% code coverage (but not very thorough edge case testing) with this setup.

Sorry for the long comments, but there is a lot of effort into the PRs and I know you're kind of busy, so I wanted to have things somewhat cleaned up before dragging you into it. Happy to hold off merging anything that will introduce substantial changes until you can give it a good look over

techalchemy avatar Oct 03 '18 05:10 techalchemy

Most of the things seem good to me (I didn’t read the changes to .gitignore; I assume they come from GitHub’s recommendation or somewhere). However, I don’t feel comfortable Passa needs to depend on Mork. I still intend Passa to be run strictly inside the target environment, and virtual environment management does not belong here. It is fine to have the ability to install into an environment different from the one Passa is run in, but that should be provided by the user (e.g. a custom prefix than sys.prefix) instead.


Edit: I read my comments again, and felt my wording is a bit off. The VenvInstaller feature is good in general, but I don’t like that it hard-depends on Mork, and Mork hard-depends on virtualenv. Pass should not require virtualenv.

uranusjr avatar Oct 03 '18 13:10 uranusjr

I don’t feel comfortable Passa needs to depend on Mork. I still intend Passa to be run strictly inside the target environment, and virtual environment management does not belong here.

Agreed -- the plan is in the next PR to refactor that out into the other 2 libraries. Also it's an extra here I think? But I also like the ability to just specify a prefix

techalchemy avatar Oct 04 '18 00:10 techalchemy

the project should just take an abstract idea of an “environment”

I felt this way the entire time I was working on this but I wasn't sure exactly how that should look. Separate class?

techalchemy avatar Oct 04 '18 00:10 techalchemy

I feel a separate class would be best, or maybe a dict like what distlib.wheel accepts when it installs the wheel.

uranusjr avatar Oct 04 '18 09:10 uranusjr

I think mork lists virtualenv in install_requires, but it is not in extra, so virtualenv will still be unconditionally installed.

uranusjr avatar Oct 04 '18 09:10 uranusjr

Refactoring out the virtualenv stuff as is and trying to make an abstraction that handles any environment based on a prefix / set of paths is not really workable so far, everything works except for uninstalling and that is even after I patched uninstallation. Considering I am just going to remove this in the next PR I'm not totally sure it's worth holding the whole thing up over it, I can just combine the two (that is, split out the other two packages along with these changes) if you like

techalchemy avatar Oct 05 '18 06:10 techalchemy