Specifying semver-like version ranges on environment.yml

162 views
Skip to first unread message

Pedro Santa

unread,
Dec 3, 2021, 9:23:38 PM12/3/21
to conda - Public
Hello,

I haven't been using Python and hadn't had contact with the eco system for some years now—last years I've been mostly on Node, JS Front-end, PHP and WP eco systems.

I want to pin a version on my environment.yml file but in a way that, considering semantic versioning, updates patch and minors, but doesn't update major version—similar to what I would accomplish with a caret range on NodeJS/npm package.json, as such: https://github.com/npm/node-semver#caret-ranges-123-025-004

I know we can use wildcard on environment.yml, but it's not working as such. How can I achieve the same as a Node/npm caret like range on the dependencies?

Cheers, all the best.

Pedro Machado Santa

Chris Barker

unread,
Dec 3, 2021, 10:06:13 PM12/3/21
to Pedro Santa, conda - Public
Not sure what npm does, but is this what you want?

package<4
or
package<4.2
or
package>3,<4

(I'm not totally sure about the last one's syntax, but you can certainly do this kind of thing one way or another.

- CHB




--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@anaconda.com.
To view this discussion on the web visit https://groups.google.com/a/anaconda.com/d/msgid/conda/175fd30e-f791-427f-9bb0-ecbd24755ed3n%40anaconda.com.


--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

Shaun Walbridge

unread,
Dec 4, 2021, 2:41:43 PM12/4/21
to Chris Barker, Pedro Santa, conda - Public
The package specifications should be of help:


You can achieve the desired contstraint a few ways, with the requirements more aligned with PEP 440 and Python versioning.

Cheers,
Shaun

Chris Barker

unread,
Dec 4, 2021, 2:47:14 PM12/4/21
to Shaun Walbridge, Pedro Santa, conda - Public
On Sat, Dec 4, 2021 at 11:41 AM Shaun Walbridge <shaun.w...@gmail.com> wrote:
Thanks -- somehow I never found that in the past. And here's the direct link to the relevant section:


-CHB

Pedro Santa

unread,
Dec 5, 2021, 11:57:53 AM12/5/21
to conda - Public, chris....@noaa.gov, Pedro Santa, conda - Public, shaun.w...@gmail.com
Thanks for the link Shaun, exactly what I was looking for.

Cheers.

Pedro MS

Reply all
Reply to author
Forward
0 new messages