From 012845699c88f44d10ce251de57739d1a9829459 Mon Sep 17 00:00:00 2001 From: Petr Laitoch Date: Fri, 10 Jan 2020 17:58:18 +0100 Subject: [PATCH 1/3] Add command-line option to alse install dev-packages from pipenv. --- lambdipy/cli.py | 6 ++++-- lambdipy/project_build.py | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lambdipy/cli.py b/lambdipy/cli.py index bfcd109..2b30b42 100644 --- a/lambdipy/cli.py +++ b/lambdipy/cli.py @@ -41,13 +41,15 @@ def version(): @cli.command() @click.option('--from-pipenv', '-p', is_flag=True, help='Build dependencies from Pipfile.lock') +@click.option('--dev', '-d', is_flag=True, help='If dependencies are built from Pipfile.lock, include development ' + 'dependencies as well.') @click.option('--include', '-i', multiple=True, help='Include these paths in the final build') @click.option('--keep-tests', '-t', multiple=True, help='Exclude deletions of tests for these packages') @click.option('--no-docker', '-x', is_flag=True, help='Do not use Docker for package build (lambdipy itself runs in ' 'lambci/lambda:build-python{PYTHON_VERSION} container)') -def build(from_pipenv, include, keep_tests, no_docker): +def build(from_pipenv, dev, include, keep_tests, no_docker): if from_pipenv: - requirements = parse_requirements(get_requirements_from_pipenv()) + requirements = parse_requirements(get_requirements_from_pipenv(dev)) else: requirements = parse_requirements(open('requirements.txt').read()) diff --git a/lambdipy/project_build.py b/lambdipy/project_build.py index 1448510..25445a9 100644 --- a/lambdipy/project_build.py +++ b/lambdipy/project_build.py @@ -33,8 +33,12 @@ def __init__(self, requirement, potential_candidates): self.potential_candidates = potential_candidates -def get_requirements_from_pipenv(): - with os.popen("pipenv lock -r") as pipenv_subprocess: +def get_requirements_from_pipenv(dev): + if dev: + command = "{ pipenv lock --dev -r & pipenv lock -r; }" + else: + command = "pipenv lock -r" + with os.popen(command) as subprocess: return pipenv_subprocess.read() From 14ab2b963cd89481e45ebffe9a8709bc43c6d8d7 Mon Sep 17 00:00:00 2001 From: Petr Laitoch Date: Fri, 10 Jan 2020 18:09:17 +0100 Subject: [PATCH 2/3] typo-in-code fix --- lambdipy/project_build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lambdipy/project_build.py b/lambdipy/project_build.py index 25445a9..23d9e7d 100644 --- a/lambdipy/project_build.py +++ b/lambdipy/project_build.py @@ -38,7 +38,7 @@ def get_requirements_from_pipenv(dev): command = "{ pipenv lock --dev -r & pipenv lock -r; }" else: command = "pipenv lock -r" - with os.popen(command) as subprocess: + with os.popen(command) as pipenv_subprocess: return pipenv_subprocess.read() From acf51f66bd5cfb241bb6fd378db9d20a57cd14ba Mon Sep 17 00:00:00 2001 From: Petr Laitoch Date: Tue, 14 Jan 2020 16:53:03 +0100 Subject: [PATCH 3/3] bump version --- lambdipy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lambdipy/__init__.py b/lambdipy/__init__.py index aa4e5a0..cc4b294 100644 --- a/lambdipy/__init__.py +++ b/lambdipy/__init__.py @@ -1 +1 @@ -__version__ = 'v0.1.1' +__version__ = 'v0.1.2'