Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from customink/pl/dev_packages
Browse files Browse the repository at this point in the history
Dev-package CLI option
  • Loading branch information
Petr Laitoch authored Jan 14, 2020
2 parents a24479c + acf51f6 commit c9a72ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lambdipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = 'v0.1.1'
__version__ = 'v0.1.2'
6 changes: 4 additions & 2 deletions lambdipy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
8 changes: 6 additions & 2 deletions lambdipy/project_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 pipenv_subprocess:
return pipenv_subprocess.read()


Expand Down

0 comments on commit c9a72ab

Please sign in to comment.