-
Notifications
You must be signed in to change notification settings - Fork 32
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
Questions about package pinning #697
Comments
@martinholmer Thanks for posting this. You offer compelling reasons for not pinning a package. Hopefully, after merging PR #688, we will not have to pin to a specific bokeh version. Further, I think this is another example of a quality teaching or best-practices post. Another one that quickly comes to mind is @talumbau 's post on the requests library and posting data through a user interface to a website. I think it would be useful to have these aggregated in one place as an engineer's blog or something like that. Facebook has one that is fun to check out. These blog posts would be created organically from especially informative comments and threads here. So, the cost wouldn't be much higher than writing the comment itself. |
@hdoupe said in the discussion of issue #697:
I think the blog idea is great. See if @MattHJensen agrees and, if so, discuss with him how the blog should be built and maintained. |
Thanks for the informative post @martinholmer. PolicyBrain certainly has an exact pinning problem. A review of what is installed on PolicyBrain and what version restrictions are used is definitely in order. |
Closed #697 |
At the end of the discussion of merged pull request #687, @MattHJensen asked this question:
Let's call
package==x.y.z
exact pinning and callpackage>=x.y.z
at-least pinning.Ideally, the
conda.recipe/meta.yaml
for a project would contain a list of packages required for the project in which none of the packages were pinning in either way.Why would we ever introduce at-least pinning for a package?
As far as I can see, there is one and only one reason: the project relies on a feature that was first introduced in the A.B.C version of that package. All package versions before A.B.C do not have the feature required by the project. In this case, it makes sense to use at-least pinning, and so the specification of the package would be
package>=A.B.C
.Why would we ever introduce exact pinning for a package?
In my view, there is never a good reason to use exact pinning. This view is based on observation of other projects and on our experience with exact pinning in the Tax-Calculator project. Here are several reasons for why exact pinning is a bad idea:
pandas
package and you will see only at-least pinning. And here is a fragment of theconda.recipe/meta.yaml
file in the bokeh repository. Notice the bokeh project depends onnumpy
but can use any version. In the above list onlynodejs
andtornado
are at-least pinned (and no required packages are exact pinned). Thenodejs
package is pinned to>=6.10.0
even though the current version ofnodejs
is 8.6.0. Thetornado
package is pinned to>=4.3
even though the current version oftornado
is 4.5.2.Exact pinning hides poor programming practices. When a new version of
numpy
became available recently, we discovered two mistakes in our Tax-Calculator code --- see PR1470 and PR1473 ---that would have never been found if we had been exact pinning to older versions of those packages. Another example in the PolicyBrain project is the generalizations made in PR Adding dynamic CDNs for the widgets #688 after the availability of
bokeh 0.12.9
revealed less than general code.Exact pinning prevents a project from benefiting from package improvements. For example, even though it took some time to fix the bugs revealed by the new version of
numpy
, using the newnumpy
version (and thepandas
version that used it) caused the Tax-Calculator to execute almost twice as fast as when we used the older versions.Exact pinning will eventually prevent package creation for the project. This is the most severe problem with exact pinning and it was experienced by the Tax-Calculator project. In the past, Tax-Calculator used exact pinning and as a result eventually a conda taxcalc package for Python 3.6 could not be built. This was because the versions of
numpy
andpandas
being used by Tax-Calculator were so old that Python 3.6 did not support them. Only after we switched from exact pinning to at-least pinning were we able to build taxcalc packages for Python 3.6. For another, more recent, example of this same problem, look at Tax-Calculator pull request 1587.@MattHJensen @hdoupe @GoFroggyRun
The text was updated successfully, but these errors were encountered: