Skip to content

Pipfile support (schema) #4782

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

Merged
merged 5 commits into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion readthedocs/rtd_tests/fixtures/spec/v2/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ python:
system_packages: bool(required=False)

# Installation of packages and requiremens
install: list(any(include('python-install-requirements'), include('python-install')), required=False)
install: list(any(include('python-install-requirements'), include('python-install'), include('python-install-pipfile')), required=False)

python-install-requirements:
# The path to the requirements file from the root of the project
Expand All @@ -77,6 +77,22 @@ python-install:
# Default: []
extra_requirements: list(str(), required=False)

python-install-pipfile:
# The path to the project to be installed
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be,

The path to the directory that contains the Pipfile to use

since the project is not going to be installed, but all the dependencies on the Pipfile.

pipfile: path()

# Add the --dev option to pipenv install
# Default: false
dev: bool(required=False)

# Add the --ignore-pipfile option to pipenv install
# Default: true
ignore_pipfile: bool(required=False)

# Add the --skip-lock option to pipenv install
# Default: false
skip_lock: bool(required=False)

sphinx:
# The builder type for the sphinx documentation
# Default: 'html'
Expand Down
48 changes: 47 additions & 1 deletion readthedocs/rtd_tests/tests/test_build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def test_python_install_extra_requirements(tmpdir):


@pytest.mark.parametrize('value', ['', 'null', '[]'])
def test_python_extra_requirements_empty(tmpdir, value):
def test_python_install_extra_requirements_empty(tmpdir, value):
content = '''
version: "2"
python:
Expand All @@ -330,6 +330,52 @@ def test_python_extra_requirements_empty(tmpdir, value):
assertValidConfig(tmpdir, content.format(value=value))


def test_python_install_pipfile(tmpdir):
content = '''
version: "2"
python:
install:
- pipfile: .
'''
assertValidConfig(tmpdir, content)


@pytest.mark.parametrize('value', [True, False])
def test_python_install_pipfile_dev(tmpdir, value):
content = '''
version: "2"
python:
install:
- pipfile: .
dev: {value}
'''
assertValidConfig(tmpdir, content.format(value=value))


@pytest.mark.parametrize('value', [True, False])
def test_python_install_pipfile_skip_lock(tmpdir, value):
content = '''
version: "2"
python:
install:
- pipfile: .
skip_lock: {value}
'''
assertValidConfig(tmpdir, content.format(value=value))


@pytest.mark.parametrize('value', [True, False])
Copy link
Member

Choose a reason for hiding this comment

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

True and False shouldn't be true and false since it's a YAML file?

Other tests use true and false, which I think it's correct.

def test_python_install_pipfile_ignore_pipfile(tmpdir, value):
content = '''
version: "2"
python:
install:
- pipfile: .
ignore_pipfile: {value}
'''
assertValidConfig(tmpdir, content.format(value=value))


@pytest.mark.parametrize('value', ['true', 'false'])
def test_python_system_packages(tmpdir, value):
content = '''
Expand Down