Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide sample code for a very basic client #17

Closed
pfmoore opened this issue Jun 19, 2020 · 7 comments
Closed

Provide sample code for a very basic client #17

pfmoore opened this issue Jun 19, 2020 · 7 comments
Labels
type: task Something that needs to be done that is not a bug or feature

Comments

@pfmoore
Copy link
Member

pfmoore commented Jun 19, 2020

I'm finding it hard to understand how the library would be used in practice. In the longer term, this will be covered by the documentation. But for early adopters, having an example of the intended use would be really helpful.

Could an examples directory be added with a very basic client that takes a wheel file and extracts it? I'd go for:

  1. Wheel filename given on the command line
  2. Options for destinations to unpack to (I'd specifically like the example to not use sysconfig or anything that hides the question of "what locations do I need to support" behind what a given Python installation provides).

Including notes about what isn't supported, compared to something like pip (hash checking? script wrappers?) with a brief note describing how clients would typically implement these, would give a much better feel for the scope of the library, as well.

(My personal concern here is that writing script wrappers is out of scope, but it will be hard for clients to implement without assistance to identify what scripts need writing. I'd like to have sample code that offers a concrete example of how that would play out in reality).

@FFY00
Copy link
Member

FFY00 commented Jun 19, 2020

For the already merged code, you can find an example here. For #9 you have this. When #16 gets merged I will refactor to use it.

@pfmoore
Copy link
Member Author

pfmoore commented Jun 19, 2020

Thanks - although I'm slightly confused as none of that code seems to import this project. So I'm not entirely sure how it relates to what I asked about?

@FFY00
Copy link
Member

FFY00 commented Jun 19, 2020

Sorry, I should have linked directly to the lines in question.

https://github.com/FFY00/python-install/blob/bc4aa39e16b0445bc7f023faafffdc857c592450/install/__init__.py#L103

https://github.com/FFY00/python-install/blob/77006d8a254f9a724c33d03cfc247c93e99bc5a5/install/__init__.py#L97

Right now the library only provides two things, entry point script generation and record parsing (+ validation with my PR). It is pretty minimal, but the usage is shown in that code. #16 will implement the actual install functionality.

@pfmoore
Copy link
Member Author

pfmoore commented Jun 19, 2020

Ah, sorry. I did skim for local imports, but missed these.

I'm still a great fan of having a bare-bones usage in an example directory in the repo, but your links are useful as a real-world case.

@FFY00
Copy link
Member

FFY00 commented Jun 19, 2020

I agree 😄.

@pradyunsg
Copy link
Member

I'm still a great fan of having a bare-bones usage in an example directory in the repo, but your links are useful as a real-world case.

As noted in #1, the plan is to provide basic implementations of the abstractions, which can actually be used by end users. They'll be importable (instead of sitting in examples/).

Right now, my plan is (1) WheelSource from a local .whl file and (2) Destination based on a dictionary of a {scheme: dir}. These should be enough to cover the "most basic use case", of taking a local wheel file and installing it, without needing to define your own WheelSource/Destination.

@pradyunsg pradyunsg added the type: task Something that needs to be done that is not a bug or feature label Apr 18, 2021
@pradyunsg
Copy link
Member

Closing, since this is now provided in the documentation, hosted at https://installer.readthedocs.io/en/latest/.

(yes, there's a misnamed object in the example; I've fixed that as part of writing the rest of the documentation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task Something that needs to be done that is not a bug or feature
Projects
None yet
Development

No branches or pull requests

3 participants