Skip to main content

Locker of dependency files for deploy in docker and etc.

Project description

DEPLODOCKER


PyPI version


Why?

Poetry and others python dependency managers has no cozy interface to communicate with requirements. Some of them has no methods for export extras or extras without main requirements. Some of them has no possibilities to use another format excluding requirements.txt. This project aims to fix this problem.

FROM python:3.8-alpine AS base
RUN apk update

FROM base AS locker
ADD pyproject.toml .
RUN poetry lock
RUN deplodocker poetry.lock -i poetry -o requirements.txt -d requirements.txt \
    && deplodocker poetry.lock -i poetry -o requirements.txt -d requirements-main.txt -s main \
    && deplodocker poetry.lock -i poetry -o requirements.txt -d requirements-dev.txt -s dev \
    && deplodocker poetry.lock -i poetry -o requirements.txt -d requirements-raw.txt -s raw \
    && deplodocker poetry.lock -i poetry -o requirements.txt -d requirements-binary.txt -s binary \
    && deplodocker poetry.lock -i poetry -o requirements.txt -d requirements-debug.txt -s debug

FROM base AS builder_raw
COPY --from=locker /requirements-raw.txt .
### ...

FROM base AS builder_binary
COPY --from=locker /requirements-binary.txt .
### ...

Basic usage

>>> deplodocker --help
Usage: deplodocker [OPTIONS] [SRC]

  Select lock file to work with or use stdin as source

Options:
  -d, --dst FILENAME        result file [default=stdout]
  -i, --input-format TEXT   format of input lock file [default=poetry]
  -o, --output-format TEXT  format of output file [default=requirements.txt]
  -s, --section TEXT        Section of lock file (multiple) [default=<all>]
  --help                    Show this message and exit.
>>> deplodocker poetry.lock
### MAIN
click==7.1.2
toml==0.10.2
### DEV
appdirs==1.4.4
atomicwrites==1.4.0
attrs==20.3.0
black==20.8b1
...
### SPEEDUPS
orjson==3.4.3
>>> deplodocker poetry.lock -i poetry -o yaml -s main
    main:
      click: 7.1.2
      toml: 0.10.2
>>> deplodocker poetry.lock -i poetry -o json
{"main":{"click":"7.1.2","toml":"0.10.2"},"dev":{"appdirs":"1.4.4","atomicwrites":"1.4.0","attrs":"20.3.0","black":"20.8b1","cfgv":"3.2.0","colorama":"0.4.4","coverage":"5.3","distlib":"0.3.1","filelock":"3.0.12","identify":"1.5.9","iniconfig":"1.1.1","isort":"5.6.4","mypy-extensions":"0.4.3","nodeenv":"1.5.0","packaging":"20.4","pathspec":"0.8.0","pluggy":"0.13.1","pre-commit":"2.8.2","py":"1.9.0","pyparsing":"2.4.7","pytest":"6.1.2","pytest-cov":"2.10.1","pyyaml":"5.3.1","regex":"2020.10.28","six":"1.15.0","typed-ast":"1.4.1","typing-extensions":"3.7.4.3","virtualenv":"20.1.0"},"speedups":{"orjson":"3.4.3"}}

Also you can use stdin as input and choose destination file trough arguments

>>> cat poetry.lock | deplodocker poetry.lock -d requirements.json -i poetry -o json

Buy Me A Coffee

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deplodocker-0.2.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

deplodocker-0.2.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file deplodocker-0.2.1.tar.gz.

File metadata

  • Download URL: deplodocker-0.2.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.9.3-1-MANJARO

File hashes

Hashes for deplodocker-0.2.1.tar.gz
Algorithm Hash digest
SHA256 704c9507b65b68b15088beb71bf6b72f7d4de99b7e7396240bf311bb8e3e0512
MD5 f1a98724aa996f7384a2c581c9718b37
BLAKE2b-256 cf2b21228186cb918a6fb91635357e9da46dce90fd78de0736fd7974d6192035

See more details on using hashes here.

File details

Details for the file deplodocker-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: deplodocker-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.9.3-1-MANJARO

File hashes

Hashes for deplodocker-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2196bf7ea2cc9a84966f414d3f5969be6bf06167f8626d7762102a9c935a4e56
MD5 e47058b61553e43dc99c09a5e71f3c47
BLAKE2b-256 fe54c4877cce8d4d7a2e431bcb8606f08678b195eaebd66579f4bcaeeb3ebc96

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page