Last active
May 4, 2022 14:02
-
-
Save diegoquintanav/df62503eebb058818554eb768bf93f5c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.3" | |
services: | |
backend: | |
tty: true | |
image: "${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}" | |
env_file: | |
- .env | |
volumes: | |
- ./project:/project/ | |
build: | |
context: ./project/ | |
dockerfile: Dockerfile | |
args: | |
PYPI_USER: ${PYPI_USER?Variable not set} | |
PYPI_PASS: ${PYPI_PASS?Variable not set} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.9 | |
# passed from docker-compose.services.service.env_file | |
ARG PIPY_USER | |
ARG PIPY_PASS | |
ENV PIP_NO_CACHE_DIR off | |
ENV PIP_DISABLE_PIP_VERSION_CHECK on | |
ENV PIP_DEFAULT_TIMEOUT 100 | |
ENV POETRY_HOME /opt/poetry | |
ENV VENV_PATH /opt/venv | |
ENV POETRY_VERSION 1.1.13 | |
ENV POETRY_HTTP_BASIC_PYPI_USERNAME $PYPI_USER | |
ENV POETRY_HTTP_BASIC_PYPI_PASSWORD $PYPI_PASS | |
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" | |
RUN apt-get update \ | |
&& apt-get install --no-install-recommends -y \ | |
# deps for installing poetry | |
curl \ | |
# deps for building python deps | |
build-essential \ | |
\ | |
# install poetry - uses $POETRY_VERSION internally | |
&& curl -sSL https://install.python-poetry.org | python3 - \ | |
&& poetry --version \ | |
\ | |
# configure poetry & make a virtualenv ahead of time since we only need one | |
&& python -m venv $VENV_PATH \ | |
&& poetry config virtualenvs.create false | |
# start adding project | |
# Copy poetry.lock* in case it doesn't exist in the repo | |
COPY ./pyproject.toml ./poetry.lock* /project/ | |
# Install dependencies | |
WORKDIR /project/ | |
RUN python -c "import os, sys; print(f'{os.path.dirname(sys.executable)=}')" | |
RUN poetry install --no-root | |
# Install project | |
COPY . /project/ | |
RUN poetry install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.poetry] | |
authors = ["Admin <[email protected]>"] | |
description = "" | |
name = "app" | |
version = "0.1.0" | |
[tool.poetry.dependencies] | |
python = "^3.9" | |
mylib = { version = "^1.7.0", source = "myrepo" } | |
seaborn = "^0.11.2" | |
numpy = "^1.22.3" | |
pandas = "^1.4.2" | |
matplotlib = "^3.5.2" | |
typer = {extras = ["all"], version = "^0.4.1"} | |
[tool.poetry.dev-dependencies] | |
black = "^22.3.0" | |
flake8 = "^4.0.1" | |
isort = "^5.10.1" | |
pytest = "^7.1.2" | |
[[tool.poetry.source]] | |
name = "myrepo" | |
url = "https://pypi.myrepo.org/simple/" | |
secondary = true | |
[build-system] | |
build-backend = "poetry.core.masonry.api" | |
requires = ["poetry-core>=1.0.0"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Skipping virtualenv creation, as specified in config file. | |
Updating dependencies | |
Resolving dependencies... | |
1: fact: app is 0.1.0 | |
1: derived: app | |
1: fact: app depends on datumaaiguasol (^1.7.0) | |
1: fact: app depends on seaborn (^0.11.2) | |
1: fact: app depends on numpy (^1.22.3) | |
1: fact: app depends on pandas (^1.4.2) | |
1: fact: app depends on matplotlib (^3.5.2) | |
1: fact: app depends on typer (^0.4.1) | |
1: fact: app depends on black (^22.3.0) | |
1: fact: app depends on flake8 (^4.0.1) | |
1: fact: app depends on isort (^5.10.1) | |
1: fact: app depends on pytest (^7.1.2) | |
1: fact: app depends on black (^22.3.0) | |
1: fact: app depends on flake8 (^4.0.1) | |
1: fact: app depends on isort (^5.10.1) | |
1: fact: app depends on pytest (^7.1.2) | |
1: selecting app (0.1.0) | |
1: derived: pytest (>=7.1.2,<8.0.0) | |
1: derived: isort (>=5.10.1,<6.0.0) | |
1: derived: flake8 (>=4.0.1,<5.0.0) | |
1: derived: black (>=22.3.0,<23.0.0) | |
1: derived: typer[all] (>=0.4.1,<0.5.0) | |
1: derived: matplotlib (>=3.5.2,<4.0.0) | |
1: derived: pandas (>=1.4.2,<2.0.0) | |
1: derived: numpy (>=1.22.3,<2.0.0) | |
1: derived: seaborn (>=0.11.2,<0.12.0) | |
1: derived: datumaaiguasol (>=1.7.0,<2.0.0) | |
PyPI: 1 packages found for pytest >=7.1.2,<8.0.0 | |
1: Version solving took 0.250 seconds. | |
1: Tried 1 solutions. | |
Stack trace: | |
15 /opt/poetry/venv/lib/python3.9/site-packages/clikit/console_application.py:131 in run | |
129│ parsed_args = resolved_command.args | |
130│ | |
→ 131│ status_code = command.handle(parsed_args, io) | |
132│ except KeyboardInterrupt: | |
133│ status_code = 1 | |
14 /opt/poetry/venv/lib/python3.9/site-packages/clikit/api/command/command.py:120 in handle | |
118│ def handle(self, args, io): # type: (Args, IO) -> int | |
119│ try: | |
→ 120│ status_code = self._do_handle(args, io) | |
121│ except KeyboardInterrupt: | |
122│ if io.is_debug(): | |
13 /opt/poetry/venv/lib/python3.9/site-packages/clikit/api/command/command.py:171 in _do_handle | |
169│ handler_method = self._config.handler_method | |
170│ | |
→ 171│ return getattr(handler, handler_method)(args, io, self) | |
172│ | |
173│ def __repr__(self): # type: () -> str | |
12 /opt/poetry/venv/lib/python3.9/site-packages/cleo/commands/command.py:92 in wrap_handle | |
90│ self._command = command | |
91│ | |
→ 92│ return self.handle() | |
93│ | |
94│ def handle(self): # type: () -> Optional[int] | |
11 /opt/poetry/venv/lib/python3.9/site-packages/poetry/console/commands/update.py:47 in handle | |
45│ self._installer.update(True) | |
46│ | |
→ 47│ return self._installer.run() | |
48│ | |
10 /opt/poetry/venv/lib/python3.9/site-packages/poetry/installation/installer.py:103 in run | |
101│ local_repo = Repository() | |
102│ | |
→ 103│ return self._do_install(local_repo) | |
104│ | |
105│ def dry_run(self, dry_run=True): # type: (bool) -> Installer | |
9 /opt/poetry/venv/lib/python3.9/site-packages/poetry/installation/installer.py:235 in _do_install | |
233│ ) | |
234│ | |
→ 235│ ops = solver.solve(use_latest=self._whitelist) | |
236│ else: | |
237│ self._io.write_line("Installing dependencies from lock file") | |
8 /opt/poetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:65 in solve | |
63│ with self._provider.progress(): | |
64│ start = time.time() | |
→ 65│ packages, depths = self._solve(use_latest=use_latest) | |
66│ end = time.time() | |
67│ | |
7 /opt/poetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:233 in _solve | |
231│ | |
232│ try: | |
→ 233│ result = resolve_version( | |
234│ self._package, self._provider, locked=locked, use_latest=use_latest | |
235│ ) | |
6 /opt/poetry/venv/lib/python3.9/site-packages/poetry/mixology/__init__.py:7 in resolve_version | |
5│ solver = VersionSolver(root, provider, locked=locked, use_latest=use_latest) | |
6│ | |
→ 7│ return solver.solve() | |
8│ | |
5 /opt/poetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:84 in solve | |
82│ while next is not None: | |
83│ self._propagate(next) | |
→ 84│ next = self._choose_package_version() | |
85│ | |
86│ return self._result() | |
4 /opt/poetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:377 in _choose_package_version | |
375│ if locked is None or not dependency.constraint.allows(locked.version): | |
376│ try: | |
→ 377│ packages = self._provider.search_for(dependency) | |
378│ except ValueError as e: | |
379│ self._add_incompatibility( | |
3 /opt/poetry/venv/lib/python3.9/site-packages/poetry/puzzle/provider.py:139 in search_for | |
137│ packages = self.search_for_url(dependency) | |
138│ else: | |
→ 139│ packages = self._pool.find_packages(dependency) | |
140│ | |
141│ packages.sort( | |
2 /opt/poetry/venv/lib/python3.9/site-packages/poetry/repositories/pool.py:170 in find_packages | |
168│ packages = [] | |
169│ for repo in self._repositories: | |
→ 170│ packages += repo.find_packages(dependency) | |
171│ | |
172│ return packages | |
1 /opt/poetry/venv/lib/python3.9/site-packages/poetry/repositories/legacy_repository.py:264 in find_packages | |
262│ versions = self._cache.store("matches").get(key) | |
263│ else: | |
→ 264│ page = self._get("/{}/".format(dependency.name.replace(".", "-"))) | |
265│ if page is None: | |
266│ return [] | |
RepositoryError | |
401 Client Error: Unauthorized for url: https://pypi.myrepo.org/simple/pytest/ | |
at /opt/poetry/venv/lib/python3.9/site-packages/poetry/repositories/legacy_repository.py:393 in _get | |
389│ if response.status_code == 404: | |
390│ return | |
391│ response.raise_for_status() | |
392│ except requests.HTTPError as e: | |
→ 393│ raise RepositoryError(e) | |
394│ | |
395│ if response.status_code in (401, 403): | |
396│ self._log( | |
397│ "Authorization error accessing {url}".format(url=response.url), | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment