sarugaku / passa

Resolver implementation and toolset for generating and interacting with Pipfile and Pipfile.lock.
ISC License
53 stars 12 forks source link

Add tests #57

Open techalchemy opened 5 years ago

techalchemy commented 5 years ago

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

techalchemy commented 5 years ago

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

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

uranusjr commented 5 years ago

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.

techalchemy commented 5 years ago

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 commented 5 years ago

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?

uranusjr commented 5 years ago

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

uranusjr commented 5 years ago

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

techalchemy commented 5 years ago

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