nteract / bookstore

📚 Notebook storage and publishing workflows for the masses
https://bookstore.readthedocs.io
BSD 3-Clause "New" or "Revised" License
202 stars 23 forks source link

Add version check and tests #91

Closed willingc closed 5 years ago

mpacer commented 5 years ago

Is this primarily to get us bootstrapped into having more tests in bookstore? Otherwise, could you say where we expect the version check to be used outside of the tests?

Note: if we were going to implement something pep440 checking (like what we have in nbconvert)… I could definitely see the criticality for having this kind of version number check.

for reference nbconvert has a utility create_valid_version https://github.com/jupyter/nbconvert/blob/06f3a90f6b7b578a78efe1f17138a4fea43fcfa5/nbconvert/_version.py#L5-L60

def create_valid_version(release_info, epoch=None, pre_input='', dev_input=''):
    '''
    Creates a pep440 valid version of version number given a tuple integers
    and optional epoch, prerelease and developmental info.
    Parameters
    ----------
    release_info : Tuple(Int)
    epoch : Int, default None
    pre_input : Str, default ''
    dev_input : Str, default ''
    '''
willingc commented 5 years ago

This was mostly to get us started. We can either close or merge. No strong preference either way.