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

Some extensions to acceptable specs #8

Closed
wants to merge 1 commit into from

Conversation

@autopulated
Copy link

commented Feb 11, 2014

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".

Some extensions to acceptable specs: allow 'any version' spec *, allo…
…w versions as specs (equivalent to ==), and allow single equals (equivalent to ==)
@autopulated

This comment has been minimized.

Copy link
Author

commented Feb 27, 2014

What's the likelihood of merging this?

@rbarrois

This comment has been minimized.

Copy link
Owner

commented Feb 27, 2014

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

This comment has been minimized.

Copy link
Author

commented Feb 28, 2014

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

This comment has been minimized.

Copy link
Owner

commented Mar 16, 2014

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

@autopulated

This comment has been minimized.

Copy link
Author

commented Mar 19, 2014

Cool, that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.