Skip to content

Comments

Some extensions to acceptable specs#8

Closed
autopulated wants to merge 1 commit intorbarrois:masterfrom
autopulated:master
Closed

Some extensions to acceptable specs#8
autopulated wants to merge 1 commit intorbarrois:masterfrom
autopulated:master

Conversation

@autopulated
Copy link

Allow 'any version' spec *, allow versions as specs (equivalent to ==), and allow single equals (equivalent to ==).

These are pragmatic changes to make it easier to work with version specifications that use "*" to mean any version, and "1.2.3" or "=1.2.3" to mean "==1.2.3".

…w versions as specs (equivalent to ==), and allow single equals (equivalent to ==)
@autopulated
Copy link
Author

What's the likelihood of merging this?

@rbarrois
Copy link
Owner

Hi @autopulated !

The idea is interesting, but I've got a couple of questions:

  • the "* for any" is a good idea, I'll add it.
  • For the = equivalent to ==, this could be done directly with Spec, or performed through a Spec.coerce(...) method
  • For the 0.1.0 means ==0.1.0, I don't want to add it directly to Spec("0.1.0"), as that would cause some unneeded confusion with Version. I don't see a problem adding it to Spec.coerce(), though.

Would using Spec.parse(..., coerce=True) or Spec.coerce("=1.2.0") work with the API you'd expect to use in your use case?

@autopulated
Copy link
Author

I actually want a "strict" specification that accepts them – so coerce doesn't work for me, but I could achieve everything apart from * using a subclass that just preprocesses the strings in init, so no pressure to merge the other stuff.

@rbarrois rbarrois closed this in 9e88ed9 Mar 16, 2014
@rbarrois
Copy link
Owner

I've just added the support for '*', I'll let you handle the other versions in your subclass.

@autopulated
Copy link
Author

Cool, that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants