Skip to content
This repository was archived by the owner on Mar 18, 2022. It is now read-only.

Extend support for Python version validation #21

Merged
merged 2 commits into from
Feb 9, 2017
Merged

Conversation

agjohnson
Copy link
Contributor

  • Allow for python supported versions to be passed into the config object. This
    is required to pass in per-build environment python versions for validation
  • More validation on lists
  • Don't handle strings as iterables in choice validation
  • Coerce Python verion to an int/float if possible

Refs readthedocs/readthedocs-docker-images#18

* Allow for python supported versions to be passed into the config object. This
  is required to pass in per-build environment python versions for validation
* More validation on lists
* Don't handle strings as iterables in choice validation
* Coerce Python verion to an int/float if possible
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@@ -149,6 +149,19 @@ Following mapping keys are supported (all but the marked once are optional):
The path in which ``python setup.py install`` will be executed.
Defaults to the repository root.

``version``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems weird there's an example here that doesn't include the actual version object that it's documenting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be moved into docs on the actual config object, as it's not important for the spec. None of the elements have an example currently, so I don't think one is necessarily warranted here yet. I could see overhauling this doc to include more information eventually however.

@@ -78,6 +78,8 @@ class BuildConfig(dict):
PYTHON_EXTRA_REQUIREMENTS_INVALID_MESSAGE = (
'"python.extra_requirements" section must be a list.')

PYTHON_SUPPORTED_VERSIONS = [2, 2.7, 3, 3.3, 3.4, 3.5, 3.6]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to support <3.5?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be agnostic to what versions we actually support, this is just checking for valid version numbers ATM. This decision should be left up to our implementation on RTD, i think.

@agjohnson
Copy link
Contributor Author

Failing tests are #22, won't fix them here.

@agjohnson agjohnson merged commit 83f7f21 into master Feb 9, 2017
@agjohnson agjohnson deleted the extend-py-version branch February 9, 2017 03:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants