-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
Pipenv Support #140
Comments
Hi, so far I haven't used it. Supporting it would mean to provide a basic |
I think it's a little more than that. Adding a Happy to provide a PR if you can direct me to the best way to deal with this. |
@sbeleidy, and don't think that setup.py should read the requirements from |
@FlorianWilhelm - I think I'm a little confused. If your package has dependencies, you are setting those in setup.cfg? Do you have an example of that? I thought it would read the requirements.txt and add those packages. |
Sure, this behaviour was changed in version 3.0 of PyScaffold. As you can see in this configuration example there is a key The Maybe @HolgerPeters, @sebastianneubauer or @dhepper are more experienced with |
I think the best bet at the moment is to do double book keeping for To sum it up, I would go about this as follows:
I'd like to add that |
@sbeleidy Has this helped your understanding? One could still add a default |
@HolgerPeters do you mind to clarify me some extra bits? For example: isn't the difference you have described exactly the point of having the Theoretically, the library developer could put the minimal requirements in the |
The problem that I see with double bookkeeping is that it scales very fast... Right now for example, I am having some trouble because I have to keep the test requirements in sync in the The advantage of pip-tools, is that it is backwards compatible and therefore supported out-of-the box by tools like tox. So in the context of the example I was describing, if PyScaffold could support reading the test requirements from the The same thing for the regular dependencies: PyScaffold could read And if someone would like to have special dependencies for some corner use cases, that person could add a third |
Well, I did some research about how to achieve "single source of truth" while using tools like Pipenv and tox. The best practices I could find so far are:
(But the second practice can break |
Hi @FlorianWilhelm, please find bellow my current proposal: SummaryThis proposal is a pragmatic compromise that enables developers to use tools (e.g.
MotivationPyScaffold aims the development of Python projects that can be easily packaged and distributed using the standard PyPI and
Both approaches have advantages and disadvantages, and usually are used together in different phases of a project. For more information about this topic check this post. Several tools have being used to manage the concrete vs abstract requirements scenario, among them very popular ones are: Additionally, The proposal is to accept the current limitations of all the mentioned tools, but create a workflow that, although imperfect, can handle the vast majority of the use cases (with some user understanding). Detailed SolutionThe current limitations and workarounds considered are:
Therefore, we can split the problem in 3 main components:
Note that:
For problem 1, the best solution is to use For problem 2, we completely ignore
Although these arguments are a little bit weak, they make some sense, and, as far as pragmatism goes, this drawback is an acceptable price to be paid for reasonable defaults. For problem 3, we can just use the concrete requirements management tools, since the testing and packaging environment should be agnostic to dev-only tools. Therefore, the proposed workflow is:
The repository abravalheri/dummy-pipenv-example-for-pyscaffold is a proof of concept, and presents a project where this methodology is applied (see branches Migration plan
How do we teach this?As mentioned in the previous section, we should add documentation about how to use Optionally, we can have a DrawbacksWith this approach we completely ignore Moreover, since both AlternativesThere are other tools for packaging and venv management mentioned in the Python Packaging Guide and in some articles, and in this case a different research would be required. But I would prefer sticking with PyPA... We can also just choose one ( |
@abravalheri First of all, thanks for this great proposal, I have never seen something like this in a Github issue discussion before. It's on the same level of quality and detail as a PEP. Overall I think this is a really good and pragmatic approach that we should follow for a version 4.0 respecting Semantic Versioning. Regarding the drawbacks of not using the Your migration sounds also like a great fit for those changes. Regarding I am also not sure right now if we should have a One thing I am 100% sure about is that we should no longer generate a Anyways, let's move further into this direction. I guess it's best to keep it in a separate |
Remove the double book keeping between tox and pytest-runner dependencies, using the technique documented in pyscaffold#140. Not that this commit just change the test-dependency management in PyScaffold itself, not in the generated projects (no change in the public API).
Remove the double book keeping between tox and pytest-runner dependencies, using the technique documented in pyscaffold#140. Not that this commit just change the test-dependency management in PyScaffold itself, not in the generated projects (no change in the public API).
Remove the double book keeping between tox and pytest-runner dependencies, using the technique documented in #140. Not that this commit just change the test-dependency management in PyScaffold itself, not in the generated projects (no change in the public API).
Hi @FlorianWilhelm, thank you very much for your comments. One thing that might be not clear yet is that I believe we can do the steps 1-4 of the migration plan already for the new minor version of PyScaffold, without having to wait for Basically, in my opinion, we don't break any documented behaviour (in other words: Instead of warnings, we could add comments on top of Regarding creating extensions for the tools themselves, I believe that, for now, if PyScaffold is compatible out-of-the-box with both, and provides good documentation about how to adopt them, it might be already a good improvement. We can monitor the interest of the community and hold the decision, or even adopt under the PyScaffold organization extensions that might eventually appear. But of course, if we see in this topic an opportunity to incentivise good practices and decide to do something soon, I would go for an extension (the less files under the same git repo, the easier is to have contributions/maintain/evolve) and say we try Pipenv first (basically because it is promoted by PyPA, so the chances of becoming a de facto standard are very high). Finally, regarding the roadmap, maybe we can try to avoid the fragmentation between the versions. For |
@abravalheri, you got some very good points. I also like your solution with adding a comment into Also thumps up for a Pipenv extension that is recommended in PyScaffold's documentation. I see only one thing we got to consider. While we are preparing the v3.1 release and update the documentation we got to make sure that the displayed default documentation is still one that is compatible with the current v3.0.x release. Maybe it's best to create a |
@FlorianWilhelm, it seems that RTD already do this job for us... as long as we don't create any tagged release, the documentation for the stable version will be the one pointing to the latest tag. Seems to be pretty straightforward to me. |
Is this issue solved by #188? (In theory with that PR, PyScaffold does support if the user wants to use Pipenv, despite not generating the Pipfile itself) |
With the added docs about dependency management I think this could be closed. Adding a dummy |
Sounds fair to me! Before v3.1 I would like just to mark this feature as experimental in the docs (since Pipenv is moving fast and probably breaking things while still trying to figure out an stable API, it is best to not commit so soon). |
Sorry for the delay. I think with #209 we can finally close this issue, without fear of breaking changes in the future. |
@abravalheri, thanks! Great, another issue moving to done :-) |
Are there any plans to support pipenv?
The text was updated successfully, but these errors were encountered: